Skip to content

Commit

Permalink
add -q to suppress logging
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelMraka authored and vkrizan committed Aug 7, 2023
1 parent 3c80cc1 commit d3843a7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions gabi-cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"flag"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"os"
Expand Down Expand Up @@ -36,6 +37,7 @@ func main() {
kubeconfigPath = flag.String("kubeconfig", "", "absolute path to the kubeconfig file")
}
showHelp := flag.Bool("h", false, "Shows help")
quiet := flag.Bool("q", false, "Suppress logging messages")
namespace := flag.String("n", "", "Namespace (defaults to current context)")
flag.Parse()

Expand All @@ -44,6 +46,9 @@ func main() {
os.Exit(1)
}

if *quiet {
log.SetOutput(ioutil.Discard)
}
kubeconfig, config := setupK8s(*kubeconfigPath)
setDefaultNamespace(kubeconfig, namespace)

Expand Down

0 comments on commit d3843a7

Please sign in to comment.