Skip to content

Commit 06338ab

Browse files
vapierLUCI
authored andcommitted
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 <[email protected]> Tested-by: Mike Frysinger <[email protected]> Reviewed-by: Scott Lee <[email protected]>
1 parent 8d37f61 commit 06338ab

File tree

18 files changed

+45
-52
lines changed

18 files changed

+45
-52
lines changed

subcmds/abandon.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ class Abandon(Command):
4848
def _Options(self, p):
4949
p.add_option(
5050
"--all",
51-
dest="all",
5251
action="store_true",
5352
help="delete all branches in all projects",
5453
)

subcmds/diff.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ def _Options(self, p):
3535
p.add_option(
3636
"-u",
3737
"--absolute",
38-
dest="absolute",
3938
action="store_true",
4039
help="paths are relative to the repository root",
4140
)

subcmds/diffmanifests.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ class Diffmanifests(PagedCommand):
6767

6868
def _Options(self, p):
6969
p.add_option(
70-
"--raw", dest="raw", action="store_true", help="display raw diff"
70+
"--raw",
71+
action="store_true",
72+
help="display raw diff",
7173
)
7274
p.add_option(
7375
"--no-color",
@@ -78,7 +80,6 @@ def _Options(self, p):
7880
)
7981
p.add_option(
8082
"--pretty-format",
81-
dest="pretty_format",
8283
action="store",
8384
metavar="<FORMAT>",
8485
help="print the log using a custom git pretty format string",

subcmds/download.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ def _Options(self, p):
6060
p.add_option(
6161
"-r",
6262
"--revert",
63-
dest="revert",
6463
action="store_true",
6564
help="revert instead of checkout",
6665
)

subcmds/forall.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,46 +133,41 @@ class Forall(Command, MirrorSafeCommand):
133133

134134
@staticmethod
135135
def _cmd_option(option, _opt_str, _value, parser):
136-
setattr(parser.values, option.dest, list(parser.rargs))
136+
setattr(parser.values, option.dest or "command", list(parser.rargs))
137137
while parser.rargs:
138138
del parser.rargs[0]
139139

140140
def _Options(self, p):
141141
p.add_option(
142142
"-r",
143143
"--regex",
144-
dest="regex",
145144
action="store_true",
146145
help="execute the command only on projects matching regex or "
147146
"wildcard expression",
148147
)
149148
p.add_option(
150149
"-i",
151150
"--inverse-regex",
152-
dest="inverse_regex",
153151
action="store_true",
154152
help="execute the command only on projects not matching regex or "
155153
"wildcard expression",
156154
)
157155
p.add_option(
158156
"-g",
159157
"--groups",
160-
dest="groups",
161158
help="execute the command only on projects matching the specified "
162159
"groups",
163160
)
164161
p.add_option(
165162
"-c",
166163
"--command",
167164
help="command (and arguments) to execute",
168-
dest="command",
169165
action="callback",
170166
callback=self._cmd_option,
171167
)
172168
p.add_option(
173169
"-e",
174170
"--abort-on-errors",
175-
dest="abort_on_errors",
176171
action="store_true",
177172
help="abort if a command exits unsuccessfully",
178173
)

subcmds/grep.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ def _Options(self, p):
120120
g.add_option(
121121
"-r",
122122
"--revision",
123-
dest="revision",
124123
action="append",
125124
metavar="TREEish",
126125
help="Search TREEish, instead of the work tree",

subcmds/info.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,12 @@ def _Options(self, p):
4343
p.add_option(
4444
"-o",
4545
"--overview",
46-
dest="overview",
4746
action="store_true",
4847
help="show overview of all local commits",
4948
)
5049
p.add_option(
5150
"-c",
5251
"--current-branch",
53-
dest="current_branch",
5452
action="store_true",
5553
help="consider only checked out branches",
5654
)

subcmds/list.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,13 @@ def _Options(self, p):
4040
p.add_option(
4141
"-r",
4242
"--regex",
43-
dest="regex",
4443
action="store_true",
4544
help="filter the project list based on regex or wildcard matching "
4645
"of strings",
4746
)
4847
p.add_option(
4948
"-g",
5049
"--groups",
51-
dest="groups",
5250
help="filter the project list based on the groups the project is "
5351
"in",
5452
)
@@ -61,21 +59,18 @@ def _Options(self, p):
6159
p.add_option(
6260
"-n",
6361
"--name-only",
64-
dest="name_only",
6562
action="store_true",
6663
help="display only the name of the repository",
6764
)
6865
p.add_option(
6966
"-p",
7067
"--path-only",
71-
dest="path_only",
7268
action="store_true",
7369
help="display only the path of the repository",
7470
)
7571
p.add_option(
7672
"-f",
7773
"--fullpath",
78-
dest="fullpath",
7974
action="store_true",
8075
help="display the full work tree path instead of the relative path",
8176
)

subcmds/manifest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ def _Options(self, p):
134134
p.add_option(
135135
"-o",
136136
"--output-file",
137-
dest="output_file",
138137
default="-",
139138
help="file to save the manifest to. (Filename prefix for "
140139
"multi-tree.)",

subcmds/overview.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ def _Options(self, p):
3737
p.add_option(
3838
"-c",
3939
"--current-branch",
40-
dest="current_branch",
4140
action="store_true",
4241
help="consider only checked out branches",
4342
)

0 commit comments

Comments
 (0)