Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there anyway to display help from within an action? #3

Open
pietschy opened this issue Sep 26, 2013 · 4 comments
Open

Is there anyway to display help from within an action? #3

pietschy opened this issue Sep 26, 2013 · 4 comments

Comments

@pietschy
Copy link

Howdy,

I've got an app with a number of commands and I'd like to display the help if the global action is run. Is there an easy way to do that?

Thanks

@pietschy
Copy link
Author

Looking into a bit the method to invoke seems to be Trollop::Parser#educate but it looks like it might be tricky to invoke it. For a quick hack I'm just calling:

    app.action do |options, arguments|
      puts `#{__FILE__} --help`
    end

@skorks
Copy link
Owner

skorks commented Sep 27, 2013

Hmm, there is no easy way right now, I like your hack though, very clever.

@pietschy
Copy link
Author

An old colleague would have described it as brute force and ignorance so I'm happy to go with clever (c:

@justinfrench
Copy link

@skorks I too would love to provide --help by default, please consider the is a feature request ;)

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

No branches or pull requests

3 participants