-
-
Notifications
You must be signed in to change notification settings - Fork 394
g.parser: Extend --json flag and documentation #6697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 11 commits
8d4bbf8
c16cf80
8aefd0f
a0408d6
b21bb58
2af5c30
0ab891d
de48425
6c4b67b
6208074
63758e2
7197c4a
3f63048
dfe09f9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -517,7 +517,6 @@ int G_parser(int argc, char **argv) | |||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| /* Loop through all command line arguments */ | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| while (--argc) { | ||||||||||||||||||||||||
| ptr = *(++argv); | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
@@ -547,10 +546,19 @@ int G_parser(int argc, char **argv) | |||||||||||||||||||||||
| snprintf(buff, sizeof(buff), "GRASS_VERBOSE=%d", | ||||||||||||||||||||||||
| G_verbose_max()); | ||||||||||||||||||||||||
| putenv(G_store(buff)); | ||||||||||||||||||||||||
| G_set_verbose(G_verbose_max()); | ||||||||||||||||||||||||
| if (st->quiet == 1) { | ||||||||||||||||||||||||
| G_warning(_("Use either --quiet or --verbose flag, not " | ||||||||||||||||||||||||
| "both. Assuming --verbose.")); | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| if (st->superquiet) { | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| /* Reactivate warnings */ | ||||||||||||||||||||||||
| G_suppress_warnings(FALSE); | ||||||||||||||||||||||||
| G_warning(_("Use either --qq or --verbose flag, not " | ||||||||||||||||||||||||
| "both. Assuming --verbose.")); | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| st->superquiet = 0; /* for passing to gui init */ | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
| /* For boolean values and comparisons use the C99 type 'bool' with values 'true' | |
| */ | |
| /* and 'false' For historical reasons 'TRUE' and 'FALSE' are still valid. */ | |
| #ifndef TRUE | |
| #define TRUE 1 | |
| #endif | |
| #ifndef FALSE | |
| #define FALSE 0 | |
| #endif |
and are used in int-based boolean functionality, e.g.:
grass/include/grass/defs/gis.h
Line 315 in dd421a0
| int G_suppress_warnings(int); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to lowercase for superquiet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With G_set_verbose() added, may this snprintf + putenv blocks be removed?
When i ran some local tests, it does not seem to have any effect after the first time such a block had run, e.g. if users provide both
--vand--pp.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it can,
G_set_verbose()is the dedicated API for just this.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the snprintf + putenv blocks.