aboutsummaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorRuss Allbery <rra@stanford.edu>2008-02-12 23:38:36 +0000
committerRuss Allbery <rra@stanford.edu>2008-02-12 23:38:36 +0000
commit5dd1bb69f28e1a38259dd939cfd00469c5b786eb (patch)
tree63514dc4c4e5dabbfec357f743b54c535deeca43 /server
parent54ccb6083d69da03c71d01a271a09554e4d63e4f (diff)
wallet-backend now supports a -q flag, which disables syslog logging.
Diffstat (limited to 'server')
-rwxr-xr-xserver/wallet-backend26
1 files changed, 22 insertions, 4 deletions
diff --git a/server/wallet-backend b/server/wallet-backend
index 1a259d5..c002d89 100755
--- a/server/wallet-backend
+++ b/server/wallet-backend
@@ -13,11 +13,14 @@ our $ID = q$Id$;
##############################################################################
use strict;
+
+use Getopt::Long qw(GetOptions);
use Sys::Syslog qw(openlog syslog);
use Wallet::Server;
-# Set to zero to suppress syslog logging, which is used only for testing. Set
-# to a reference to a string to append messages to that string instead.
+# Set to zero to suppress syslog logging, which is used for testing and for
+# the -q option. Set to a reference to a string to append messages to that
+# string instead.
our $SYSLOG;
$SYSLOG = 1 unless defined $SYSLOG;
@@ -289,7 +292,15 @@ sub command {
}
success (@_);
}
+
+# Parse command-line options.
+my ($quiet);
+GetOptions ('q|quiet' => \$quiet) or exit 1;
+$SYSLOG = 0 if $quiet;
+
+# Run the command.
command (@ARGV);
+
__END__
##############################################################################
@@ -305,7 +316,7 @@ wallet-backend - Wallet server for storing and retrieving secure data
=head1 SYNOPSIS
-B<wallet-backend> I<command> [I<args> ...]
+B<wallet-backend> [B<-q>] I<command> [I<args> ...]
=head1 DESCRIPTION
@@ -326,7 +337,14 @@ over and above the checking already done by the rest of the wallet code.
=head1 OPTIONS
-B<wallet-backend> takes no traditional options.
+=over 4
+
+=item B<--quiet>, B<-q>
+
+If this option is given, B<wallet-backend> will not log its actions to
+syslog.
+
+=back
=head1 COMMANDS