add version

This commit is contained in:
Dan Ballard 2018-05-29 10:28:52 -07:00
parent e6adae8150
commit 82f90889df
3 changed files with 16 additions and 0 deletions

View File

@ -74,6 +74,12 @@ func (ph *processHandler) ProcessLine(line string, indentLevel int, headerStack
} }
func main() { func main() {
if len(os.Args) > 1 {
fmt.Println(os.Args)
fmt.Println("Markdown Bullet Journal version: " + process.Version)
return
}
ph := new(processHandler) ph := new(processHandler)
files := process.GetFiles() files := process.GetFiles()

View File

@ -7,6 +7,7 @@ import (
"runtime" "runtime"
"strconv" "strconv"
"strings" "strings"
"fmt"
) )
type header struct { type header struct {
@ -84,6 +85,11 @@ func (ph *processHandler) ProcessLine(line string, indentLevel int, headerStack
} }
func main() { func main() {
if len(os.Args) > 1 {
fmt.Println("Markdown Bullet Journal version: " + process.Version)
return
}
ph := new(processHandler) ph := new(processHandler)
if runtime.GOOS == "windows" { if runtime.GOOS == "windows" {

View File

@ -10,6 +10,10 @@ import (
"strings" "strings"
) )
const (
Version = "1.1"
)
var ( var (
todoTaskExp = regexp.MustCompile("^\\[([ \\.xX]*)\\]") todoTaskExp = regexp.MustCompile("^\\[([ \\.xX]*)\\]")
startSpaces = regexp.MustCompile("^[\t ]*") startSpaces = regexp.MustCompile("^[\t ]*")