fix: Properly pass args to start when no command is given
All checks were successful
Integration Tests / test (3.1.6, 1.5) (push) Successful in 1m19s
Integration Tests / test (3.1.6, 1.6) (push) Successful in 1m19s
Integration Tests / test (3.1.6, 1.7) (push) Successful in 1m18s
Integration Tests / test (3.1.6, 1.8) (push) Successful in 1m25s
Integration Tests / test (3.1.6, 1.9) (push) Successful in 1m48s
Integration Tests / test (3.1.6, 2.0) (push) Successful in 1m39s
Integration Tests / test (3.1.6, 2.1) (push) Successful in 1m25s
Integration Tests / test (3.1.6, 2.2) (push) Successful in 1m27s
Integration Tests / test (3.1.6, 2.3) (push) Successful in 1m27s
Integration Tests / test (3.1.6, 2.4) (push) Successful in 1m28s
Integration Tests / test (3.1.6, 2.5) (push) Successful in 1m28s
Integration Tests / test (3.1.6, 2.6) (push) Successful in 1m30s
Integration Tests / test (3.1.6, 2.7) (push) Successful in 1m29s
Integration Tests / test (3.1.6, 2.8) (push) Successful in 1m34s
Integration Tests / test (3.1.6, 2.9) (push) Successful in 1m34s
Integration Tests / test (3.1.6, 2.9a) (push) Successful in 1m30s
Integration Tests / test (3.1.6, 3.0) (push) Successful in 1m35s
Integration Tests / test (3.1.6, 3.1) (push) Successful in 1m34s
Integration Tests / test (3.1.6, 3.0a) (push) Successful in 1m36s
Integration Tests / test (3.1.6, 3.1a) (push) Successful in 1m34s
Integration Tests / test (3.1.6, 3.1b) (push) Successful in 1m33s
Integration Tests / test (3.1.6, 3.1c) (push) Successful in 1m30s
Integration Tests / test (3.1.6, 3.2) (push) Successful in 1m38s
Integration Tests / test (3.1.6, 3.2a) (push) Successful in 1m42s
Integration Tests / test (3.1.6, 3.3) (push) Successful in 1m42s
Integration Tests / test (3.1.6, 3.3a) (push) Successful in 1m39s
Integration Tests / test (3.1.6, 3.4) (push) Successful in 1m46s
Integration Tests / test (3.1.6, 3.5) (push) Successful in 1m44s
Integration Tests / test (3.1.6, 3.5a) (push) Successful in 1m44s
Integration Tests / test (3.2.5, 1.5) (push) Successful in 1m16s
Integration Tests / test (3.2.5, 1.6) (push) Successful in 1m20s
Integration Tests / test (3.2.5, 1.7) (push) Successful in 1m15s
Integration Tests / test (3.2.5, 1.8) (push) Successful in 1m20s
Integration Tests / test (3.2.5, 1.9) (push) Successful in 1m26s
Integration Tests / test (3.2.5, 2.0) (push) Successful in 1m25s
Integration Tests / test (3.2.5, 2.1) (push) Successful in 1m23s
Integration Tests / test (3.2.5, 2.2) (push) Successful in 1m29s
Integration Tests / test (3.2.5, 2.3) (push) Successful in 1m27s
Integration Tests / test (3.2.5, 2.4) (push) Successful in 1m30s
Integration Tests / test (3.2.5, 2.5) (push) Successful in 1m28s
Integration Tests / test (3.2.5, 2.6) (push) Successful in 1m21s
Integration Tests / test (3.2.5, 2.7) (push) Successful in 1m31s
Integration Tests / test (3.2.5, 2.8) (push) Successful in 1m32s
Integration Tests / test (3.2.5, 2.9) (push) Successful in 1m44s
Integration Tests / test (3.2.5, 2.9a) (push) Successful in 1m28s
Integration Tests / test (3.2.5, 3.0) (push) Successful in 1m31s
Integration Tests / test (3.2.5, 3.0a) (push) Successful in 1m30s
Integration Tests / test (3.2.5, 3.2a) (push) Successful in 1m38s
Integration Tests / test (3.2.5, 3.3) (push) Successful in 1m43s
Integration Tests / test (3.2.5, 3.3a) (push) Successful in 1m39s
Integration Tests / test (3.2.5, 3.4) (push) Successful in 1m47s
Integration Tests / test (3.2.5, 3.5) (push) Successful in 1m44s
Integration Tests / test (3.3.5, 1.8) (push) Successful in 1m27s
Integration Tests / test (3.3.5, 2.1) (push) Successful in 1m32s
Integration Tests / test (3.2.5, 3.1) (push) Successful in 1m31s
Integration Tests / test (3.2.5, 3.1a) (push) Successful in 1m31s
Integration Tests / test (3.2.5, 3.1b) (push) Successful in 1m34s
Integration Tests / test (3.2.5, 3.1c) (push) Successful in 1m37s
Integration Tests / test (3.2.5, 3.2) (push) Successful in 1m43s
Integration Tests / test (3.2.5, 3.5a) (push) Successful in 1m46s
Integration Tests / test (3.3.5, 1.5) (push) Successful in 1m16s
Integration Tests / test (3.3.5, 1.6) (push) Successful in 1m26s
Integration Tests / test (3.3.5, 1.7) (push) Successful in 1m25s
Integration Tests / test (3.3.5, 1.9) (push) Successful in 1m27s
Integration Tests / test (3.3.5, 2.0) (push) Successful in 1m28s
Integration Tests / test (3.3.5, 2.2) (push) Successful in 1m30s
Integration Tests / test (3.3.5, 2.3) (push) Successful in 1m28s
Integration Tests / test (3.3.5, 2.4) (push) Successful in 1m27s
Integration Tests / test (3.3.5, 2.5) (push) Successful in 1m31s
Integration Tests / test (3.3.5, 2.6) (push) Successful in 1m30s
Integration Tests / test (3.3.5, 2.7) (push) Successful in 1m33s
Integration Tests / test (3.3.5, 2.8) (push) Successful in 1m29s
Integration Tests / test (3.3.5, 2.9) (push) Successful in 1m33s
Integration Tests / test (3.3.5, 2.9a) (push) Successful in 1m29s
Integration Tests / test (3.3.5, 3.0) (push) Successful in 1m30s
Integration Tests / test (3.3.5, 3.0a) (push) Successful in 1m35s
Integration Tests / test (3.3.5, 3.1) (push) Successful in 1m35s
Integration Tests / test (3.3.5, 3.1a) (push) Successful in 1m34s
Integration Tests / test (3.3.5, 3.1b) (push) Successful in 1m38s
Integration Tests / test (3.3.5, 3.1c) (push) Successful in 1m35s
Integration Tests / test (3.3.5, 3.2) (push) Successful in 1m38s
Integration Tests / test (3.3.5, 3.2a) (push) Successful in 1m37s
Integration Tests / test (3.3.5, 3.3) (push) Successful in 1m39s
Integration Tests / test (3.3.5, 3.3a) (push) Successful in 1m42s
Integration Tests / test (3.3.5, 3.4) (push) Successful in 1m46s
Integration Tests / test (3.3.5, 3.5) (push) Successful in 1m45s
Integration Tests / test (3.3.5, 3.5a) (push) Successful in 1m45s

Problem

mux start [project] [args]

should behave the same as:

mux [project] [args]

Currently, the args are not passed through to the start command as
Thor `options` - they come through as args instead.

Solution

Fix the call to Tmuxinator::Cli#start when a project name is passed in
by simply appending `:start` to the args, as the first argument is the
subcommand in Thor::Cli.

Signed-off-by: Andrew Kofink <ajkofink@gmail.com>
This commit is contained in:
Andrew Kofink
2025-03-17 08:08:21 -04:00
parent 5ef509d783
commit a745a629b9
3 changed files with 5 additions and 7 deletions

View File

@@ -1,6 +1,8 @@
## Unreleased
### Features
- Add support for tmuxinator start --append
### Fixes
- Properly pass additional arguments to the start command when no command is given
## 3.3.3
### Features

View File

@@ -438,7 +438,7 @@ module Tmuxinator
Tmuxinator::Cli.new.local
elsif name && !Tmuxinator::Cli::RESERVED_COMMANDS.include?(name) &&
Tmuxinator::Config.exist?(name: name)
Tmuxinator::Cli.new.start(name, *args.drop(1))
Tmuxinator::Cli.start([:start, *args])
else
Tmuxinator::Cli.start(args)
end

View File

@@ -99,9 +99,7 @@ describe Tmuxinator::Cli do
end
it "should call #start" do
instance = instance_double(cli)
expect(cli).to receive(:new).and_return(instance)
expect(instance).to receive(:start).with(*args)
expect(cli).to receive(:start).with([:start, *args])
subject
end
@@ -109,9 +107,7 @@ describe Tmuxinator::Cli do
let(:args) { ["sample", "--append"] }
it "should call #start" do
instance = instance_double(cli)
expect(cli).to receive(:new).and_return(instance)
expect(instance).to receive(:start).with("sample", "--append")
expect(cli).to receive(:start).with([:start, *args])
subject
end
end