Skip to content
This repository has been archived by the owner on Sep 17, 2021. It is now read-only.

Commit

Permalink
add version flag
Browse files Browse the repository at this point in the history
  • Loading branch information
preved911 committed Feb 17, 2020
1 parent 0a4f09a commit 9b99840
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
package main

import (
"fmt"
flag "github.com/spf13/pflag"
"log"
"os"
)

const AppVersion = "0.0.11"

func main() {
var configPath *string = flag.StringP("config", "c", "", "config file path")
var configPath *string = flag.StringP("config", "c", "", "specify config file path")
var version *bool = flag.BoolP("version", "v", false, "return tool version and exit")

flag.Parse()

if *version {
fmt.Printf("kube-certs-gen, version %s\n", AppVersion)
os.Exit(0)
}

cfg, err := parseConfig(configPath)
if err != nil {
log.Fatalln(err)
Expand Down

0 comments on commit 9b99840

Please sign in to comment.