summaryrefslogtreecommitdiff
path: root/swiftclient/shell.py
diff options
context:
space:
mode:
authorJiří Suchomel <jsuchome@suse.cz>2014-10-23 10:48:33 +0200
committerAlistair Coles <alistair.coles@hp.com>2015-01-05 11:02:00 +0000
commit5d5701870702a554dcea61213999670ee15f4ea8 (patch)
tree87f477e3163702fd4ef0bf8d1addf24d05063bf6 /swiftclient/shell.py
parent2dde767e93f15dd7fb0fbb59fcbd416e384cf2a4 (diff)
downloadpython-swiftclient-5d5701870702a554dcea61213999670ee15f4ea8.tar.gz
Print info message about incorrect --totals usage
when neither -l nor --lh is provided. Added test coverage for --totals. Change-Id: I3245e715c26ec28457a21dec07311a58c475c066 Closes-Bug: 1258392
Diffstat (limited to 'swiftclient/shell.py')
-rwxr-xr-xswiftclient/shell.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/swiftclient/shell.py b/swiftclient/shell.py
index d58de60..c3f4628 100755
--- a/swiftclient/shell.py
+++ b/swiftclient/shell.py
@@ -378,6 +378,11 @@ def st_list(parser, args, output_manager):
_opts.pop('human')
_opts['long'] = True
+ if options.totals and not options.long and not options.human:
+ output_manager.error(
+ "Listing totals only works with -l or --lh.")
+ return
+
with SwiftService(options=_opts) as swift:
try:
if not args: