diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2016-08-05 13:53:19 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2016-08-05 13:53:19 +0300 |
commit | edd1a92f6743a5f5c31fa1468fdb511c097e75ad (patch) | |
tree | 92453e83b14a43923e845228313447c2f310fa64 | |
parent | 95b9dbb21aa2a7721c091aa79c680b4531fa804b (diff) | |
download | grecs-edd1a92f6743a5f5c31fa1468fdb511c097e75ad.tar.gz grecs-edd1a92f6743a5f5c31fa1468fdb511c097e75ad.tar.bz2 |
New operator to stop option processing
* build-aux/getopt.m4 (LASTOPT): New macro. Stops further
option processing.
-rw-r--r-- | build-aux/getopt.m4 | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/build-aux/getopt.m4 b/build-aux/getopt.m4 index cf375ca..d424088 100644 --- a/build-aux/getopt.m4 +++ b/build-aux/getopt.m4 | |||
@@ -262,6 +262,10 @@ define([<OPTNODE>],[<do { | |||
262 | } while(0) | 262 | } while(0) |
263 | >]) | 263 | >]) |
264 | 264 | ||
265 | dnl LASTOPT() | ||
266 | dnl Stop option processing (as if "--" has been encountered | ||
267 | define([<LASTOPT>],[<goto lastoptlab>]) | ||
268 | |||
265 | dnl GETOPT(argc, argv, [long_index], [onerr]) | 269 | dnl GETOPT(argc, argv, [long_index], [onerr]) |
266 | dnl Emit option parsing code. Arguments: | 270 | dnl Emit option parsing code. Arguments: |
267 | dnl | 271 | dnl |
@@ -291,6 +295,7 @@ define([<GETOPT>],[< | |||
291 | undivert(4) | 295 | undivert(4) |
292 | } | 296 | } |
293 | } | 297 | } |
298 | lastoptlab: | ||
294 | ifelse([<$3>],,[< | 299 | ifelse([<$3>],,[< |
295 | if (optind < argc) { | 300 | if (optind < argc) { |
296 | fprintf(stderr, "%s: unexpected arguments\n", $2[0]); | 301 | fprintf(stderr, "%s: unexpected arguments\n", $2[0]); |