scripts: Renamed -p/--percent -> -%/--percent

How long has there been a whole key dedicated to percentages sitting on
my keyboard!?

There's some funky business with format strings in argparse, but this
was already worked around for dbgbmap.py's -%/--usage flag.
This commit is contained in:
Christopher Haster
2026-02-06 22:48:48 -06:00
parent 2cf87dedb4
commit 37288fceab
9 changed files with 54 additions and 18 deletions
+6 -2
View File
@@ -1150,9 +1150,13 @@ if __name__ == "__main__":
parser.add_argument(
'-d', '--diff',
help="Specify CSV/JSON file to diff against.")
# need a special Action here because this % causes problems
class StoreTruePercent(argparse._StoreTrueAction):
def format_usage(self):
return '-%%'
parser.add_argument(
'-p', '--percent',
action='store_true',
'-%', '--percent',
action=StoreTruePercent,
help="Only show percentage change, not a full diff.")
parser.add_argument(
'-C', '--compare',
+6 -2
View File
@@ -1129,9 +1129,13 @@ if __name__ == "__main__":
parser.add_argument(
'-d', '--diff',
help="Specify CSV/JSON file to diff against.")
# need a special Action here because this % causes problems
class StoreTruePercent(argparse._StoreTrueAction):
def format_usage(self):
return '-%%'
parser.add_argument(
'-p', '--percent',
action='store_true',
'-%', '--percent',
action=StoreTruePercent,
help="Only show percentage change, not a full diff.")
parser.add_argument(
'-C', '--compare',
+6 -2
View File
@@ -3215,9 +3215,13 @@ if __name__ == "__main__":
parser.add_argument(
'-d', '--diff',
help="Specify CSV/JSON file to diff against.")
# need a special Action here because this % causes problems
class StoreTruePercent(argparse._StoreTrueAction):
def format_usage(self):
return '-%%'
parser.add_argument(
'-p', '--percent',
action='store_true',
'-%', '--percent',
action=StoreTruePercent,
help="Only show percentage change, not a full diff.")
parser.add_argument(
'-C', '--compare',
+6 -2
View File
@@ -1445,9 +1445,13 @@ if __name__ == "__main__":
parser.add_argument(
'-d', '--diff',
help="Specify CSV/JSON file to diff against.")
# need a special Action here because this % causes problems
class StoreTruePercent(argparse._StoreTrueAction):
def format_usage(self):
return '-%%'
parser.add_argument(
'-p', '--percent',
action='store_true',
'-%', '--percent',
action=StoreTruePercent,
help="Only show percentage change, not a full diff.")
parser.add_argument(
'-C', '--compare',
+6 -2
View File
@@ -1150,9 +1150,13 @@ if __name__ == "__main__":
parser.add_argument(
'-d', '--diff',
help="Specify CSV/JSON file to diff against.")
# need a special Action here because this % causes problems
class StoreTruePercent(argparse._StoreTrueAction):
def format_usage(self):
return '-%%'
parser.add_argument(
'-p', '--percent',
action='store_true',
'-%', '--percent',
action=StoreTruePercent,
help="Only show percentage change, not a full diff.")
parser.add_argument(
'-C', '--compare',
+6 -2
View File
@@ -1689,9 +1689,13 @@ if __name__ == "__main__":
parser.add_argument(
'-d', '--diff',
help="Specify CSV/JSON file to diff against.")
# need a special Action here because this % causes problems
class StoreTruePercent(argparse._StoreTrueAction):
def format_usage(self):
return '-%%'
parser.add_argument(
'-p', '--percent',
action='store_true',
'-%', '--percent',
action=StoreTruePercent,
help="Only show percentage change, not a full diff.")
parser.add_argument(
'-C', '--compare',
+6 -2
View File
@@ -1690,9 +1690,13 @@ if __name__ == "__main__":
parser.add_argument(
'-d', '--diff',
help="Specify CSV/JSON file to diff against.")
# need a special Action here because this % causes problems
class StoreTruePercent(argparse._StoreTrueAction):
def format_usage(self):
return '-%%'
parser.add_argument(
'-p', '--percent',
action='store_true',
'-%', '--percent',
action=StoreTruePercent,
help="Only show percentage change, not a full diff.")
parser.add_argument(
'-C', '--compare',
+6 -2
View File
@@ -1188,9 +1188,13 @@ if __name__ == "__main__":
parser.add_argument(
'-d', '--diff',
help="Specify CSV/JSON file to diff against.")
# need a special Action here because this % causes problems
class StoreTruePercent(argparse._StoreTrueAction):
def format_usage(self):
return '-%%'
parser.add_argument(
'-p', '--percent',
action='store_true',
'-%', '--percent',
action=StoreTruePercent,
help="Only show percentage change, not a full diff.")
parser.add_argument(
'-C', '--compare',
+6 -2
View File
@@ -1334,9 +1334,13 @@ if __name__ == "__main__":
parser.add_argument(
'-d', '--diff',
help="Specify CSV/JSON file to diff against.")
# need a special Action here because this % causes problems
class StoreTruePercent(argparse._StoreTrueAction):
def format_usage(self):
return '-%%'
parser.add_argument(
'-p', '--percent',
action='store_true',
'-%', '--percent',
action=StoreTruePercent,
help="Only show percentage change, not a full diff.")
parser.add_argument(
'-C', '--compare',