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

Improve Slop commands #76

Merged
merged 2 commits into from
Aug 21, 2012

Conversation

kyrylo
Copy link
Contributor

@kyrylo kyrylo commented Aug 18, 2012

Partially fixes #72.

In this pull request:

Add Slop::Commands#present? method

Extend current Commands by adding a convenient method, which helps to use such code as:

if cmds.present?(:install)
  run_installer
else
  # Do something else.
end

Example:

cmds.parse %w( foo )
cmds.present?(:foo) #=> true
cmds.present?(:bar) #=> false
Implement basic support for command arguments

Example:

cmds.parse %w( install geronimo banzai --outdir dir )
cmds.arguments #=> ["geronimo", "banzai"]

Extend current Commands by adding a convenient method, which helps to
use such code as:

  if cmds.present?(:install)
    run_installer
  else
    # Do something else.
  end

Example:

  cmds.parse %w( foo )
  cmds.present?(:foo) #=> true
  cmds.present?(:bar) #=> false

Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
Example:

  cmds.parse %w( install geronimo banzai --outdir dir )
  cmds.arguments #=> ["geronimo", "banzai"]

Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
@travisbot
Copy link

This pull request fails (merged c1af853 into 7419ce8).

1 similar comment
@travisbot
Copy link

This pull request fails (merged c1af853 into 7419ce8).

leejarvis pushed a commit that referenced this pull request Aug 21, 2012
@leejarvis leejarvis merged commit b839199 into leejarvis:master Aug 21, 2012
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

Successfully merging this pull request may close these issues.

Commands should support arguments
3 participants