Loading buildstream/_frontend/cli.py +26 −7 Original line number Diff line number Diff line Loading @@ -107,6 +107,23 @@ def complete_target(args, incomplete): return complete_list def complete_artifact(args, incomplete): from .._context import Context ctx = Context() config = None for i, arg in enumerate(args): if arg in ('-c', '--config'): config = args[i + 1] ctx.load(config) # element targets are valid artifact names complete_list = complete_target(args, incomplete) complete_list.extend(ref for ref in ctx.artifactcache.cas.list_refs() if ref.startswith(incomplete)) return complete_list def override_completions(cmd, cmd_param, args, incomplete): """ :param cmd_param: command definition Loading @@ -121,13 +138,15 @@ def override_completions(cmd, cmd_param, args, incomplete): # We can't easily extend click's data structures without # modifying click itself, so just do some weak special casing # right here and select which parameters we want to handle specially. if isinstance(cmd_param.type, click.Path) and \ (cmd_param.name == 'elements' or if isinstance(cmd_param.type, click.Path): if (cmd_param.name == 'elements' or cmd_param.name == 'element' or cmd_param.name == 'except_' or cmd_param.opts == ['--track'] or cmd_param.opts == ['--track-except']): return complete_target(args, incomplete) if cmd_param.name == 'artifacts': return complete_artifact(args, incomplete) raise CompleteUnhandled() Loading Loading
buildstream/_frontend/cli.py +26 −7 Original line number Diff line number Diff line Loading @@ -107,6 +107,23 @@ def complete_target(args, incomplete): return complete_list def complete_artifact(args, incomplete): from .._context import Context ctx = Context() config = None for i, arg in enumerate(args): if arg in ('-c', '--config'): config = args[i + 1] ctx.load(config) # element targets are valid artifact names complete_list = complete_target(args, incomplete) complete_list.extend(ref for ref in ctx.artifactcache.cas.list_refs() if ref.startswith(incomplete)) return complete_list def override_completions(cmd, cmd_param, args, incomplete): """ :param cmd_param: command definition Loading @@ -121,13 +138,15 @@ def override_completions(cmd, cmd_param, args, incomplete): # We can't easily extend click's data structures without # modifying click itself, so just do some weak special casing # right here and select which parameters we want to handle specially. if isinstance(cmd_param.type, click.Path) and \ (cmd_param.name == 'elements' or if isinstance(cmd_param.type, click.Path): if (cmd_param.name == 'elements' or cmd_param.name == 'element' or cmd_param.name == 'except_' or cmd_param.opts == ['--track'] or cmd_param.opts == ['--track-except']): return complete_target(args, incomplete) if cmd_param.name == 'artifacts': return complete_artifact(args, incomplete) raise CompleteUnhandled() Loading