File: subcommand.thor

package info (click to toggle)
ruby-thor 1.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 904 kB
  • sloc: ruby: 9,250; makefile: 8; sh: 1
file content (17 lines) | stat: -rw-r--r-- 266 bytes parent folder | download | duplicates (8)
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