Commit 252844f
pwclient: rework multi-command help text
Our --help handling is convoluted and confusing, since we're hacking
around using some of argparse's built-in features (like generating
--help arguments for us). It seems like we were hacking around the
conflict between -h used for hashes and -h used for automatic help
flags. Fortunately, Python's argparse provides us with a
'conflict_handler' which will resolve these conflicts for us.
Altogether, this patch means that 'pwclient --help' will not generate a
full recursive print of all subcommand helps (arguably a good thing),
but it provides better automatic formatting of all the supported
subcommands and eliminates some awkward code.
Sample runs:
$ pwclient
usage: pwclient [-h]
{apply,git-am,get,info,projects,states,view,update,list,search}
...
optional arguments:
-h, --help show this help message and exit
Commands:
{apply,git-am,get,info,projects,states,view,update,list,search}
apply Apply a patch (in the current dir, using -p1)
git-am Apply a patch to current git branch using "git am".
get Download a patch and save it locally
info Display patchwork info about a given patch ID
projects List all projects
states Show list of potential patch states
view View a patch
update Update patch
list List patches, using the optional filters specified
below and an optional substring to search for patches
by name
search Alias for "list"
Use 'pwclient <command> --help' for more info
$ pwclient info --help
usage: pwclient info [--help] [-h HASH] [-p PROJECT] [ID [ID ...]]
positional arguments:
ID Patch ID
optional arguments:
--help show this help message and exit
-h HASH Lookup by patch hash
-p PROJECT Lookup patch in project
Signed-off-by: Brian Norris <[email protected]>
Acked-by: Mike Frysinger <[email protected]>
Reviewed-by: Stephen Finucane <[email protected]>1 parent a466ebb commit 252844f
1 file changed
+9
-58
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | 349 | | |
375 | 350 | | |
376 | 351 | | |
| |||
425 | 400 | | |
426 | 401 | | |
427 | 402 | | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | 403 | | |
434 | 404 | | |
435 | 405 | | |
436 | | - | |
437 | | - | |
438 | | - | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
| 406 | + | |
445 | 407 | | |
446 | 408 | | |
447 | 409 | | |
448 | 410 | | |
449 | | - | |
450 | 411 | | |
451 | 412 | | |
452 | | - | |
453 | | - | |
| 413 | + | |
454 | 414 | | |
455 | 415 | | |
456 | 416 | | |
457 | 417 | | |
458 | | - | |
459 | | - | |
| 418 | + | |
460 | 419 | | |
461 | 420 | | |
462 | 421 | | |
| |||
466 | 425 | | |
467 | 426 | | |
468 | 427 | | |
469 | | - | |
470 | | - | |
| 428 | + | |
471 | 429 | | |
472 | 430 | | |
473 | 431 | | |
474 | 432 | | |
475 | | - | |
476 | | - | |
| 433 | + | |
477 | 434 | | |
478 | 435 | | |
479 | 436 | | |
480 | 437 | | |
481 | 438 | | |
482 | | - | |
483 | 439 | | |
484 | 440 | | |
485 | 441 | | |
486 | 442 | | |
487 | 443 | | |
488 | | - | |
489 | 444 | | |
490 | 445 | | |
491 | 446 | | |
492 | 447 | | |
493 | | - | |
494 | | - | |
| 448 | + | |
495 | 449 | | |
496 | 450 | | |
497 | 451 | | |
498 | 452 | | |
499 | | - | |
500 | | - | |
| 453 | + | |
501 | 454 | | |
502 | 455 | | |
503 | 456 | | |
| |||
515 | 468 | | |
516 | 469 | | |
517 | 470 | | |
518 | | - | |
519 | 471 | | |
520 | | - | |
| 472 | + | |
521 | 473 | | |
522 | 474 | | |
523 | 475 | | |
524 | 476 | | |
525 | 477 | | |
526 | 478 | | |
527 | | - | |
528 | | - | |
| 479 | + | |
529 | 480 | | |
530 | 481 | | |
531 | 482 | | |
| |||
0 commit comments