Class: Hako::CLI::Stop
- Inherits:
-
Object
- Object
- Hako::CLI::Stop
- Defined in:
- lib/hako/cli.rb
Instance Method Summary collapse
Instance Method Details
#parse!(argv) ⇒ Object
292 293 294 295 296 297 298 299 300 301 |
# File 'lib/hako/cli.rb', line 292 def parse!(argv) @dry_run = false parser.parse!(argv) @definition_path = argv.first if @definition_path.nil? puts parser.help exit 1 end end |
#parser ⇒ Object
303 304 305 306 307 308 309 |
# File 'lib/hako/cli.rb', line 303 def parser @parser ||= OptionParser.new do |opts| opts. = 'hako stop FILE' opts.version = VERSION opts.on('-n', '--dry-run', 'Enable dry-run mode') { @dry_run = true } end end |
#run(argv) ⇒ Object
284 285 286 287 288 289 290 |
# File 'lib/hako/cli.rb', line 284 def run(argv) parse!(argv) require 'hako/application' require 'hako/commander' Commander.new(Application.new(@definition_path, expand_variables: false)).stop(dry_run: @dry_run) end |