Skip to content

Commit 5db4bcd

Browse files
committed
Print version
1 parent 3801e36 commit 5db4bcd

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

1pwsafe.go

+13
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,27 @@ package main
33
import (
44
"bytes"
55
"encoding/csv"
6+
"flag"
7+
"fmt"
68
"io"
79
"log"
810
"os"
911
"strings"
1012
"text/template"
1113
)
1214

15+
var (
16+
version string
17+
fVersion = flag.Bool("v", false, "print program version")
18+
)
19+
1320
func main() {
21+
flag.Parse()
22+
if *fVersion {
23+
fmt.Fprintf(os.Stdout, "1pwsafe %s\n", version)
24+
os.Exit(0)
25+
}
26+
1427
w := csv.NewWriter(os.Stdout)
1528
r := csv.NewReader(os.Stdin)
1629
r.Comma = '\t'

0 commit comments

Comments
 (0)