mkideal / cli

CLI - A package for building command line app with go
MIT License
730 stars 43 forks source link

Simplify access to nested args #38

Closed oakad closed 6 years ago

oakad commented 7 years ago

In an app with nested sub-commands, it may be necessary to look at the intermediate command's args. Currently, this is only achievable via GetArgvList method, which is unnecessarily complicated if one only wants to look at the args of the immediate sub-command parent.

An addition of ArgvAt(pos int) method to Context object, with the obvious semantics of return ctx.argvList[pos], (or something similar in intent) will be most welcome.

suntong commented 6 years ago

Please take a look at #46 -- would you like to submit a PR?

suntong commented 6 years ago

Only close after the doc has been updated as well?

mkideal commented 6 years ago

doc added.