Class: DrydockerOptions
- Inherits:
-
Object
- Object
- DrydockerOptions
- Defined in:
- bin/drydocker
Overview
Command line parser to setup options :name, :command, :image, :entrypoint, :path
Class Method Summary collapse
Class Method Details
.parse(args) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'bin/drydocker', line 9 def self.parse(args) = Drydocker::Config.default_config opt_parser = OptionParser.new do |opts| opts. = 'Usage: drydocker [options]' opts.separator '' opts.separator 'Specific options:' opts.on('-f', '--filename [FILENAME]', 'File of options to load') do |fn| .load(fn) end opts.on('-n', '--name [NAME]') do |name| [:name] = name end opts.on('-c', '--command [COMMAND]') do |cmd| [:command] = cmd end opts.on('-i', '--image [IMAGE]') do |img| [:image] = img end opts.on('-e', '--entrypoint [ENTRYPOINT]') do |entry| [:entrypoint] = entry end opts.on('-p', '--path [PATH]') do |path| [:path] = path end end opt_parser.parse!(args) end |