Closed
Bug 817729
Opened 13 years ago
Closed 13 years ago
dmcli: values min_args and max_args a little confusing
Categories
(Testing :: Mozbase, defect)
Testing
Mozbase
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: mcote, Unassigned)
Details
Attachments
(1 file)
|
2.66 KB,
patch
|
wlach
:
review+
|
Details | Diff | Splinter Review |
DMCli.commands uses integers to specify min_args and max_args most of the time, but sometimes it uses None instead of 0. I think it would be clearer to always use 0; as it stands, it seems to imply that None does something different from 0. Also if we always use integers, we can simplify the if statement on lines 140-141 to remove the boolean check and just compare arg lengths.
| Assignee | ||
Comment 1•13 years ago
|
||
Correction: None *does* have a special meaning for max_args: no limit to the number of arguments. It still doesn't seem to make sense for min_args, though, so I propose changing all None values to 0 for min_args and putting a comment about the special meaning of None for max_args.
| Assignee | ||
Comment 2•13 years ago
|
||
Actually it looks like argument-length enforcement was broken if max_args was 0, since the if statement didn't actually look for None specifically, just any falsey value.
Assignee: nobody → mcote
Status: NEW → ASSIGNED
| Assignee | ||
Comment 3•13 years ago
|
||
Attachment #687948 -
Flags: review?(wlachance)
Comment 4•13 years ago
|
||
Comment on attachment 687948 [details] [diff] [review]
Fix and clarify argument-length check
lgtm
Attachment #687948 -
Flags: review?(wlachance) → review+
| Assignee | ||
Comment 5•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•