Skip to content

Commit

Permalink
additional changes based on review
Browse files Browse the repository at this point in the history
Signed-off-by: Nishant Bansal <[email protected]>
  • Loading branch information
NishantBansal2003 committed Oct 28, 2024
1 parent fee4eb1 commit 821488d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions vector/v.info/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@ int main(int argc, char *argv[])
parse_args(argc, argv, &input_opt, &field_opt, &hist_flag, &col_flag,
&shell_flag, &format);

if (format == JSON) {
root_value = json_value_init_object();
root_object = json_value_get_object(root_value);
}

/* try to open head-only on level 2 */
if (Vect_open_old_head2(&Map, input_opt, "", field_opt) < 2) {
/* force level 1, open fully
Expand Down Expand Up @@ -92,6 +87,11 @@ int main(int argc, char *argv[])
return (EXIT_SUCCESS);
}

if (format == JSON) {
root_value = json_value_init_object();
root_object = json_value_get_object(root_value);
}

if ((shell_flag & SHELL_BASIC) || format == JSON) {
print_shell(&Map, field_opt, format, root_object);
}
Expand Down

0 comments on commit 821488d

Please sign in to comment.