A FlagSet creates and parses command-line flags. It is similar to the standard flag.FlagSet.
| 54 | // A FlagSet creates and parses command-line flags. |
| 55 | // It is similar to the standard flag.FlagSet. |
| 56 | type FlagSet interface { |
| 57 | // Bool, Int, Float64, and String define new flags, |
| 58 | // like the functions of the same name in package flag. |
| 59 | Bool(name string, def bool, usage string) *bool |
| 60 | Int(name string, def int, usage string) *int |
| 61 | Float64(name string, def float64, usage string) *float64 |
| 62 | String(name string, def string, usage string) *string |
| 63 | |
| 64 | // StringList is similar to String but allows multiple values for a |
| 65 | // single flag |
| 66 | StringList(name string, def string, usage string) *[]*string |
| 67 | |
| 68 | // ExtraUsage returns any additional text that should be printed after the |
| 69 | // standard usage message. The extra usage message returned includes all text |
| 70 | // added with AddExtraUsage(). |
| 71 | // The typical use of ExtraUsage is to show any custom flags defined by the |
| 72 | // specific pprof plugins being used. |
| 73 | ExtraUsage() string |
| 74 | |
| 75 | // AddExtraUsage appends additional text to the end of the extra usage message. |
| 76 | AddExtraUsage(eu string) |
| 77 | |
| 78 | // Parse initializes the flags with their values for this run |
| 79 | // and returns the non-flag command line arguments. |
| 80 | // If an unknown flag is encountered or there are no arguments, |
| 81 | // Parse should call usage and return nil. |
| 82 | Parse(usage func()) []string |
| 83 | } |
| 84 | |
| 85 | // A Fetcher reads and returns the profile named by src. src can be a |
| 86 | // local file path or a URL. duration and timeout are units specified |