Skip to content

Commit

Permalink
Be helpful in deprecating commands
Browse files Browse the repository at this point in the history
At least give *some* hint of what needs to be done rather than
just barking at the user. Also remove description of obsolete
commands.
  • Loading branch information
dirkmueller committed Aug 10, 2023
1 parent 57a4cdc commit f9fbfd8
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions osc/commandline.py
Original file line number Diff line number Diff line change
Expand Up @@ -7599,8 +7599,6 @@ def do_service(self, subcmd, opts, *args):
osc service run [SOURCE_SERVICE]
osc service runall
osc service manualrun [SOURCE_SERVICE]
osc service localrun [SOURCE_SERVICE]
osc service disabledrun [SOURCE_SERVICE]
osc service remoterun [PROJECT PACKAGE]
osc service merge [PROJECT PACKAGE]
osc service wait [PROJECT PACKAGE]
Expand Down Expand Up @@ -7629,7 +7627,6 @@ def do_service(self, subcmd, opts, *args):
singleservice = None
mode = None
remote_commands = ("remoterun", "rr", "merge", "wait")
obsolete_commands = ("localrun", "lr", "disabledrun", "dr")

if len(args) < 1:
self.argparse_error("Please specify a command")
Expand All @@ -7638,8 +7635,12 @@ def do_service(self, subcmd, opts, *args):
if command not in ("runall", "ra", "run", "localrun", "manualrun", "disabledrun", "remoterun", "lr", "dr", "mr", "rr", "merge", "wait"):
self.argparse_error(f"Invalid command: {command}")

if command in obsolete_commands:
print(f"WARNING: Command '{command}' is obsolete", file=sys.stderr)
if command in ("localrun", "lr"):
print(f"WARNING: Command '{command}' is obsolete, please use 'run' instead.", file=sys.stderr)

if command in ("disabledrun", "dr"):
print(f"WARNING: Command '{command}' is obsolete,\n"
"please convert your _service to use 'manual' and then 'manualrun/mr' instead.", file=sys.stderr)

if len(args) == 1:
singleservice = args.pop(0)
Expand Down

0 comments on commit f9fbfd8

Please sign in to comment.