You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately, short of writing my own commandline parser this won't be something to easily detect.
Here is a sample program at https://play.golang.org/p/NEgNeUVMcb
package main
import (
"flag""fmt"
)
funcmain() {
varname, seasonstringvarverboseboolflag.StringVar(&name, "name", "default-name", "the name to set")
flag.StringVar(&season, "season", "winter", "the current season")
flag.BoolVar(&verbose, "verbose", false, "the verbosity")
flag.Parse()
fmt.Printf("name: %s\nprogram: %s\nverbosity: %v", name, season, verbose)
}
when run:
arguments well provided
$ go run main.go --verbose --name drive
name: drive
program: winter
verbosity: true
misplaced arguments
$ go run main.go --verbose few ones --name drive
name: default-name
program: winter
as you can see, using stdlib package flag to accomodate the request would require creating a new module entirely
It seems that sometimes drive fails silently, e.g. if the command line switches aren't correct, e.g. see here #791.
Could there always be a warning if the execution didn't work? (I.e. just a script level failure, not at API level failure.)
The text was updated successfully, but these errors were encountered: