Skip to content

Instantly share code, notes, and snippets.

@flomotlik
Created February 24, 2012 13:51
Show Gist options
  • Save flomotlik/1901055 to your computer and use it in GitHub Desktop.
Save flomotlik/1901055 to your computer and use it in GitHub Desktop.
Using Thor subcommands
require 'thor'
require "sub"
class MyApp < Thor
desc "parentcommand SUBCOMMAND", "Some Parent Command"
subcommand "sub", Sub
end
MyApp.start
class Sub < Thor
desc "command", "an example task"
def command
puts "I'm a thor task!"
end
end
@anithri
Copy link

anithri commented Jan 24, 2015

Thank you! perfect example. short, consie and clear

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment