@@ -18,7 +18,7 @@ class ConfigConfig:
1818 "Scale at which to enlarge the entire diagram by." ),
1919 ConfigConfig ("stroke_width" , float , 2 , "Width of the lines" ),
2020 ConfigConfig ("stroke" , str , "black" , "Color of the lines." ),
21- ConfigConfig ("label" , ["" , "VL " , "L" , "V " ], "VL" ,
21+ ConfigConfig ("label" , ["L " , "V " , "VL " ], "VL" ,
2222 "Component label style (L=include label, V=include value, VL=both)" ),
2323 ConfigConfig ("nolabels" , bool , False ,
2424 "Turns off labels on all components, except for part numbers on ICs." ),
@@ -34,6 +34,11 @@ def add_config_arguments(a: argparse.ArgumentParser):
3434 help = opt .description ,
3535 choices = opt .clazz ,
3636 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" )
3742 else :
3843 a .add_argument (
3944 "--" + opt .name ,
@@ -51,7 +56,8 @@ def apply_config_defaults(options: dict) -> dict:
5156 if isinstance (opt .clazz , list ):
5257 if options [opt .name ] not in opt .clazz :
5358 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 ]} "
5561 f"(valid options are { ', ' .join (map (repr , opt .clazz ))} )" )
5662 continue
5763 try :
0 commit comments