Use cmd.Cmd for interactive mode. This gives some benefits over doing things manually:
Tab completion and history of commands
help command for free
Code gets a bit nicer
Allows to easily add command arguments. This is already done for show_job which now expects the ID as argument instead of separately prompting for it (as a bonus, there is even tab completion for the argument :) ).
While working on this, also make the output a bit nicer:
Remove superfluous prints (no need to say this is the "list of successfull jobs" if just one line above I entered the command list_successful_jobs).
Use Cmd.columnize for lists of job IDs. Results in much nicer, more readable output.
Note that calling show_job without argument now results in an error (expects ID as argument). I don't consider this as breaking change w.r.t. versioning, though, as it only affects the interactive command, i.e. no existing script/config or the like should break due to this change.
Description
Use
cmd.Cmd
for interactive mode. This gives some benefits over doing things manually:help
command for freeshow_job
which now expects the ID as argument instead of separately prompting for it (as a bonus, there is even tab completion for the argument :) ).While working on this, also make the output a bit nicer:
list_successful_jobs
).Cmd.columnize
for lists of job IDs. Results in much nicer, more readable output.Note that calling
show_job
without argument now results in an error (expects ID as argument). I don't consider this as breaking change w.r.t. versioning, though, as it only affects the interactive command, i.e. no existing script/config or the like should break due to this change.Resolves #47. Resolves #135.
Do not merge before