1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2025-03-16 00:00:05 +01:00

Allow --files-from to take a dash (-) for stdin #769

This commit is contained in:
Bart 2017-02-04 11:47:54 +01:00
parent 22f3e21266
commit 64917639ef

View file

@ -28,7 +28,12 @@ The "backup" command creates a new snapshot and saves the files and directories
given as the arguments.
`,
RunE: func(cmd *cobra.Command, args []string) error {
if backupOptions.Stdin {
stdinDeclaredTwice := backupOptions.Stdin && backupOptions.FilesFrom == "-"
if stdinDeclaredTwice {
return errors.Fatal("unable to use argument '-' and stdin flag together")
}
if backupOptions.Stdin || backupOptions.FilesFrom == "-" {
return readBackupFromStdin(backupOptions, globalOptions, args)
}