Skip to content

Commit

Permalink
Merge pull request #71 from elliotchance/0.9.x/70-version
Browse files Browse the repository at this point in the history
Adding version flag
  • Loading branch information
elliotchance authored Apr 26, 2017
2 parents 89ebb6a + 287ee5b commit 0fcc869
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ import (
"github.com/elliotchance/c2go/program"
)

const Version = "0.9.3"

var (
printAst = flag.Bool("print-ast", false, "Print AST before translated Go code.")
version = flag.Bool("version", false, "Print the version and exit.")
)

func readAST(data []byte) []string {
Expand Down Expand Up @@ -203,6 +206,12 @@ func main() {
}
flag.Parse()

if *version {
// Simply print out the version and exit.
fmt.Println(Version)
return
}

if flag.NArg() < 1 {
flag.Usage()
os.Exit(1)
Expand Down

0 comments on commit 0fcc869

Please sign in to comment.