Skip to content
This repository has been archived by the owner on Apr 27, 2022. It is now read-only.

PrintHelp without reflection #56

Open
nderjung opened this issue Sep 10, 2019 · 0 comments
Open

PrintHelp without reflection #56

nderjung opened this issue Sep 10, 2019 · 0 comments

Comments

@nderjung
Copy link

nderjung commented Sep 10, 2019

I've stumbled unto the situation where I am using sub commands as a primary mechanism to interact with an application. This means that the rootCmd performs no particular action at all and is left blank. As a first issue, omitting the Run attribute yields a:

panic: runtime error: invalid memory address or nil pointer dereference

However, as primary issue, it would be beneficial to be able to simply print the help output to indicate to the user of the need to use a sub-command. Perhaps, simply, as flaeg.PrintHelp(config) or during the omission of the Run attribute.

In other cases, perhaps more abstractly in the concept of contextualizing arguments and their values, printing the help output would also be useful in the aim of decreasing the likelihood of program misuse.

Currently, the PrintHelp method is exported but requires most of the backbone of the flaeg application to perform reflection and config reading in order to work.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant