You are viewing an older version (5.14.3). Go to latest (5.15.0)
{ } Raw JSON

bundles / traitlets 5.14.3 / traitlets / config / application / Application / _get_sys_argv

classmethod

traitlets.config.application:Application._get_sys_argv

source: /traitlets/config/application.py :793

Summary

Get sys.argv or equivalent from argcomplete

Extended Summary

argcomplete's strategy is to call the python script with no arguments, so len(sys.argv) == 1, and run until the ArgumentParser is constructed and determine what completions are available.

On the other hand, traitlet's subcommand-handling strategy is to check sys.argv[1] and see if it matches a subcommand, and if so then dynamically load the subcommand app and initialize it with sys.argv[1:].

This helper method helps to take the current tokens for argcomplete and pass them through as argv.

Aliases

  • traitlets.config.Application._get_sys_argv