File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package main
22
33import (
44 "flag"
5+ "fmt"
56 "os"
67 "bufio"
78 "io"
@@ -12,6 +13,11 @@ import (
1213func main () {
1314 flag .Parse ()
1415
16+ if len (flag .Args ()) < 2 {
17+ fmt .Println ("Too few args specified. Supported commands are 'times', 'unique' and 'hang'." )
18+ os .Exit (1 )
19+ }
20+
1521 var p core.Progress
1622 switch flag .Arg (0 ) {
1723 case "times" :
@@ -20,10 +26,14 @@ func main() {
2026 p = core .NewProgressUniques ()
2127 case "hang" :
2228 p = core .NewProgressHangs ()
29+ default :
30+ fmt .Printf ("Invalid command: '%s'. Supported commands are 'times', 'unique' and 'hang'.\n " , flag .Arg (0 ))
31+ os .Exit (1 )
2332 }
2433
2534 var line string
2635 for i := 1 ; i < flag .NArg (); i ++ {
36+ fmt .Printf ("-------- %s --------\n " , flag .Arg (i ))
2737 progressFile , err := os .Open (flag .Arg (i ))
2838 if err != nil {
2939 panic (err )
You can’t perform that action at this time.
0 commit comments