piknik

Unnamed repository; edit this file 'description' to name the repository.
Info | Log | Files | Refs | README | LICENSE

commit 629948912648ca72de53dd3bf726a1f6123d2aef
parent 10f5aca7a309207ca223c38473f9c33c2d1148df
Author: lash <dev@holbrook.no>
Date:   Thu, 20 Apr 2023 08:01:08 +0100

Add missing handling for top level --help

Diffstat:
MCHANGELOG | 2++
Mpiknik/runnable/cmd.py | 5+++--
Msetup.cfg | 2+-
3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG @@ -1,3 +1,5 @@ +- 0.3.7 + * Complete incomplete change from 0.3.6 - 0.3.6 * Enable --help display without subcommand - 0.3.5 diff --git a/piknik/runnable/cmd.py b/piknik/runnable/cmd.py @@ -26,7 +26,7 @@ argp.add_argument('-f', '--files', dest='f', action='store_true', help='Save att argp.add_argument('-o', '--files-dir', dest='files_dir', type=str, help='Directory to output saved files to') argp.add_argument('-v', action='store_true', help='Turn on debug logs') argp.add_argument('-i','--issue-id', type=str, help='Issue id to show') -argp.add_argument('cmd', type=str, choices=['show', 'add', 'mod', 'comment'], help='subcommand to execute') +argp.add_argument('cmd', type=str, nargs='?', choices=['show', 'add', 'mod', 'comment'], help='subcommand to execute') strargs = copy.copy(sys.argv[1:]) have_help = False @@ -55,8 +55,9 @@ else: if not have_help: raise ValueError('unknown subcommand') +if m != None: + argp = m.subparser(argp) -argp = m.subparser(argp) arg = argp.parse_args(sys.argv[1:]) if arg.v: logg.setLevel(logging.DEBUG) diff --git a/setup.cfg b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = piknik -version = 0.3.6 +version = 0.3.7 description = CLI issue tracker author = Louis Holbrook author_email = dev@holbrook.no