grass icon indicating copy to clipboard operation
grass copied to clipboard

lib/parser: Use project for G_OPT_M_LOCATION

Open wenzeslaus opened this issue 2 years ago • 2 comments

Standard option G_OPT_M_LOCATION which creates option named location now creates option named location. Each module using G_OPT_M_LOCATION without further modifications has its own entry in in the renamed options file for backwards compatibility.

New usage of g.mapset:

> g.mapset project=nc_basic_spm_grass7 mapset=user1

Still works:

> g.mapset location=nc_spm_08_grass7 mapset=user1

The latter produces a warning:

WARNING: Please update the usage of <g.mapset>: option <location> has been
         renamed to <project>

g.mapset --h:

Changes/reports current mapset.

Usage:
 g.mapset [-clp] mapset=name [project=name] [dbase=path] [--overwrite]
   [--help] [--verbose] [--quiet] [--ui]

Flags:
  -c   Create mapset if it doesn't exist
  -l   List available mapsets and exit
  -p   Print current mapset and exit

Parameters:
   mapset   Name of mapset (default: current search path)
  project   Project (location) name
    dbase   GRASS GIS database directory

This applies to:

  • g.mapset
  • r.proj
  • i.ortho.elev
  • g.download.location
  • v.proj

wenzeslaus avatar Aug 16 '23 01:08 wenzeslaus

@wenzeslaus Do you consider adding new G_OPT_M_PROJECT and switching to it eventually in GRASS 9?

HuidaeCho avatar Sep 22 '23 14:09 HuidaeCho

Yes. That fits with the general plan of adding "project" to the API and then gradually removing usage of "location" internally.

wenzeslaus avatar Sep 22 '23 15:09 wenzeslaus