mirror of
https://github.com/restic/restic.git
synced 2026-06-24 01:24:19 +00:00
Fail fast for invalid RESTIC_PACK_SIZE env values (#5592)
Co-authored-by: Michael Eischer <michael.eischer@fau.de>
This commit is contained in:
+5
-1
@@ -49,6 +49,10 @@ The full documentation can be found at https://restic.readthedocs.io/ .
|
||||
DisableAutoGenTag: true,
|
||||
|
||||
PersistentPreRunE: func(c *cobra.Command, _ []string) error {
|
||||
switch c.Name() {
|
||||
case "__complete", "__completeNoDesc":
|
||||
return nil
|
||||
}
|
||||
return globalOptions.PreRun(needsPassword(c.Name()))
|
||||
},
|
||||
}
|
||||
@@ -114,7 +118,7 @@ The full documentation can be found at https://restic.readthedocs.io/ .
|
||||
// user for authentication).
|
||||
func needsPassword(cmd string) bool {
|
||||
switch cmd {
|
||||
case "cache", "generate", "help", "options", "self-update", "version", "__complete":
|
||||
case "cache", "generate", "help", "options", "self-update", "version", "__complete", "__completeNoDesc":
|
||||
return false
|
||||
default:
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user