xmlutils.py icon indicating copy to clipboard operation
xmlutils.py copied to clipboard

Incorrect handling of --limit 0

Open john-aws opened this issue 7 years ago • 0 comments

It would be helpful to support --limit 0. This would allow the user to request zero records output, and consequently the user could use this option to get the column headers, and only the column headers.

Currently --limit 0 behaves identically to --limit -1 (the default) which outputs all records. This behavior (outputting all records when limit is zero) is actually a by-product of another minor bug, which is the following test:

if n == limit:
    break

This test happens after n has been incremented and consequently will never break when limit is zero.

john-aws avatar Feb 08 '18 23:02 john-aws