diff options
| author | Fuwn <[email protected]> | 2026-01-26 09:47:11 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-01-26 09:47:11 +0000 |
| commit | fe7f87b30173973c7fd54a9e2a9c4ebe4db1a7f4 (patch) | |
| tree | 76da4bb6c0398bd92b9459469363b4d1977699b0 /internal/cli/cli.go | |
| parent | feat: Add force push flag (diff) | |
| download | mugi-fe7f87b30173973c7fd54a9e2a9c4ebe4db1a7f4.tar.xz mugi-fe7f87b30173973c7fd54a9e2a9c4ebe4db1a7f4.zip | |
feat: Add linear mode for sequential operations
Diffstat (limited to 'internal/cli/cli.go')
| -rw-r--r-- | internal/cli/cli.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/internal/cli/cli.go b/internal/cli/cli.go index 1bee391..306e242 100644 --- a/internal/cli/cli.go +++ b/internal/cli/cli.go @@ -16,6 +16,7 @@ type Command struct { ConfigPath string Verbose bool Force bool + Linear bool Help bool Version bool } @@ -36,6 +37,7 @@ func Parse(args []string) (Command, error) { args, cmd.ConfigPath = extractConfigFlag(args) args, cmd.Verbose = extractVerboseFlag(args) args, cmd.Force = extractForceFlag(args) + args, cmd.Linear = extractLinearFlag(args) for _, arg := range args { if arg == "-h" || arg == "--help" || arg == "help" { @@ -103,6 +105,7 @@ Flags: -c, --config <path> Override config file path -V, --verbose Show detailed output -f, --force Force push (use with caution) + -l, --linear Run operations sequentially Examples: mugi pull Pull all repositories from all remotes @@ -194,3 +197,20 @@ func extractForceFlag(args []string) ([]string, bool) { return remaining, force } + +func extractLinearFlag(args []string) ([]string, bool) { + var remaining []string + var linear bool + + for _, arg := range args { + if arg == "-l" || arg == "--linear" { + linear = true + + continue + } + + remaining = append(remaining, arg) + } + + return remaining, linear +} |