Skip to content

Commit 150ff46

Browse files
authored
docs: Add format to example even when not required (OSGeo#5845)
The Python example counts on format option being there, so we need to add that even if it is not required. This allows for empty and not required format in v.info in OSGeo#5844.
1 parent 959fdf4 commit 150ff46

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/gis/parser_md_python.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,8 @@ void print_python_example(FILE *file, const char *python_function,
284284
type = "string";
285285
break;
286286
}
287-
if (opt->required || first_required_rule_option == opt) {
287+
if (opt->required || first_required_rule_option == opt ||
288+
(strcmp(opt->key, "format") == 0 && output_format_default)) {
288289
fprintf(file, ", %s=", opt->key);
289290
if (output_format_default && strcmp(opt->key, "format") == 0) {
290291
fprintf(file, "\"%s\"", output_format_default);

0 commit comments

Comments
 (0)