pass the namespace to completion function
See original GitHub issueI would like to set a choices_function that depends on the previous arguments, i.e., I believe cmd2 should pass the current parser namespace when calling the choices_function
Like I have this first argument that loads a csv file, and I would like the 2nd argument to choose between availables ids in the previously loaded csv file.
Right now the choices_function looks a bit useless and can only return static results.
Issue Analytics
- State:
- Created 4 years ago
- Comments:36 (24 by maintainers)
Top Results From Across the Web
c++ - How do I pass a function within a namespace as a non ...
It seems that you want to pass a member function. This example may help you. class A { public: int i; int fun(int...
Read more >Pass a custom Namespace to args · Issue #596 - GitHub
I want to pass a custom Namespace when parsing arguments while keeping the autocompletion: @with_argparser(parser) def do_load_pcap(self, ...
Read more >Template Functions and Pipelines - Helm
Both name and namespace are optional and can be passed as an empty string ( "" ). The following combination of parameters are...
Read more >getFromNamespace: Utility Functions for Developing ... - Rdrr.io
Utility functions to access and replace the non-exported functions in a namespace, for use in developing packages with namespaces.
Read more >Operators Scope
A namespace-scoped operator watches and manages resources in a ... a CR created in a Namespace not in the set passed to Options...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@teto I added a member to the namespace I pass you called
__parser__. See if this helps accomplish what you’re trying to do.@kmvanbrunt is working on an update to the autocompleter that will give the completer function that will give a dict containing all prior arguments.