fix: alias argument expansion with flags and spaces

Fixes an issue where alias arguments containing spaces or flags were being split incorrectly by using strings.Fields on the substituted command string. Instead, the command string is tokenized first and then substitution happens on each token.

Also disables Cobra flag parsing for aliases dynamically so that arguments and flags correctly cascade down to the target command instead of throwing unknown flag errors.
This commit is contained in:
2026-03-29 19:09:06 +02:00
parent 13b4c4b651
commit 05261522a0
4 changed files with 66 additions and 12 deletions

9
go.mod
View File

@@ -2,20 +2,23 @@ module axolotl
go 1.25.8
require (
github.com/fatih/color v1.19.0
github.com/spf13/cobra v1.10.2
modernc.org/sqlite v1.47.0
)
require (
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/fatih/color v1.19.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/ncruces/go-strftime v1.0.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/spf13/cobra v1.10.2 // indirect
github.com/spf13/pflag v1.0.9 // indirect
golang.org/x/sys v0.42.0 // indirect
modernc.org/libc v1.70.0 // indirect
modernc.org/mathutil v1.7.1 // indirect
modernc.org/memory v1.11.0 // indirect
modernc.org/sqlite v1.47.0 // indirect
)