Skip to content

Commit 01eb483

Browse files
committed
borgbackup: require -u for -p, exit with error if -p without -u
1 parent 712eba7 commit 01eb483

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

snmp/borgbackup

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -379,13 +379,12 @@ my $to_return = {
379379
errorString => '',
380380
};
381381

382-
if ( !$update && !$pretty ) {
383-
my $cache_extra = '';
384-
if ($compress) {
385-
$cache_extra = '.snmp';
382+
if ( !$update ) {
383+
if ( $pretty ) {
384+
die "Cannot pretty print without -u (update mode)\n";
386385
}
387-
if ( -f $output_dir . '/extend_return' . $cache_extra ) {
388-
my $old = read_file( $output_dir . '/extend_return' . $cache_extra );
386+
if ( -f $output_dir . '/extend_return' ) {
387+
my $old = read_file( $output_dir . '/extend_return' );
389388
print $old;
390389
exit 0;
391390
} else {

0 commit comments

Comments
 (0)