From 120b24ca8fb034dad90362488173a2d88bf9ce7c Mon Sep 17 00:00:00 2001 From: Tom <75443136+lvlcn-t@users.noreply.github.com> Date: Wed, 16 Oct 2024 21:50:03 +0200 Subject: [PATCH] feat: add config shorthand (#210) Signed-off-by: lvlcn-t <75443136+lvlcn-t@users.noreply.github.com> --- cmd/root.go | 2 +- docs/sparrow.md | 2 +- docs/sparrow_run.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 886f9d18..61d35c54 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -43,7 +43,7 @@ func NewCmdRoot(version string) *cobra.Command { initConfig(cfgFile) }) - rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.sparrow.yaml)") + rootCmd.PersistentFlags().StringVarP(&cfgFile, "config", "c", "", "config file (default is $HOME/.sparrow.yaml)") return rootCmd } diff --git a/docs/sparrow.md b/docs/sparrow.md index 9a0cd66a..4c73c543 100644 --- a/docs/sparrow.md +++ b/docs/sparrow.md @@ -10,7 +10,7 @@ The check results are exposed via an API. ### Options ``` - --config string config file (default is $HOME/.sparrow.yaml) + -c, --config string config file (default is $HOME/.sparrow.yaml) -h, --help help for sparrow ``` diff --git a/docs/sparrow_run.md b/docs/sparrow_run.md index d9418a9a..ae454c0d 100644 --- a/docs/sparrow_run.md +++ b/docs/sparrow_run.md @@ -29,7 +29,7 @@ sparrow run [flags] ### Options inherited from parent commands ``` - --config string config file (default is $HOME/.sparrow.yaml) + -c, --config string config file (default is $HOME/.sparrow.yaml) ``` ### SEE ALSO