Revision 5bbd3f7f lib/cli.py
b/lib/cli.py | ||
---|---|---|
320 | 320 |
def _ParseArgs(argv, commands, aliases): |
321 | 321 |
"""Parser for the command line arguments. |
322 | 322 |
|
323 |
This function parses the arguements and returns the function which
|
|
323 |
This function parses the arguments and returns the function which |
|
324 | 324 |
must be executed together with its (modified) arguments. |
325 | 325 |
|
326 | 326 |
@param argv: the command line |
... | ... | |
438 | 438 |
choices = [('y', True, 'Perform the operation'), |
439 | 439 |
('n', False, 'Do not perform the operation')] |
440 | 440 |
if not choices or not isinstance(choices, list): |
441 |
raise errors.ProgrammerError("Invalid choiches argument to AskUser")
|
|
441 |
raise errors.ProgrammerError("Invalid choices argument to AskUser") |
|
442 | 442 |
for entry in choices: |
443 | 443 |
if not isinstance(entry, tuple) or len(entry) < 3 or entry[0] == '?': |
444 |
raise errors.ProgrammerError("Invalid choiches element to AskUser")
|
|
444 |
raise errors.ProgrammerError("Invalid choices element to AskUser") |
|
445 | 445 |
|
446 | 446 |
answer = choices[-1][1] |
447 | 447 |
new_text = [] |
... | ... | |
747 | 747 |
except (errors.GenericError, luxi.ProtocolError, |
748 | 748 |
JobSubmittedException), err: |
749 | 749 |
result, err_msg = FormatError(err) |
750 |
logging.exception("Error durring command processing")
|
|
750 |
logging.exception("Error during command processing") |
|
751 | 751 |
ToStderr(err_msg) |
752 | 752 |
|
753 | 753 |
return result |
Also available in: Unified diff