feat: Add shell completions for zsh,fish

This commit is contained in:
Karan Sharma 2021-04-21 11:40:21 +05:30
parent 45dd2e2af2
commit 7b858c5a93
5 changed files with 60 additions and 5 deletions

View file

@ -1,6 +1,7 @@
package main
import (
"fmt"
"os"
"time"
@ -50,6 +51,8 @@ func main() {
f.Bool("color", true, "Show colored output")
f.Bool("debug", false, "Enable debug mode")
f.Bool("version", false, "Show version of doggo")
// Parse and Load Flags.
err := f.Parse(os.Args[1:])
if err != nil {
@ -62,6 +65,12 @@ func main() {
app.Logger.Exit(2)
}
// If version flag is set, output version and quit.
if k.Bool("version") {
fmt.Printf("%s - %s\n", buildVersion, buildDate)
app.Logger.Exit(0)
}
// Set log level.
if k.Bool("debug") {
// Set logger level