Class: Mxup::CLI
- Inherits:
-
Object
- Object
- Mxup::CLI
- Defined in:
- lib/mxup/cli.rb
Overview
Argv parser + dispatch. Keeps parsing rules in one place; the actual behaviour lives in Runner and the focused modules it drives.
Constant Summary collapse
- COMMANDS =
%w[up status down restart layout target exec watch].freeze
Instance Method Summary collapse
Instance Method Details
#run(argv) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/mxup/cli.rb', line 11 def run(argv) args, = parse(argv.dup) command = extract_command(args) # `mxup [config] <window>:<command>` — run a window's named command. # Only in the default (no explicit command keyword) path; `restart`/ # `target` etc. keep their own `session:windows` colon syntax. if command == 'up' && (spec = window_command_spec(args)) return run_window_command(spec, ) end dispatch(command, args, ) end |