You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* WIP Explore adding long-format GMT options
This branch is work in progress on adding long-format option parsing to GMT. E.g., --region=w/e/s/n instead of -Rw/e/s/n, --registration=pixel instead of -r, and so on. At the moment only the common options and their most basic forms have been implemented, as well as local options for blockmean.
I will write more later about how this all works and what is required to be added to each module - blockmean.c static variable local_kw shows how.
* More common option long-format words
Update long-syntax for -U and -s.
* Update mgd77track.c
Merge from master missed the new NULL argument..
* Add separator variable to GMT_KW_DICT
Needed to split parsing of options that are given as a series of arguments separated by slashes (e.g., xinc/yinc) or commas (e.g., input columns).
* Let -T option be a modifer under -C
The -T and -C are dealing with the same issue: The text bounding box atrributes. I have combined these with -T now being a modifer +t<shape> under -C. Tests pass, documentation has been updated.
* Remove the ifdef USE_GMT_KWD
No point having this since this is a separate branch for testing anyway.
* Implement parsing of sections
Added code to handle multi-section arguments such as --increments=30+e/50+n
* Documentation
Improve the documentation of the new gmtinit_kw_replace function that converts long-format GMT options to standard short-format options.
* Fix a few issues
missing args to gmt_init_module.
* Seppl out structure name
KEYWORD_DICTIONARY
* rename a few keywords
Sucn as read-columns and write-columns.
* Add grdinterpolate to the mix and fix some errors
* Let keyword dictionary be ifdef under USE_LONG_OPTIONS
This means it can be merged into master with no side-effects since developers must define USE_LONG_OPTIONS for any keywords to be defined.
* Minor text improvements
* Fix the use of USE_LONG_OPTIONS
* Update ConfigUserTemplate.cmake
Forgot it has to be a define, not cmake variable.
* Add --frame
* Rename kw arrays to make it clearer that one is module-specific
* Update src/blockmean.c
Co-Authored-By: Dongdong Tian <[email protected]>
* Fix issues in block_subs.c
* Update src/gmt_init.c
Co-Authored-By: Dongdong Tian <[email protected]>
* Update src/gmt_init.c
Co-Authored-By: Dongdong Tian <[email protected]>
* Adding axes as keyword
Better docs for code, longer variables, fixing some bugs.
* Escape +? strings that should not be seen as modifiers
* Move --increment to block_subs.c, update commons, use --axis
--frame=axes sets which axes to draw, and --axis specifies the settings of an axis.
* Enable CI testing for long options (#2305)
* Add a long-format option test to test/modern
* Improve coments only
Co-authored-by: Leonardo Uieda <[email protected]>
Co-authored-by: Dongdong Tian <[email protected]>
Copy file name to clipboardExpand all lines: src/begin.c
+1-1
Original file line number
Diff line number
Diff line change
@@ -141,7 +141,7 @@ int GMT_begin (void *V_API, int mode, void *args) {
141
141
142
142
/* Parse the command-line arguments */
143
143
144
-
if ((GMT=gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) ==NULL) return (API->error); /* Save current state */
144
+
if ((GMT=gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) ==NULL) return (API->error); /* Save current state */
145
145
if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error);
146
146
if ((error=parse (GMT, options)) !=0) Return (error);
Copy file name to clipboardExpand all lines: src/blockmean.c
+3-3
Original file line number
Diff line number
Diff line change
@@ -41,8 +41,8 @@
41
41
#include"block_subs.h"
42
42
43
43
enumBlock_Modes {
44
-
BLK_MODE_NOTSET=0, /* No -E+p|P (or -Ep) set */
45
-
BLK_MODE_OBSOLETE=1, /* Old -Ep for backwards compatibility; assumes input weights are already set to 1/s^ */
44
+
BLK_MODE_NOTSET=0, /* No -E+p|P (or -Ep) set */
45
+
BLK_MODE_OBSOLETE=1, /* Old -Ep for backwards compatibility; assumes input weights are already set to 1/s^2 */
46
46
BLK_MODE_WEIGHTED=2, /* -E+p computes weighted z means and error propagation on weighted z mean, using input s and w = 1/s^2 */
47
47
BLK_MODE_SIMPLE=3/* -E+P computes simple z means and error propagation on simple z mean, using input s and w = 1/s^2 */
48
48
};
@@ -307,7 +307,7 @@ int GMT_blockmean (void *V_API, int mode, void *args) {
307
307
308
308
/* Parse the command-line arguments */
309
309
310
-
if ((GMT=gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) ==NULL) bailout (API->error); /* Save current state */
310
+
if ((GMT=gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, module_kw, &options, &GMT_cpy)) ==NULL) bailout (API->error); /* Save current state */
311
311
if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error);
312
312
Ctrl=New_Ctrl (GMT); /* Allocate and initialize a new control structure */
313
313
if ((error=parse (GMT, Ctrl, options)) !=0) Return (error);
Copy file name to clipboardExpand all lines: src/blockmedian.c
+1-1
Original file line number
Diff line number
Diff line change
@@ -395,7 +395,7 @@ int GMT_blockmedian (void *V_API, int mode, void *args) {
395
395
396
396
/* Parse the command-line arguments */
397
397
398
-
if ((GMT=gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) ==NULL) bailout (API->error); /* Save current state */
398
+
if ((GMT=gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, module_kw, &options, &GMT_cpy)) ==NULL) bailout (API->error); /* Save current state */
399
399
if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error);
400
400
Ctrl=New_Ctrl (GMT); /* Allocate and initialize a new control structure */
401
401
if ((error=parse (GMT, Ctrl, options)) !=0) Return (error);
Copy file name to clipboardExpand all lines: src/blockmode.c
+1-1
Original file line number
Diff line number
Diff line change
@@ -519,7 +519,7 @@ int GMT_blockmode (void *V_API, int mode, void *args) {
519
519
520
520
/* Parse the command-line arguments */
521
521
522
-
if ((GMT=gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) ==NULL) bailout (API->error); /* Save current state */
522
+
if ((GMT=gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, module_kw, &options, &GMT_cpy)) ==NULL) bailout (API->error); /* Save current state */
523
523
if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error);
524
524
Ctrl=New_Ctrl (GMT); /* Allocate and initialize a new control structure */
525
525
if ((error=parse (GMT, Ctrl, options)) !=0) Return (error);
Copy file name to clipboardExpand all lines: src/clear.c
+1-1
Original file line number
Diff line number
Diff line change
@@ -150,7 +150,7 @@ int GMT_clear (void *V_API, int mode, void *args) {
150
150
151
151
/* Parse the command-line arguments */
152
152
153
-
if ((GMT=gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) ==NULL) bailout (API->error); /* Save current state */
153
+
if ((GMT=gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) ==NULL) bailout (API->error); /* Save current state */
154
154
if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error);
155
155
if ((error=parse (GMT, options)) !=0) Return (error);
Copy file name to clipboardExpand all lines: src/dimfilter.c
+1-1
Original file line number
Diff line number
Diff line change
@@ -584,7 +584,7 @@ int GMT_dimfilter (void *V_API, int mode, void *args) {
584
584
585
585
/* Parse the command-line arguments */
586
586
587
-
if ((GMT=gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) ==NULL) bailout (API->error); /* Save current state */
587
+
if ((GMT=gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) ==NULL) bailout (API->error); /* Save current state */
588
588
if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error);
589
589
Ctrl=New_Ctrl (GMT); /* Allocate and initialize a new control structure */
590
590
if ((error=parse (GMT, Ctrl, options)) !=0) Return (error);
Copy file name to clipboardExpand all lines: src/docs.c
+1-1
Original file line number
Diff line number
Diff line change
@@ -104,7 +104,7 @@ int GMT_docs (void *V_API, int mode, void *args) {
104
104
105
105
/* Parse the command-line arguments */
106
106
107
-
if ((GMT=gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) ==NULL) bailout (API->error); /* Save current state */
107
+
if ((GMT=gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) ==NULL) bailout (API->error); /* Save current state */
108
108
109
109
/*---------------------------- This is the docs main code ----------------------------*/
Copy file name to clipboardExpand all lines: src/end.c
+1-1
Original file line number
Diff line number
Diff line change
@@ -108,7 +108,7 @@ int GMT_end (void *V_API, int mode, void *args) {
108
108
109
109
/* Parse the command-line arguments */
110
110
111
-
if ((GMT=gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) ==NULL) bailout (API->error); /* Save current state */
111
+
if ((GMT=gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) ==NULL) bailout (API->error); /* Save current state */
112
112
if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error);
113
113
if ((error=parse (GMT, options, &show)) !=0) Return (error);
Copy file name to clipboardExpand all lines: src/figure.c
+1-1
Original file line number
Diff line number
Diff line change
@@ -149,7 +149,7 @@ int GMT_figure (void *V_API, int mode, void *args) {
149
149
150
150
/* Parse the command-line arguments */
151
151
152
-
if ((GMT=gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) ==NULL) bailout (API->error); /* Save current state */
152
+
if ((GMT=gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) ==NULL) bailout (API->error); /* Save current state */
153
153
if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error);
154
154
if ((error=parse (GMT, options)) !=0) Return (error);
Copy file name to clipboardExpand all lines: src/filter1d.c
+1-1
Original file line number
Diff line number
Diff line change
@@ -870,7 +870,7 @@ int GMT_filter1d (void *V_API, int mode, void *args) {
870
870
871
871
/* Parse the command-line arguments */
872
872
873
-
if ((GMT=gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) ==NULL) bailout (API->error); /* Save current state */
873
+
if ((GMT=gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) ==NULL) bailout (API->error); /* Save current state */
Copy file name to clipboardExpand all lines: src/fitcircle.c
+1-1
Original file line number
Diff line number
Diff line change
@@ -381,7 +381,7 @@ int GMT_fitcircle (void *V_API, int mode, void *args) {
381
381
382
382
/* Parse the command-line arguments */
383
383
384
-
if ((GMT=gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) ==NULL) bailout (API->error); /* Save current state */
384
+
if ((GMT=gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) ==NULL) bailout (API->error); /* Save current state */
385
385
if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error);
386
386
Ctrl=New_Ctrl (GMT); /* Allocate and initialize a new control structure */
387
387
if ((error=parse (GMT, Ctrl, options)) !=0) Return (error);
Copy file name to clipboardExpand all lines: src/geodesy/earthtide.c
+1-1
Original file line number
Diff line number
Diff line change
@@ -1448,7 +1448,7 @@ int GMT_earthtide (void *V_API, int mode, void *args) {
1448
1448
1449
1449
/* Parse the command-line arguments */
1450
1450
1451
-
if ((GMT=gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) ==NULL) bailout (API->error); /* Save current state */
1451
+
if ((GMT=gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) ==NULL) bailout (API->error); /* Save current state */
1452
1452
if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error);
1453
1453
Ctrl=New_Ctrl (GMT); /* Allocate and initialize a new control structure */
1454
1454
if ((error=parse (GMT, Ctrl, options)) !=0) Return (error);
Copy file name to clipboardExpand all lines: src/geodesy/gpsgridder.c
+1-1
Original file line number
Diff line number
Diff line change
@@ -554,7 +554,7 @@ int GMT_gpsgridder (void *V_API, int mode, void *args) {
554
554
555
555
/* Parse the command-line arguments */
556
556
557
-
if ((GMT=gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) ==NULL) bailout (API->error); /* Save current state */
557
+
if ((GMT=gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) ==NULL) bailout (API->error); /* Save current state */
558
558
if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error);
559
559
Ctrl=New_Ctrl (GMT); /* Allocate and initialize a new control structure */
560
560
if ((error=parse (GMT, Ctrl, options)) !=0) Return (error);
Copy file name to clipboardExpand all lines: src/geodesy/psvelo.c
+1-1
Original file line number
Diff line number
Diff line change
@@ -353,7 +353,7 @@ int GMT_psvelo (void *V_API, int mode, void *args) {
353
353
354
354
/* Parse the command-line arguments; return if errors are encountered */
355
355
356
-
if ((GMT=gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) ==NULL) bailout (API->error); /* Save current state */
356
+
if ((GMT=gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) ==NULL) bailout (API->error); /* Save current state */
357
357
if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error);
358
358
Ctrl=New_Ctrl (GMT); /* Allocate and initialize a new control structure */
359
359
if ((error=parse (GMT, Ctrl, options)) !=0) Return (error);
Copy file name to clipboardExpand all lines: src/gmt2kml.c
+1-1
Original file line number
Diff line number
Diff line change
@@ -859,7 +859,7 @@ int GMT_gmt2kml (void *V_API, int mode, void *args) {
859
859
860
860
/* Parse the command-line arguments */
861
861
862
-
if ((GMT=gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) ==NULL) bailout (API->error); /* Save current state */
862
+
if ((GMT=gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) ==NULL) bailout (API->error); /* Save current state */
863
863
if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error);
864
864
Ctrl=New_Ctrl (GMT); /* Allocate and initialize a new control structure */
865
865
if ((error=parse (GMT, Ctrl, options)) !=0) Return (error);
0 commit comments