Skip to content

Commit 83b28ee

Browse files
committed
github-release: add --quiet flag
1 parent cb35deb commit 83b28ee

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

github-release.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515
type Options struct {
1616
Help goptions.Help `goptions:"-h, --help, description='Show this help'"`
1717
Verbosity []bool `goptions:"-v, --verbose, description='Be verbose'"`
18+
Quiet bool `goptions:"-q, --quiet, description='Do not print anything, even errors (except if --verbose is specified)'"`
1819

1920
goptions.Verbs
2021
Upload struct {
@@ -82,7 +83,9 @@ func main() {
8283
if cmd, found := commands[options.Verbs]; found {
8384
err := cmd(options)
8485
if err != nil {
85-
fmt.Println("error:", err)
86+
if !options.Quiet {
87+
fmt.Println("error:", err)
88+
}
8689
os.Exit(1)
8790
}
8891
}

0 commit comments

Comments
 (0)