Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | clean up use of command package |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
0668aba3141d6146fce9644f1d7a7320 |
User & Date: | dnc 2019-06-08 21:12:12 |
Context
2019-06-08
| ||
21:12 | manifest now supports human-readable messages check-in: 657eb8d965 user: dnc tags: trunk | |
21:12 | clean up use of command package check-in: 0668aba314 user: dnc tags: trunk | |
2019-06-07
| ||
13:32 | cmd/hancock: show publish count per directory check-in: b975cd947c user: dnc tags: trunk | |
Changes
Changes to cmd/hancock/hancock.go.
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
..
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
//go:generate sh -c "go doc | dumbdown > README.md" import ( "flag" "fmt" "log" "os" "github.com/pkg/errors" "src.d10.dev/command" "src.d10.dev/command/config" ) func main() { ................................................................................ _, err := command.Config() if errors.Cause(err) == config.ConfigNotFound { // not a problem, we'll use defaults // TODO(dnc): if -config specified explicitly on command line, make this a fatal error command.Info(err) err = nil } else if err != nil { fmt.Println(err) flag.CommandLine.Usage() os.Exit(1) } // this command requires an operation if len(flag.CommandLine.Args()) < 1 { flag.CommandLine.Usage() os.Exit(1) } // default prefix for subcommand log.SetPrefix(fmt.Sprintf("hancock %s: ", flag.CommandLine.Args()[0])) if command.CurrentOperation() != nil { err = command.CurrentOperation().Handler() } if err != nil { command.UsageError(err) command.Usage() } command.Exit() } |
<
<
<
<
<
>
|
<
<
|
<
<
<
<
|
|
|
76
77
78
79
80
81
82
83
84
85
86
87
88
89
..
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
//go:generate sh -c "go doc | dumbdown > README.md" import ( "flag" "fmt" "log" "github.com/pkg/errors" "src.d10.dev/command" "src.d10.dev/command/config" ) func main() { ................................................................................ _, err := command.Config() if errors.Cause(err) == config.ConfigNotFound { // not a problem, we'll use defaults // TODO(dnc): if -config specified explicitly on command line, make this a fatal error command.Info(err) err = nil } command.CheckUsage(err) // this command requires an operation if len(flag.CommandLine.Args()) < 1 { command.CheckUsage(errors.New("command requires an operation")) } // default prefix for subcommand log.SetPrefix(fmt.Sprintf("hancock %s: ", flag.CommandLine.Args()[0])) err = command.CurrentOperation().Operate() command.CheckUsage(err) command.Exit() } |