Skip to content

Commit

Permalink
Add version outputting
Browse files Browse the repository at this point in the history
  • Loading branch information
kvz committed Sep 6, 2016
1 parent 25e7c95 commit c313388
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"flag"
"fmt"
"io/ioutil"
"os"
Expand All @@ -9,7 +10,17 @@ import (
"github.com/Acconut/hcl/json/parser"
)

// VERSION is what is returned by the `-v` flag
var VERSION = "v0.0.4"

func main() {
version := flag.Bool("version", false, "Prints current app version")
flag.Parse()
if *version {
fmt.Println(VERSION)
os.Exit(0)
}

if err := convert(); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
Expand Down

0 comments on commit c313388

Please sign in to comment.