Merge lp:~achiang/hydrazine/hydrazine-show-valid-named-enums into lp:hydrazine
Status: | Merged |
---|---|
Merged at revision: | 99 |
Proposed branch: | lp:~achiang/hydrazine/hydrazine-show-valid-named-enums |
Merge into: | lp:hydrazine |
Diff against target: |
56 lines (+9/-9) 1 file modified
bugclient (+9/-9) |
To merge this branch: | bzr merge lp:~achiang/hydrazine/hydrazine-show-valid-named-enums |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Martin Pool | Approve | ||
Review via email: mp+79189@code.launchpad.net |
Description of the change
bugclient: add input validation for 'filter' command, other NamedEnums
Give the NamedEnum() class a new method, 'show_valid()'.
This gives us a standard way to handle error checking if the user
enters an invalid enum.
Harden the 'filter' command so it doesn't puke when you just type it
without any arguments, such as the stack trace below:
Traceback (most recent call last):
File "./bugclient", line 541, in <module>
File "./bugclient", line 537, in main
File "/usr/lib/
stop = self.onecmd(line)
File "./bugclient", line 399, in onecmd
return cmd.Cmd.
File "/usr/lib/
return func(arg)
File "./bugclient", line 175, in do_filter
if not (args[0]):
IndexError: list index out of range
vote approve
review approve