@@ -82,9 +82,6 @@ def moban_exit(exit_code_toggle_flag, exit_code):
82
82
83
83
84
84
def create_parser ():
85
- """
86
- construct the program options
87
- """
88
85
parser = argparse .ArgumentParser (
89
86
prog = constants .PROGRAM_NAME , description = constants .PROGRAM_DESCRIPTION
90
87
)
@@ -109,13 +106,13 @@ def create_parser():
109
106
)
110
107
advanced .add_argument (
111
108
"-td" ,
112
- "--%s" % constants .LABEL_TMPL_DIRS ,
109
+ f "--{ constants .LABEL_TMPL_DIRS } " ,
113
110
nargs = "*" ,
114
111
help = "add more directories for template file lookup" ,
115
112
)
116
113
advanced .add_argument (
117
114
"-cd" ,
118
- "--%s" % constants .LABEL_CONFIG_DIR ,
115
+ f "--{ constants .LABEL_CONFIG_DIR } " ,
119
116
help = "the directory for configuration file lookup" ,
120
117
)
121
118
advanced .add_argument (
@@ -125,12 +122,12 @@ def create_parser():
125
122
"-g" , "--%s" % constants .LABEL_GROUP , help = "a subset of targets"
126
123
)
127
124
advanced .add_argument (
128
- "--%s" % constants .LABEL_TEMPLATE_TYPE .replace ("_" , "-" ) ,
125
+ f "--{ constants .LABEL_TEMPLATE_TYPE .replace ('_' , '-' ) } " ,
129
126
help = "the template type, default is jinja2" ,
130
127
)
131
128
advanced .add_argument (
132
129
"-d" ,
133
- "--%s" % constants .LABEL_DEFINE ,
130
+ f "--{ constants .LABEL_DEFINE } " ,
134
131
nargs = "+" ,
135
132
help = (
136
133
"to supply additional or override predefined variables,"
@@ -139,7 +136,7 @@ def create_parser():
139
136
)
140
137
advanced .add_argument (
141
138
"-e" ,
142
- "--%s" % constants .LABEL_EXTENSION ,
139
+ f "--{ constants .LABEL_EXTENSION } " ,
143
140
nargs = "+" ,
144
141
help = "to to TEMPLATE_TYPE=EXTENSION_NAME" ,
145
142
)
@@ -154,15 +151,15 @@ def create_parser():
154
151
"Developer options" , "For debugging and development"
155
152
)
156
153
developer .add_argument (
157
- "--%s" % constants .LABEL_EXIT_CODE ,
154
+ f "--{ constants .LABEL_EXIT_CODE } " ,
158
155
action = "store_true" ,
159
156
dest = constants .LABEL_EXIT_CODE ,
160
157
default = False ,
161
158
help = "tell moban to change exit code" ,
162
159
)
163
160
developer .add_argument (
164
161
"-V" ,
165
- "--%s" % constants .LABEL_VERSION ,
162
+ f "--{ constants .LABEL_VERSION } " ,
166
163
action = "version" ,
167
164
version = "%(prog)s {v}" .format (v = __version__ ),
168
165
)
0 commit comments