mirror of
https://github.com/ovh/the-bastion.git
synced 2025-09-13 16:34:27 +08:00
enh: osh-encrypt-rsync: catch warnings emitted by GetOptions
This commit is contained in:
parent
c38c9c09f2
commit
bd13e5a476
1 changed files with 20 additions and 16 deletions
|
@ -549,23 +549,27 @@ EOF
|
||||||
sub main {
|
sub main {
|
||||||
_log "Starting...";
|
_log "Starting...";
|
||||||
|
|
||||||
if (
|
|
||||||
!GetOptions(
|
|
||||||
"dry-run" => \$dryRun,
|
|
||||||
"config-test" => \$configTest,
|
|
||||||
"no-delete" => \$noDelete,
|
|
||||||
"encrypt-only" => \$encryptOnly,
|
|
||||||
"rsync-only" => \$rsyncOnly,
|
|
||||||
"force-delete" => \$forceDelete,
|
|
||||||
"force-encrypt" => \$forceEncrypt,
|
|
||||||
"verbose+" => \$verbose,
|
|
||||||
"help" => \$help,
|
|
||||||
)
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
_err "Error while parsing command-line options";
|
my $optwarn = 'Unknown error';
|
||||||
print_usage();
|
local $SIG{'__WARN__'} = sub { $optwarn = shift; };
|
||||||
return 1;
|
if (
|
||||||
|
!GetOptions(
|
||||||
|
"dry-run" => \$dryRun,
|
||||||
|
"config-test" => \$configTest,
|
||||||
|
"no-delete" => \$noDelete,
|
||||||
|
"encrypt-only" => \$encryptOnly,
|
||||||
|
"rsync-only" => \$rsyncOnly,
|
||||||
|
"force-delete" => \$forceDelete,
|
||||||
|
"force-encrypt" => \$forceEncrypt,
|
||||||
|
"verbose+" => \$verbose,
|
||||||
|
"help" => \$help,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
{
|
||||||
|
_err "Error while parsing command-line options: $optwarn";
|
||||||
|
print_usage();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($help) {
|
if ($help) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue