-
-
Save rummelonp/5316599 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'thor' | |
class Command < Thor | |
class Example < Thor | |
::Command.register(self, :example, 'example [COMMAND]', 'example namespace') | |
class App < Thor | |
Example.register(self, :app, 'app [COMMAND]', 'app namespace') | |
desc :install, 'install something' | |
def install | |
puts 'run example app install' | |
end | |
end | |
end | |
end | |
Command.start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./command.rb example app install | |
run example app install | |
$ ./command.rb help | |
Commands: | |
command.rb app [COMMAND] # app namespace | |
command.rb example [COMMAND] # example namespace | |
command.rb example [COMMAND] # example namespace | |
command.rb help [COMMAND] # Describe subcommands or one specific subcommand | |
command.rb help [COMMAND] # Describe available commands or one specific command | |
# ヘルプの表示がおかしいし実際 Command には example と help タスクしかない |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment