Skip to content

Commit

Permalink
feat: version option
Browse files Browse the repository at this point in the history
  • Loading branch information
GNITOAHC committed Oct 4, 2024
1 parent 5fe3393 commit 06d5fe9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
)

var (
version bool
outputfile string
watch bool
port string
Expand Down Expand Up @@ -86,6 +87,7 @@ func write(inputfile, outputfile string) {
}

func init() {
flag.BoolVar(&version, "v", false, "Version of the program")
flag.BoolVar(&watch, "w", false, "Watch for changes in the markdown file")
flag.StringVar(&outputfile, "o", "out.html", "Name of the output file")
flag.StringVar(&port, "p", "8080", "Port to serve the HTML file")
Expand All @@ -100,6 +102,11 @@ func main() {
flag.Parse()
inputfile := flag.Arg(0)

if version {
fmt.Println("md-html v0.1.0")
return
}

// Initial write
write(inputfile, outputfile)

Expand Down

0 comments on commit 06d5fe9

Please sign in to comment.