File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -9,9 +9,12 @@ import (
99 "github.com/fatih/color"
1010)
1111
12+ const version = "0.0.1"
13+
1214var (
1315 opt sif.Options
1416 printOnlyFilenames bool
17+ showVersion bool
1518)
1619
1720func init () {
@@ -25,12 +28,18 @@ func init() {
2528 }
2629 flag .BoolVar (& opt .CaseInsensitive , "i" , false , "Ignore case distinctions in PATTERN" )
2730 flag .BoolVar (& printOnlyFilenames , "l" , false , "Only print filenames containing matches" )
31+ flag .BoolVar (& showVersion , "v" , false , "Display version" )
2832}
2933
3034func main () {
3135 flag .Parse ()
3236 args := flag .Args ()
3337
38+ if showVersion {
39+ fmt .Printf ("%s: %s" , os .Args [0 ], version )
40+ os .Exit (0 )
41+ }
42+
3443 dirs := make ([]string , 0 )
3544 switch flag .NArg () {
3645 case 0 : // without pattern
You can’t perform that action at this time.
0 commit comments