-
Notifications
You must be signed in to change notification settings - Fork 0
/
help.go
48 lines (35 loc) · 926 Bytes
/
help.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package commands
import (
"fmt"
"sort"
"github.com/macinnir/dvc/core/lib"
"go.uber.org/zap"
)
const HelpCommandName = "help"
func PrintHelp(log *zap.Logger, config *lib.Config, args []string) error {
commandList := []string{}
for commandName := range commands {
commandList = append(commandList, commandName)
}
sort.Strings(commandList)
fmt.Println("Commands:")
fmt.Println("----------------------------")
for k := range commandList {
fmt.Println("\t" + commandList[k])
}
fmt.Println("----------------------------")
return nil
}
// PrintHelp prints help information
// func (c *Cmd) PrintHelp(args []string) {
// help := `usage: dvc [OPTIONS] [COMMAND] [ARGS]
// OPTIONS:
// -h, --help Show help
// -v, --verbose Show verbose logging
// -vv, --debug Show very verbose (debug) logging
// -s, --silent Disable all output
// COMMANDS:
// help This output
// `
// fmt.Printf(help)
// }