mirror of
https://github.com/dolthub/dolt.git
synced 2026-02-09 18:59:12 -06:00
Remove flags section from noms help. #1791
This commit is contained in:
@@ -21,9 +21,12 @@ const (
|
||||
|
||||
func usage() {
|
||||
fmt.Fprintf(os.Stderr, "usage: %s command [command-args]\n\n", path.Base(os.Args[0]))
|
||||
fmt.Fprintf(os.Stderr, "Flags:\n\n")
|
||||
flag.PrintDefaults()
|
||||
fmt.Fprintf(os.Stderr, "\nCommands:\n\n")
|
||||
if hasDefinedFlags(flag.CommandLine) {
|
||||
fmt.Fprintf(os.Stderr, "Flags:\n\n")
|
||||
flag.PrintDefaults()
|
||||
fmt.Fprintf(os.Stderr, "\n")
|
||||
}
|
||||
fmt.Fprintf(os.Stderr, "Commands:\n\n")
|
||||
fmt.Fprintf(os.Stderr, " %s\n", strings.Join(listCmds(), "\n "))
|
||||
fmt.Fprintf(os.Stderr, "\nSee noms <command> -h for information on each available command.\n\n")
|
||||
}
|
||||
@@ -47,6 +50,13 @@ func main() {
|
||||
executeCmd(cmd)
|
||||
}
|
||||
|
||||
func hasDefinedFlags(fs *flag.FlagSet) (hasFlags bool) {
|
||||
fs.VisitAll(func(*flag.Flag) {
|
||||
hasFlags = true
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func findCmd(name string) (cmd string) {
|
||||
nomsName := cmdPrefix + name
|
||||
forEachDir(func(dir *os.File) (stop bool) {
|
||||
|
||||
Reference in New Issue
Block a user