sh

by devinus

devinus / sh

Run programs as functions in Elixir

126 Stars 8 Forks Last release: Not found The Unlicense 31 Commits 4 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

Sh

Build Status

Support via Gratipay

An Elixir module inspired by Python's sh package.

Sh
allows you to call any program as if it were a function.

Adding Sh to Your Project

To use Sh with your projects, simply edit your mix.exs file and add it as a dependency:

  defp deps do
    [{:sh, "~> 1.1.2"}]
  end

Example

iex> Sh.echo "Hello World!"
"Hello World!\n"

Options

Sh
commands accept as the last argument a list of options.
Sh.curl "http://example.com/", o: "page.html", silent: true
""

The equivalent call without using this feature would be:

Sh.curl "-o", "page.html", "--silent", "http://example.com/"

Underscores

Underscores in a program name or keyword options are converted to dashes.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.