access whole command list #1129
-
Hello! So I have a use case where I'm trying to build a cli configuration tool to eventually create a yaml file. I'd like to have the options the user enters autocomplete and eventually store in a dict I'm maintaining for dumping to said yaml. I was looking to use the arg_tokens feature like this: Pass a dict of dicts structure like this or similar to a completer function:
Then I'd like to return completion items to let them tab complete/ get description text for things to eventually get a line like I'm getting stuck in that I see the line in cmd2_statement.get(), but it's just a string so I can parse that, but I wonder if there's a better way to do all this? I feel like I'm recreating a wheel here. Any help or suggestions appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
The I don't fully understand the problem you're trying to solve. Can you share a code snippet so I can help further? |
Beta Was this translation helpful? Give feedback.
The
get()
method you're calling returns acmd2.Statement
object. It's a class that inherits from string and has other members added bycmd2
. It is documented here. See if any of those members are what you're looking for.I don't fully understand the problem you're trying to solve. Can you share a code snippet so I can help further?