[GRASS-git] [OSGeo/grass] 2445ad: v.info: Improve how parameters are handled (#5844)

Vaclav Petras noreply at github.com
Fri Jun 20 14:04:11 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/OSGeo/grass
  Commit: 2445ad46f1a83b7caad3a3b1b9d1a6897bec9e94
      https://github.com/OSGeo/grass/commit/2445ad46f1a83b7caad3a3b1b9d1a6897bec9e94
  Author: Vaclav Petras <wenzeslaus at gmail.com>
  Date:   2025-06-20 (Fri, 20 Jun 2025)

  Changed paths:
    M lib/gis/testsuite/test_parser_json.py
    M vector/v.info/local_proto.h
    M vector/v.info/main.c
    M vector/v.info/parse.c
    M vector/v.info/print.c
    M vector/v.info/testsuite/test_vinfo.py
    M vector/v.info/v.info.md

  Log Message:
  -----------
  v.info: Improve how parameters are handled (#5844)

This adjusts how flags are handled in relation to the format parameter. To keep the compatibility format does not have a default, and individual flags turn on the shell behavior for now (instead of having format=plain as default being overriden). This allows for outputting different format with format=plain if we want (I did that for -c which now for format=plain produces name: type instead of type|name which I kept only form format=shell). Both format=shell and format=json print by default similar set to what format=plain prints. Flags -egt will produce same output but individually they turn on only the specific subset which is the same behavior for shell as before introduction of the format parameter.

Given what v.info does, I had to change the whole documentation. I also added more information on printing attribute table columns and database connection and also on topology.

A new Notes section addresses the compatibility issues.

This also needs to update --json test in lib where v.info is used and format is no longer required parameter. Since we test value by value in that test, it is more advantageous to just rely on that test which may show the actual different rather than fail earlier when testing just the number of elements which will produce much less informative message.



To unsubscribe from these emails, change your notification settings at https://github.com/OSGeo/grass/settings/notifications


More information about the grass-commit mailing list