Home | History | Annotate | Download | only in flag

Lines Matching refs:fs

341 	fs := NewFlagSet("help test", ContinueOnError)
342 fs.Usage = func() { helpCalled = true }
344 fs.BoolVar(&flag, "flag", false, "regular flag")
346 err := fs.Parse([]string{"-flag=true"})
358 err = fs.Parse([]string{"-help"})
370 fs.BoolVar(&help, "help", false, "help flag")
372 err = fs.Parse([]string{"-help"})
400 fs := NewFlagSet("print defaults test", ContinueOnError)
402 fs.SetOutput(&buf)
403 fs.Bool("A", false, "for bootstrapping, allow 'any' type")
404 fs.Bool("Alongflagname", false, "disable bounds checking")
405 fs.Bool("C", true, "a boolean defaulting to true")
406 fs.String("D", "", "set relative `path` for local imports")
407 fs.Float64("F", 2.7, "a non-zero `number`")
408 fs.Float64("G", 0, "a float that defaults to zero")
409 fs.Int("N", 27, "a non-zero int")
410 fs.Int("Z", 0, "an int that defaults to zero")
411 fs.Duration("maxT", 0, "set `timeout` for dial")
412 fs.PrintDefaults()