From d0d25ff5de1d81fc9210e1b2a4d0a25808df62a7 Mon Sep 17 00:00:00 2001 From: Daniel Mach Date: Mon, 15 Jan 2024 09:56:02 +0100 Subject: [PATCH] Change 'token --create' command to require '--operation' --- osc/commandline.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osc/commandline.py b/osc/commandline.py index f488794e..7ef47be4 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -1673,7 +1673,7 @@ class Osc(cmdln.Cmdln): usage: osc token - osc token --create [--operation ] [ ] + osc token --create --operation [ ] osc token --delete osc token --trigger [--operation ] [ ] """ @@ -1688,6 +1688,8 @@ class Osc(cmdln.Cmdln): url_path = ['person', conf.get_apiurl_usr(apiurl), 'token'] if opts.create: + if not opts.operation: + self.argparser.error("Please specify --operation") if opts.operation == 'workflow' and not opts.scm_token: msg = 'The --operation=workflow option requires a --scm-token= option' raise oscerr.WrongOptions(msg)