Description
Current behaviour:
qpid -qIS queue // Shows up to 50 queues. qpid -qIS queue -L 0 // Shows as many queues as possible (ie no limit). qpid -qIS queue -L 1 // Shows as many queues as possible (ie no limit). qpid -qIS queue -L 10 // Shows as many queues as possible (ie no limit). qpid -qIS queue -L 100 // Shows as many queues as possible (ie no limit). qpid -qIS queue -L blah // Shows as many queues as possible (ie no limit).
This happens because:
- the default limit is 50, and
- the limit argument is read as a string, but compared to an int in the Sorter constructor - a comparison that always fails.
Behaviour after the near-trivial attached patch:
qpid -qIS queue // Shows up to 50 queues. qpid -qIS queue -L 0 // Shows as many queues as possible (ie no limit). qpid -qIS queue -L 1 // Shows up to 1 queue. qpid -qIS queue -L 10 // Shows up to 10 queues. qpid -qIS queue -L 100 // Shows up to 100 queues. qpid -qIS queue -L blah // qpid-stat: error: option -L: invalid integer value: 'foo'
I'll attach the patch, but's for the impatient
Index: qpid-stat =================================================================== --- qpid-stat (revision 1229483) +++ qpid-stat (working copy) @@ -70,7 +70,7 @@ help="Sort by column name") group2.add_option("-I", "--increasing", action="store_true", default=False, help="Sort by increasing value (default = decreasing)") - group2.add_option("-L", "--limit", default=50, metavar="<n>", + group2.add_option("-L", "--limit", type="int", default=50, metavar="<n>", help="Limit output to n rows") group2.add_option("-C", "--cluster", action="store_true", default=False, help="Display per-broker cluster detail.")