Lines Matching full:opt
83 def get_help(opt): argument
84 if opt["name"] == "libdir":
86 value = opt["value"]
110 def help_line(left, opt, indent, long): argument
111 right = f'{opt["description"]}'
113 value = get_help(opt)
116 if "choices" in opt and long:
117 choices = "/".join(sorted(opt["choices"]))
127 def allow_arg(opt): argument
128 if opt["type"] == "boolean":
130 if opt["type"] != "combo":
132 return not (set(opt["choices"]) <= {"auto", "disabled", "enabled"})
139 def require_arg(opt): argument
140 if opt["type"] == "boolean":
142 if opt["type"] != "combo":
144 return not ({"enabled", "disabled"}.intersection(opt["choices"]))
161 def cli_option(opt): argument
162 name = opt["name"]
168 def cli_help_key(opt): argument
169 key = cli_option(opt)
170 if require_arg(opt):
172 if opt["type"] == "boolean" and opt["value"]:
177 def cli_metavar(opt): argument
178 if opt["type"] == "string":
180 if opt["type"] == "array":
181 return "CHOICES" if "choices" in opt else "VALUES"
188 for opt in sorted(options, key=cli_help_key):
189 key = cli_help_key(opt)
192 if require_arg(opt):
193 metavar = cli_metavar(opt)
195 help_line(left, opt, 27, True)
196 elif opt["type"] == "boolean" and opt["name"] not in AUTO_OPTIONS:
198 help_line(left, opt, 27, False)
199 elif allow_arg(opt):
200 if opt["type"] == "combo" and "enabled" in opt["choices"]:
204 help_line(left, opt, 27, True)
206 feature_opts.append(opt)
213 for opt in sorted(feature_opts, key=cli_option):
214 key = cli_option(opt)
215 help_line(key, opt, 18, False)
222 for opt in options:
223 key = cli_option(opt)
224 name = opt["name"]
225 if require_arg(opt):
226 if opt["type"] == "array" and not "choices" in opt:
230 elif opt["type"] == "boolean":
234 if opt["type"] == "combo" and "enabled" in opt["choices"]:
236 if opt["type"] == "combo" and "disabled" in opt["choices"]:
238 if allow_arg(opt):