Skip to content

Instantly share code, notes, and snippets.

@flomotlik
Created February 24, 2012 13:51
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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