![]() completer = EnvironCompleter argcomplete. Way to do this at definition time is: from pleters import EnvironCompleter parser = argparse. To specify a completer for an argument or option, set the completer attribute of its associated action. Variables might look like this: def EnvironCompleter ( ** kwargs ): return os. An example completer for names of environment parsed_args: The result of argument parsing so far (the argparse.Namespace args object normally returned byĬompleters should return their completions as a list of strings.parser: The argparse.ArgumentParser instance that the action was taken by. ![]() action: The argparse.Action instance that this completer was called for.prefix: The prefix text of the last word before the cursor on the command line.įor dynamic completers, this can be used to reduce the work required to generate possible completions.They are called with the following keyword arguments: You can specify custom completion functions for your options and arguments.
0 Comments
Leave a Reply. |