func init() { flag.Usage = func() { fmt.Fprintf(os.Stderr, `Usage: indexpack --to_archive <root> [kindex-paths...] indexpack --from_archive <root> [dir] indexpack --view_archive <root> [unit-digests...] %s Flags: `, build.VersionLine()) flag.PrintDefaults() os.Exit(1) } }
func init() { flag.Usage = func() { fmt.Fprintf(os.Stderr, `Usage: indexpack --to_archive <root> [kindex-paths...] indexpack --from_archive <root> [dir] indexpack --view_archive <root> [unit-digests...] %s Flags: `, build.VersionLine()) flag.PrintDefaults() os.Exit(1) } oauth2Config.Scopes = []string{storage.ScopeFullControl} }
func globalUsage() { fmt.Fprintf(os.Stderr, `Usage: %s <global-flags> <command> <flags> %s Examples: %[1]s ls --uris kythe://kythe?path=kythe/cxx/common %[1]s node kythe:?lang=java#java.util.List `, filepath.Base(os.Args[0]), build.VersionLine()) if !shortHelp { fmt.Fprintln(os.Stderr, "\nGlobal Flags:") flag.PrintDefaults() } fmt.Fprintln(os.Stderr, "\nCommands:") var cmdNames []string for name := range cmds { cmdNames = append(cmdNames, name) } sort.Strings(cmdNames) for _, name := range cmdNames { cmds[name].Usage() fmt.Fprintln(os.Stderr) } }