Skip to content

Commit

Permalink
main: Add -v flag
Browse files Browse the repository at this point in the history
As Vanadia can be integrated into any automated workflow, some tools
may do "./vanadia -v" to ensure that Vanadia is in the right version
(otherwise, the tool may download newer version of Vanadia).
  • Loading branch information
saifulwebid committed Nov 8, 2017
1 parent 7b261ae commit 56662ec
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,27 @@ func main() {
inFileName = flag.String("input", "", "Location of .apib file as input.")
outFileName = flag.String("output", "", "Location of Postman file.")
configFileName = flag.String("config", defaultConfigFileName, "Location of vanadia.yml.")
printVersion = flag.Bool("version", false, "Display Vanadia version")

inFileByte []byte
outFile *os.File
err error
version string
)

// Short version for version (pun non intended)
flag.BoolVar(printVersion, "v", false, "Display Vanadia version")

flag.Parse()

if version == "" {
version = "HEAD"
}
if *printVersion {
fmt.Println("Vanadia version:", version)
return
}

if *inFileName == "" {
inFileByte, err = ioutil.ReadAll(os.Stdin)
} else {
Expand Down

0 comments on commit 56662ec

Please sign in to comment.