| 1 | From: Håvard F. Aasen <[email protected]> |
| 2 | Date: Wed, 2 Aug 2023 14:51:58 +0200 |
| 3 | Subject: man-page: Add information for flags used in poptGetContext() |
| 4 | |
| 5 | Forwarded: https://github.com/rpm-software-management/popt/pull/109 |
| 6 | Applied-Upstream: https://github.com/rpm-software-management/popt/commit/6e9eccbd359abaeac39b880cfe2c8788d15a6a34 |
| 7 | Bug-Debian: https://bugs.debian.org/666431 |
| 8 | --- |
| 9 | popt.3 | 34 ++++++++++++++++++++++++++++++++++ |
| 10 | 1 file changed, 34 insertions(+) |
| 11 | |
| 12 | diff --git a/popt.3 b/popt.3 |
| 13 | index a98b491..8a76d04 100644 |
| 14 | --- a/popt.3 |
| 15 | +++ b/popt.3 |
| 16 | @@ -301,6 +301,40 @@ POPT_CONTEXT_POSIXMEHARDER Options cannot follow arguments |
| 17 | POPT_CONTEXT_ARG_OPTS Return the arguments as options of value 0 |
| 18 | .TE |
| 19 | .sp |
| 20 | +Here is a more detailed discussion of each flag: |
| 21 | +.sp |
| 22 | +.TP |
| 23 | +.B POPT_CONTEXT_NO_EXEC |
| 24 | +This bit disables all uses of |
| 25 | +.BR exec "(2) from within the given popt context." |
| 26 | +.sp |
| 27 | +.TP |
| 28 | +.B POPT_CONTEXT_KEEP_FIRST |
| 29 | +By default, popt ignores the value in |
| 30 | +.I argv[0] |
| 31 | +as it is typically the name of the program being run rather than a command-line |
| 32 | +argument. Specifying this flag causes popt to treat |
| 33 | +.I argv[0] |
| 34 | +as an option. |
| 35 | +.sp |
| 36 | +.TP |
| 37 | +.B POPT_CONTEXT_POSIXMEHARDER |
| 38 | +When this flag is set, it is required that all options is placed before any |
| 39 | +arguments. This flag is also in effect if any of the environment variables |
| 40 | +.B POSIXLY_CORRECT |
| 41 | +or |
| 42 | +.B POSIX_ME_HARDER |
| 43 | +is set. |
| 44 | +.sp |
| 45 | +.TP |
| 46 | +.B POPT_CONTEXT_ARG_OPTS |
| 47 | +When this flag is set, all non-option arguments will get the value 0. This means |
| 48 | +that |
| 49 | +.B poptGetNextOpt() |
| 50 | +returns 0 for all non-option arguments, while |
| 51 | +.BR poptGetArg() " returns " NULL . |
| 52 | +.sp |
| 53 | +.PP |
| 54 | .RB "A " poptContext " keeps track of which options have already been " |
| 55 | parsed and which remain, among other things. If a program wishes to |
| 56 | restart option processing of a set of arguments, it can reset the |