This supports listing VMs, taking options about what information to display. This is the first commit needing to support subcommands, so this adds the infrastructure for handling CLI commands to UbiRodish.
24 lines
597 B
Ruby
24 lines
597 B
Ruby
# frozen_string_literal: true
|
|
|
|
force_autoload = Config.production? || ENV["FORCE_AUTOLOAD"] == "1"
|
|
|
|
UbiRodish = Rodish.processor do
|
|
options("ubi [options] [subcommand [subcommand_options] ...]") do
|
|
on("--version", "show program version") { halt "0.0.0" }
|
|
on("--help", "show program help") { halt to_s }
|
|
end
|
|
|
|
# :nocov:
|
|
autoload_subcommand_dir("cli-commands") unless force_autoload
|
|
# :nocov:
|
|
end
|
|
|
|
Unreloader.record_dependency("lib/rodish.rb", __FILE__)
|
|
if force_autoload
|
|
Unreloader.require("cli-commands") {}
|
|
# :nocov:
|
|
else
|
|
Unreloader.autoload("cli-commands") {}
|
|
end
|
|
# :nocov:
|