question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pass the namespace to completion function

See original GitHub issue

I 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:closed
  • Created 4 years ago
  • Comments:36 (24 by maintainers)

github_iconTop GitHub Comments

1reaction
kmvanbruntcommented, Aug 21, 2019

@teto I added a member to the namespace I pass you called __parser__. See if this helps accomplish what you’re trying to do.

1reaction
anselorcommented, Aug 17, 2019

@kmvanbrunt is working on an update to the autocompleter that will give the completer function that will give a dict containing all prior arguments.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found