From 2c6bc9e5c0c07518f54d03a04a29c70bbfb922e9 Mon Sep 17 00:00:00 2001 From: Ondřej Nosek Date: Apr 29 2026 03:47:57 +0000 Subject: Remove deprecated 'clean --dry-run' argument Remove --dry-run/-n from clean subcommand. Deprecated since 1.65, warned users to use global flag (*pkg --dry-run clean). Global --dry-run on main parser still works correctly. Resolves: rhbz#2458827 Assisted-by: Claude Sonnet 4.5 Signed-off-by: Ondřej Nosek --- diff --git a/pyrpkg/cli.py b/pyrpkg/cli.py index a6f7f0c..a1280bd 100644 --- a/pyrpkg/cli.py +++ b/pyrpkg/cli.py @@ -616,8 +616,6 @@ class cliClient(object): "rules. Patterns listed in .git/info/exclude won't" "be removed either.") clean_parser.add_argument( - '--dry-run', '-n', dest='dry_run_local', action='store_true', help='Perform a dry-run') - clean_parser.add_argument( '-x', action='store_true', help='Do not follow .gitignore and .git/info/exclude rules') clean_parser.set_defaults(command=self.clean) @@ -2220,12 +2218,7 @@ class cliClient(object): def clean(self): dry = False useignore = True - if self.args.dry_run_local: - self.log.warning("Warning: property '--dry-run' is deprecated. " - "Please, use a direct call of '--dry-run' like: " - "'*pkg --dry-run clean'.") - dry = True - elif self.args.dry_run: + if self.args.dry_run: dry = True if self.args.x: useignore = False diff --git a/tests/test_cli.py b/tests/test_cli.py index efe50f1..2f3beef 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -1195,7 +1195,7 @@ class TestClean(CliTestCase): def test_dry_run(self): self.make_changes(untracked=True) - cli_cmd = ['rpkg', '--path', self.cloned_repo_path, 'clean', '--dry-run'] + cli_cmd = ['rpkg', '--path', self.cloned_repo_path, '--dry-run', 'clean'] with patch('sys.argv', new=cli_cmd): cli = self.new_cli()