Runfile - If Rake and Docopt had a baby

Gem Version Build Status Code Climate Dependency Status

A beautiful command line application framework.
Rake-inspired, Docopt inside.

Wait, What?

Runfile lets you create command line applications in a way similar to Rake, but with the full power of Docopt command line options.

You create a Runfile, and execute commands with run command arguments -and --flags.

Learn More in the Wiki

Install

$ gem install runfile

Quick Start

$ run make       # create a new Runfile
$ run --help     # show the usage patterns
$ vi Runfile     # edit the Runfile

Example

The most minimal Runfile looks like this:

usage  "greet <name>"
action :greet do |args|
    puts "Hello #{args['<name>']}" 
end

You can then run it by executing this command:

$ run greet Luke
Hello Luke

Executing run without parameters, will show the usage patterns:

$ run
Usage:
  run greet <name>
  run (-h|--help|--version)

Executing run --help will show the full help document (docopt)

$ run --help
Runfile 0.0.0

Usage:
  run greet <name>
  run (-h|--help|--version)

Options:
  -h --help
      Show this screen

  --version
      Show version

Runfile per project or global Runfiles

In addition to the per project Runfile files, it is also possible to create global runfiles that are accessible to you only or to anybody on the system.

When you execute run, we will look for files in this order:

  • Runfile in the current directory
  • *.runfile in the current folder or sub folders
  • ~/runfile/**/*.runfile
  • /etc/runfile/**/*.runfile

When you execute run!, we will ignore the local Runfile (if present) and only search for global (named) runfiles.

Read more in the Runfile Location and Filename wiki page

Documentation