[GRASS-dev] [GRASS GIS] #1778: Typing in g.region without parameters does not open a g.region window

GRASS GIS trac at osgeo.org
Thu Sep 12 21:02:42 PDT 2013


#1778: Typing in g.region without parameters does not open a g.region window
----------------------------------------+-----------------------------------
 Reporter:  pvanbosgeo                  |       Owner:  grass-dev@…              
     Type:  defect                      |      Status:  new                      
 Priority:  normal                      |   Milestone:  7.0.0                    
Component:  Default                     |     Version:  svn-trunk                
 Keywords:  g.region, r.colors, r.mask  |    Platform:  Linux                    
      Cpu:  x86-64                      |  
----------------------------------------+-----------------------------------

Comment(by glynn):

 Replying to [comment:27 hamish]:

 > I'm still highly confused about the need for any change since everything
 seemed to be working very smoothly in GRASS 6. For example d.erase if
 called alone would do its job without a GUI,

 That's because it does this:

 {{{
     if (argc > 1 && G_parser(argc, argv))
         exit(1);
 }}}

 If you run it without arguments, G_parser() never gets called (this was to
 prevent it using the terminal-based interactive prompting which preceded
 the parameter dialogs).

 But in 7.0, it's required that all modules call G_parser(), always, no
 exceptions. This is required e.g. for setting the verbose/quiet/overwrite
 status from environment variables. It's possible that other initialisation
 tasks may be moved from G_gisinit() to G_parser() in the future.

 Consequently, G_parser() can't be skipped, and changing the dialog
 condition from "no options given" to "no options given, but at least one
 required" was the simplest way to preserve the "no unnecessary dialogs"
 behaviour. However, because it's now implemented in the parser rather than
 the module, the module can't override the decision in the event that the
 "no required options" logic is inadequate.

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/1778#comment:28>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list