Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A nice API for constructing complex shell commands
Ruby
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
spec
.gitignore
.rbenv-version
Gemfile
README.md
Rakefile
sh.gemspec

README.md

Sh::Cmd

Sh::Cmd is useful for constructing large Sh commands programmatically. It also has the benefit of Shell escaping any args you pass.

Usage:

cmd = Sh::Cmd.new("git") do |c|
  c.arg "log"
  c.opt "--oneline"
end

# OR

cmd = Sh::Cmd.new("git").arg("log").opt("--oneline")

puts cmd # => "git log --oneline"
Something went wrong with that request. Please try again.