csirac2 / snazzer

btrfs snapshotting and backup system offering snapshot measurement, transport and pruning.
BSD 2-Clause "Simplified" License
89 stars 9 forks source link

--help needs root permissions #24

Open rumpelsepp opened 8 years ago

rumpelsepp commented 8 years ago
$ ./snazzer --help
[sudo] password for stefan:

--help should not ask for root permissions.

jamiereid commented 7 years ago

The offending line appears to be if ! $SUDO test -e "$SNAZZER_SUBVOLS_EXCLUDE_FILE"; then $SUDO is set to sudo if snazzer is not being run as root.

I believe the sudo is there because $SNAZZER_SUBVOLS_EXCLUDE_FILE defaults to /etc/snazzer/exclude.patterns

Is there a better solution than moving the case check for --help to be above these lines?