Skip to content

Commit ea831f3

Browse files
committed
♻️ Synced dbin 📦 <-- dbin: fix --silent ⌚
1 parent 6c75dc8 commit ea831f3

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

main.go

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ const (
1919
maxCacheSize = 15
2020
binariesToDelete = 5
2121
// --------------------------------
22-
extraVerbose int8 = 2
23-
normalVerbosity int8 = 1
24-
silentVerbosityWithErrors int8 = -1
25-
extraSilent int8 = -2
22+
extraVerbose uint8 = 4
23+
normalVerbosity uint8 = 3
24+
silentVerbosityWithErrors uint8 = 2
25+
extraSilent uint8 = 1
2626
// -------------------------------
2727
)
2828

@@ -48,6 +48,17 @@ func main() {
4848
Usage: "Run in extra silent mode, suppressing almost all output",
4949
},
5050
},
51+
Before: func(ctx context.Context, c *cli.Command) (context.Context, error) {
52+
switch {
53+
case c.Bool("extra-silent"):
54+
verbosityLevel = extraSilent
55+
case c.Bool("silent"):
56+
verbosityLevel = silentVerbosityWithErrors
57+
case c.Bool("verbose"):
58+
verbosityLevel = extraVerbose
59+
}
60+
return nil, nil
61+
},
5162
Commands: []*cli.Command{
5263
installCommand(),
5364
removeCommand(),

0 commit comments

Comments
 (0)