From 06338abe79f1fbef61f7297530ebf11139654d6c Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 22 May 2025 14:14:45 -0400 Subject: subcmds: delete redundant dest= settings Add a test to enforce this too. Change-Id: I80b5cf567aa33db9c24b53428c66d69f9c1d8d74 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/478481 Commit-Queue: Mike Frysinger Tested-by: Mike Frysinger Reviewed-by: Scott Lee --- subcmds/forall.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'subcmds/forall.py') diff --git a/subcmds/forall.py b/subcmds/forall.py index 9da0c96e..4bae46af 100644 --- a/subcmds/forall.py +++ b/subcmds/forall.py @@ -133,7 +133,7 @@ without iterating through the remaining projects. @staticmethod def _cmd_option(option, _opt_str, _value, parser): - setattr(parser.values, option.dest, list(parser.rargs)) + setattr(parser.values, option.dest or "command", list(parser.rargs)) while parser.rargs: del parser.rargs[0] @@ -141,7 +141,6 @@ without iterating through the remaining projects. p.add_option( "-r", "--regex", - dest="regex", action="store_true", help="execute the command only on projects matching regex or " "wildcard expression", @@ -149,7 +148,6 @@ without iterating through the remaining projects. p.add_option( "-i", "--inverse-regex", - dest="inverse_regex", action="store_true", help="execute the command only on projects not matching regex or " "wildcard expression", @@ -157,7 +155,6 @@ without iterating through the remaining projects. p.add_option( "-g", "--groups", - dest="groups", help="execute the command only on projects matching the specified " "groups", ) @@ -165,14 +162,12 @@ without iterating through the remaining projects. "-c", "--command", help="command (and arguments) to execute", - dest="command", action="callback", callback=self._cmd_option, ) p.add_option( "-e", "--abort-on-errors", - dest="abort_on_errors", action="store_true", help="abort if a command exits unsuccessfully", ) -- cgit v1.2.3-54-g00ecf