File: subcommand.thor

package info (click to toggle)
ruby-thor 0.19.1-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 792 kB
  • ctags: 564
  • sloc: ruby: 7,315; makefile: 2; sh: 1
file content (17 lines) | stat: -rw-r--r-- 266 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module TestSubcommands

  class Subcommand < Thor
    desc "print_opt", "My method"
    def print_opt
      print options["opt"]
    end
  end

  class Parent < Thor
    class_option "opt"

    desc "sub", "My subcommand"
    subcommand "sub", Subcommand
  end

end