@@ -18,7 +18,7 @@ class ConfigConfig:
18
18
"Scale at which to enlarge the entire diagram by." ),
19
19
ConfigConfig ("stroke_width" , float , 2 , "Width of the lines" ),
20
20
ConfigConfig ("stroke" , str , "black" , "Color of the lines." ),
21
- ConfigConfig ("label" , ["" , "VL " , "L" , "V " ], "VL" ,
21
+ ConfigConfig ("label" , ["L " , "V " , "VL " ], "VL" ,
22
22
"Component label style (L=include label, V=include value, VL=both)" ),
23
23
ConfigConfig ("nolabels" , bool , False ,
24
24
"Turns off labels on all components, except for part numbers on ICs." ),
@@ -34,6 +34,11 @@ def add_config_arguments(a: argparse.ArgumentParser):
34
34
help = opt .description ,
35
35
choices = opt .clazz ,
36
36
default = opt .default )
37
+ elif opt .clazz is bool :
38
+ a .add_argument (
39
+ "--" + opt .name ,
40
+ help = opt .description ,
41
+ action = "store_false" if opt .default else "store_true" )
37
42
else :
38
43
a .add_argument (
39
44
"--" + opt .name ,
@@ -51,7 +56,8 @@ def apply_config_defaults(options: dict) -> dict:
51
56
if isinstance (opt .clazz , list ):
52
57
if options [opt .name ] not in opt .clazz :
53
58
raise ArgumentError (
54
- f"config option { opt .name } : invalid choice: { options [opt .name ]} "
59
+ f"config option { opt .name } : "
60
+ f"invalid choice: { options [opt .name ]} "
55
61
f"(valid options are { ', ' .join (map (repr , opt .clazz ))} )" )
56
62
continue
57
63
try :
0 commit comments