cobracmd: standard completion and exit codes for cobra programs; bash install line via eval
New module yetano.dev/yetano/core/cobracmd (own go.mod, cobra stays out of the main module): Completion replaces cobra's default completion command, which exits 0 for an unknown shell, with one that accepts only bash|zsh|fish|powershell (exit 2 otherwise); Execute maps cobra's usage errors to exit 2, other errors to 1. completion: the bash script's install line is eval "$(prog completion bash)" -- bash 3.2 on macOS cannot source a process substitution. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
fa52990e3e
commit
5288c4ce74
6 files changed
+317
-1
No files matched your search
@@ -0,0 +1,10 @@
|
||||
module yetano.dev/yetano/core/cobracmd
|
||||
|
||||
go 1.25.0
|
||||
|
||||
require github.com/spf13/cobra v1.10.2
|
||||
|
||||
require (
|
||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||
github.com/spf13/pflag v1.0.9 // indirect
|
||||
)
|
||||
Reference in new issue
Block a user