You have two things here. First, you assigned --name to the method, and not to the entire CLI::Greet class. Therefore, if you use the command:
ruby greet.rb greet help hi
You are getting
Usage: greet.rb hi Options: [--name=NAME] # Default: there Say hi!
Which, yes, is false - it does not have a subcommand in the help. There, in Thor, an error was filed . He, however, correctly shows a variant of the method.
However, it looks like what you are looking for is a class method. This is a method defined for the entire CLI::Greet class, and not just for the #hi method.
You will do it as such:
require 'thor' require 'thor/group' module CLI class Greet < Thor desc 'hi', 'Say hi!' class_option :number, :type => :string, :description => 'Number to call', :default => '555-1212' method_option :name, :type => :string, :description => 'Name to greet', :default => 'there' def hi puts "Hi, #{options[:name]}! Call me at #{options[:number]}" end desc 'bye', 'say bye!' def bye puts "Bye! Call me at #{options[:number]}" end end class Root < Thor register CLI::Greet, 'greet', 'greet [COMMAND]', 'Greet with a command' tasks["greet"].options = CLI::Greet.class_options end end CLI::Root.start
In doing so, ruby greet.rb help greet returns
Usage: greet.rb greet [COMMAND] Options: [--number=NUMBER] # Default: 555-1212 Greet with a command
Note that a hack is still needed here: the tasks["greet"].options = CLI::Greet.class_options in CLI::Root . There is an error filed for this in Thor.