Skip to content

Commit

Permalink
Merge pull request #1380 from dirkmueller/helpful_deprecation
Browse files Browse the repository at this point in the history
Be helpful in deprecating commands
  • Loading branch information
dmach authored Aug 16, 2023
2 parents bf4b847 + f9fbfd8 commit fa8da38
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 fa8da38

Please sign in to comment.