scripts: Tweaked -./-p/-P flags in ascii scripts

- -*/--add-char/--chars -> -./--add-char/--chars
- -./--points -> -p/--points
- -!/--points-and-lines -> -P/--points-and-lines

Also fixed an issue in plot.py/Attr where non-list default were failing
to concatenate.
This commit is contained in:
Christopher Haster
2025-03-11 13:21:14 -05:00
parent 5b5745bca9
commit b2646148c1
6 changed files with 13 additions and 13 deletions
+2 -2
View File
@@ -95,7 +95,7 @@ class Attr:
not isinstance(attr, tuple) not isinstance(attr, tuple)
or attr[0] in {None, (), ('*',)} or attr[0] in {None, (), ('*',)}
for attr in (attrs or []))): for attr in (attrs or []))):
attrs = defaults + (attrs or []) attrs = list(defaults) + (attrs or [])
# normalize # normalize
self.attrs = [] self.attrs = []
@@ -1194,7 +1194,7 @@ if __name__ == "__main__":
help="Add a label to use. Can be assigned to a specific " help="Add a label to use. Can be assigned to a specific "
"function/subsystem. Accepts %% modifiers.") "function/subsystem. Accepts %% modifiers.")
parser.add_argument( parser.add_argument(
'-*', '--add-char', '--chars', '-.', '--add-char', '--chars',
dest='chars', dest='chars',
action='append', action='append',
type=lambda x: ( type=lambda x: (
+1 -1
View File
@@ -113,7 +113,7 @@ class Attr:
not isinstance(attr, tuple) not isinstance(attr, tuple)
or attr[0] in {None, (), ('*',)} or attr[0] in {None, (), ('*',)}
for attr in (attrs or []))): for attr in (attrs or []))):
attrs = defaults + (attrs or []) attrs = list(defaults) + (attrs or [])
# normalize # normalize
self.attrs = [] self.attrs = []
+4 -4
View File
@@ -381,7 +381,7 @@ class Attr:
not isinstance(attr, tuple) not isinstance(attr, tuple)
or attr[0] in {None, (), ('*',)} or attr[0] in {None, (), ('*',)}
for attr in (attrs or []))): for attr in (attrs or []))):
attrs = defaults + (attrs or []) attrs = list(defaults) + (attrs or [])
# normalize # normalize
self.attrs = [] self.attrs = []
@@ -1703,7 +1703,7 @@ if __name__ == "__main__":
"where a group is the comma-separated 'by' fields. Accepts %% " "where a group is the comma-separated 'by' fields. Accepts %% "
"modifiers. Also provides an ordering.") "modifiers. Also provides an ordering.")
parser.add_argument( parser.add_argument(
'-*', '--add-char', '--chars', '-.', '--add-char', '--chars',
dest='chars', dest='chars',
action='append', action='append',
type=lambda x: ( type=lambda x: (
@@ -1756,11 +1756,11 @@ if __name__ == "__main__":
help="Use 2x4 unicode braille characters. Note that braille " help="Use 2x4 unicode braille characters. Note that braille "
"characters sometimes suffer from inconsistent widths.") "characters sometimes suffer from inconsistent widths.")
parser.add_argument( parser.add_argument(
'-.', '--points', '-p', '--points',
action='store_true', action='store_true',
help="Only draw data points.") help="Only draw data points.")
parser.add_argument( parser.add_argument(
'-!', '--points-and-lines', '-P', '--points-and-lines',
action='store_true', action='store_true',
help="Draw data points and lines.") help="Draw data points and lines.")
parser.add_argument( parser.add_argument(
+3 -3
View File
@@ -305,7 +305,7 @@ class Attr:
not isinstance(attr, tuple) not isinstance(attr, tuple)
or attr[0] in {None, (), ('*',)} or attr[0] in {None, (), ('*',)}
for attr in (attrs or []))): for attr in (attrs or []))):
attrs = defaults + (attrs or []) attrs = list(defaults) + (attrs or [])
# normalize # normalize
self.attrs = [] self.attrs = []
@@ -1341,11 +1341,11 @@ if __name__ == "__main__":
"specific group where a group is the comma-separated 'by' " "specific group where a group is the comma-separated 'by' "
"fields. Accepts %% modifiers.") "fields. Accepts %% modifiers.")
parser.add_argument( parser.add_argument(
'-.', '--points', '-p', '--points',
action='store_true', action='store_true',
help="Only draw data points.") help="Only draw data points.")
parser.add_argument( parser.add_argument(
'-!', '--points-and-lines', '-P', '--points-and-lines',
action='store_true', action='store_true',
help="Draw data points and lines.") help="Draw data points and lines.")
parser.add_argument( parser.add_argument(
+2 -2
View File
@@ -164,7 +164,7 @@ class Attr:
not isinstance(attr, tuple) not isinstance(attr, tuple)
or attr[0] in {None, (), ('*',)} or attr[0] in {None, (), ('*',)}
for attr in (attrs or []))): for attr in (attrs or []))):
attrs = defaults + (attrs or []) attrs = list(defaults) + (attrs or [])
# normalize # normalize
self.attrs = [] self.attrs = []
@@ -1058,7 +1058,7 @@ if __name__ == "__main__":
"where a group is the comma-separated 'by' fields. Accepts %% " "where a group is the comma-separated 'by' fields. Accepts %% "
"modifiers.") "modifiers.")
parser.add_argument( parser.add_argument(
'-*', '--add-char', '--chars', '-.', '--add-char', '--chars',
dest='chars', dest='chars',
action='append', action='append',
type=lambda x: ( type=lambda x: (
+1 -1
View File
@@ -181,7 +181,7 @@ class Attr:
not isinstance(attr, tuple) not isinstance(attr, tuple)
or attr[0] in {None, (), ('*',)} or attr[0] in {None, (), ('*',)}
for attr in (attrs or []))): for attr in (attrs or []))):
attrs = defaults + (attrs or []) attrs = list(defaults) + (attrs or [])
# normalize # normalize
self.attrs = [] self.attrs = []