This commit is contained in:
Jeffrey Paul 2024-05-22 14:41:30 -07:00
parent 368fb6407d
commit 8f7b3f8d9c
2 changed files with 7 additions and 2 deletions

5
README.md Normal file
View File

@ -0,0 +1,5 @@
# installation
```
go install sneak.berlin/go/field@latest
```

View File

@ -10,13 +10,13 @@ import (
func main() {
if len(os.Args) < 2 {
fmt.Fprintf(os.Stderr, "usage: %s <field-number>", os.Args[0])
fmt.Fprintf(os.Stderr, "usage: %s <field-number>\n", os.Args[0])
os.Exit(1)
}
fieldNum, err := strconv.Atoi(os.Args[1])
if err != nil || fieldNum < 1 {
fmt.Fprintln(os.Stderr, "invalid field number:", os.Args[1])
fmt.Fprintln(os.Stderr, "error: invalid field number")
os.Exit(1)
}