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

RFE: show app_specific.rb methods in help output #374

Closed
joemfb opened this issue Feb 13, 2015 · 4 comments
Closed

RFE: show app_specific.rb methods in help output #374

joemfb opened this issue Feb 13, 2015 · 4 comments
Milestone

Comments

@joemfb
Copy link
Contributor

joemfb commented Feb 13, 2015

I'm often opening up or cat'ing deploy/app_specific.rb to see what custom methods are available. It'd be handy to have them available in the ./ml -h command output.

@grtjn
Copy link
Contributor

grtjn commented Feb 14, 2015

+1

I have been thinking about that recently as well. Not sure you can list them using introspection, but you can append to the Help class..

@grtjn
Copy link
Contributor

grtjn commented Feb 14, 2015

Experimented a bit. How about:

Help.rb changes:

  def self.usage
    help = <<-DOC.strip_heredoc

      Usage:
        ml [ENVIRONMENT] COMMAND [ARGS]

      General commands (no environment):
         ...
    DOC

    help += app_specific || ''

    help += <<-DOC.strip_heredoc

      All commands can be run with -h or --help for more information.
    DOC

    help
  end

  def self.app_specific
    #stub
  end

And then you append this to app_specific.rb:

class Help
  def self.app_specific
    <<-DOC.strip_heredoc

      App-specific commands:
        example       Installs app-specific alerting
    DOC
  end
end

grtjn added a commit to grtjn/roxy that referenced this issue Feb 20, 2015
grtjn added a commit to grtjn/roxy that referenced this issue Feb 20, 2015
@grtjn grtjn modified the milestone: 1.7.2 Feb 20, 2015
dmcassel added a commit that referenced this issue Feb 23, 2015
@grtjn
Copy link
Contributor

grtjn commented Feb 24, 2015

Fixed in dev

@grtjn grtjn closed this as completed Feb 24, 2015
@joemfb
Copy link
Contributor Author

joemfb commented Feb 24, 2015

Awesome, thanks Geert!

grtjn added a commit to grtjn/roxy that referenced this issue Feb 24, 2015
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

2 participants