diff options
-rw-r--r-- | NEWS | 5 | ||||
-rwxr-xr-x | server/wallet-backend | 1 | ||||
-rw-r--r-- | tests/client/full-t.in | 13 |
3 files changed, 18 insertions, 1 deletions
@@ -1,5 +1,10 @@ User-Visible wallet Changes +wallet 0.10 (unreleased) + + Correctly handle storing of data that begins with a dash and don't + parse it as an argument to wallet-backend. + wallet 0.9 (2008-04-24) The wallet command-line client now reads the data for store from a diff --git a/server/wallet-backend b/server/wallet-backend index c002d89..ff63ba8 100755 --- a/server/wallet-backend +++ b/server/wallet-backend @@ -295,6 +295,7 @@ sub command { # Parse command-line options. my ($quiet); +Getopt::Long::config ('require_order'); GetOptions ('q|quiet' => \$quiet) or exit 1; $SYSLOG = 0 if $quiet; diff --git a/tests/client/full-t.in b/tests/client/full-t.in index 83c0ce9..f4ef1d3 100644 --- a/tests/client/full-t.in +++ b/tests/client/full-t.in @@ -12,7 +12,7 @@ # is loaded, and it's pulled in as a prerequisite for Wallet::Admin. BEGIN { $ENV{WALLET_CONFIG} = '@abs_top_srcdir@/tests/data/wallet.conf' } -BEGIN { our $total = 47 } +BEGIN { our $total = 53 } use Test::More tests => $total; use lib '@abs_top_srcdir@/perl'; @@ -155,6 +155,17 @@ SKIP: { is ($out, "baz\nboo\n", ' with the right output'); is ($err, '', ' and no error'); + # Store data beginning with a dash. + ($out, $err, $status) = wallet ($principal, 'store', 'file', 'auto', '--', + '-q'); + is ($status, 0, 'Storing data that looks like an option succeeds'); + is ($out, '', ' with no output'); + is ($err, '', ' and no error'); + ($out, $err, $status) = wallet ($principal, 'get', 'file', 'auto'); + is ($status, 0, 'Object get succeeds'); + is ($out, '-q', ' with the right output'); + is ($err, '', ' and no error'); + # All done. remctld_stop; $admin->destroy; |