Last active
January 12, 2019 12:13
-
-
Save ivanzoid/0830f400d1319cf66a294b3912f2974e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
"flag" | |
"path/filepath" | |
) | |
func usage() { | |
fmt.Fprintf(os.Stderr, "usage: %v arg\n", filepath.Base(os.Args[0])) | |
os.Exit(2) | |
} | |
func main() { | |
flag.Usage = usage | |
flag.Parse() | |
if flag.NArg() == 0 { | |
usage() | |
} | |
arg := flag.Arg(0) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment