Skip to content

Commit 9b2202c

Browse files
committed
cli: show usage on no subcommand, update usage
1 parent c8176d3 commit 9b2202c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Commands:
3333
Options:
3434
--strict [true] enable strict mode and enforce all built-in rules
3535
--debug [false] enable debug mode and output debug messages
36+
--ignore comma-separated list of filepaths to ignore
3637
```
3738

3839
## Overview

cmd/protolock/main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,20 @@ Commands:
2626
Options:
2727
--strict [true] enable strict mode and enforce all built-in rules
2828
--debug [false] enable debug mode and output debug messages
29+
--ignore comma-separated list of filepaths to ignore
2930
`
3031

3132
var (
3233
options = flag.NewFlagSet("options", flag.ExitOnError)
3334
debug = options.Bool("debug", false, "toggle debug mode for verbose output")
3435
strict = options.Bool("strict", true, "toggle strict mode, to determine which rules are enforced")
35-
ignore = options.String("ignore", "", "comma-separated list of directories to ignore.")
36+
ignore = options.String("ignore", "", "comma-separated list of filepaths to ignore")
3637
)
3738

3839
func main() {
3940
// exit if no command (i.e. help, -h, --help, init, status, or commit)
4041
if len(os.Args) < 2 {
42+
fmt.Println(usage)
4143
os.Exit(0)
4244
}
4345

0 commit comments

Comments
 (0)