-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArgp-Flags.html
More file actions
117 lines (101 loc) · 5.53 KB
/
Argp-Flags.html
File metadata and controls
117 lines (101 loc) · 5.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<html lang="en">
<head>
<title>Argp Flags - The GNU C Library</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="The GNU C Library">
<meta name="generator" content="makeinfo 4.9">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Argp.html#Argp" title="Argp">
<link rel="prev" href="Argp-Parsers.html#Argp-Parsers" title="Argp Parsers">
<link rel="next" href="Argp-Help.html#Argp-Help" title="Argp Help">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
This file documents the GNU C library.
This is Edition 0.11, last updated 2007-09-09,
of `The GNU C Library Reference Manual', for version 2.7.
Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002,
2003, 2007 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with the
Invariant Sections being ``Free Software Needs Free Documentation''
and ``GNU Lesser General Public License'', the Front-Cover texts being
``A GNU Manual'', and with the Back-Cover Texts as in (a) below. A
copy of the license is included in the section entitled "GNU Free
Documentation License".
(a) The FSF's Back-Cover Text is: ``You are free to copy and modify
this GNU Manual. Buying copies from GNU Press supports the FSF in
developing GNU and promoting software freedom.''-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<p>
<a name="Argp-Flags"></a>
Next: <a rel="next" accesskey="n" href="Argp-Help.html#Argp-Help">Argp Help</a>,
Previous: <a rel="previous" accesskey="p" href="Argp-Parsers.html#Argp-Parsers">Argp Parsers</a>,
Up: <a rel="up" accesskey="u" href="Argp.html#Argp">Argp</a>
<hr>
</div>
<h4 class="subsection">25.3.7 Flags for <code>argp_parse</code></h4>
<p>The default behavior of <code>argp_parse</code> is designed to be convenient
for the most common case of parsing program command line argument. To
modify these defaults, the following flags may be or'd together in the
<var>flags</var> argument to <code>argp_parse</code>:
<dl>
<!-- argp.h -->
<!-- GNU -->
<dt><code>ARGP_PARSE_ARGV0</code><a name="index-ARGP_005fPARSE_005fARGV0-3066"></a><dd>Don't ignore the first element of the <var>argv</var> argument to
<code>argp_parse</code>. Unless <code>ARGP_NO_ERRS</code> is set, the first element
of the argument vector is skipped for option parsing purposes, as it
corresponds to the program name in a command line.
<!-- argp.h -->
<!-- GNU -->
<br><dt><code>ARGP_NO_ERRS</code><a name="index-ARGP_005fNO_005fERRS-3067"></a><dd>Don't print error messages for unknown options to <code>stderr</code>; unless
this flag is set, <code>ARGP_PARSE_ARGV0</code> is ignored, as <code>argv[0]</code>
is used as the program name in the error messages. This flag implies
<code>ARGP_NO_EXIT</code>. This is based on the assumption that silent exiting
upon errors is bad behavior.
<!-- argp.h -->
<!-- GNU -->
<br><dt><code>ARGP_NO_ARGS</code><a name="index-ARGP_005fNO_005fARGS-3068"></a><dd>Don't parse any non-option args. Normally these are parsed by calling
the parse functions with a key of <code>ARGP_KEY_ARG</code>, the actual
argument being the value. This flag needn't normally be set, as the
default behavior is to stop parsing as soon as an argument fails to be
parsed. See <a href="Argp-Parser-Functions.html#Argp-Parser-Functions">Argp Parser Functions</a>.
<!-- argp.h -->
<!-- GNU -->
<br><dt><code>ARGP_IN_ORDER</code><a name="index-ARGP_005fIN_005fORDER-3069"></a><dd>Parse options and arguments in the same order they occur on the command
line. Normally they're rearranged so that all options come first.
<!-- argp.h -->
<!-- GNU -->
<br><dt><code>ARGP_NO_HELP</code><a name="index-ARGP_005fNO_005fHELP-3070"></a><dd>Don't provide the standard long option `<samp><span class="samp">--help</span></samp>', which ordinarily
causes usage and option help information to be output to <code>stdout</code>
and <code>exit (0)</code>.
<!-- argp.h -->
<!-- GNU -->
<br><dt><code>ARGP_NO_EXIT</code><a name="index-ARGP_005fNO_005fEXIT-3071"></a><dd>Don't exit on errors, although they may still result in error messages.
<!-- argp.h -->
<!-- GNU -->
<br><dt><code>ARGP_LONG_ONLY</code><a name="index-ARGP_005fLONG_005fONLY-3072"></a><dd>Use the gnu getopt `long-only' rules for parsing arguments. This allows
long-options to be recognized with only a single `<samp><span class="samp">-</span></samp>'
(i.e., `<samp><span class="samp">-help</span></samp>'). This results in a less useful interface, and its
use is discouraged as it conflicts with the way most GNU programs work
as well as the GNU coding standards.
<!-- argp.h -->
<!-- GNU -->
<br><dt><code>ARGP_SILENT</code><a name="index-ARGP_005fSILENT-3073"></a><dd>Turns off any message-printing/exiting options, specifically
<code>ARGP_NO_EXIT</code>, <code>ARGP_NO_ERRS</code>, and <code>ARGP_NO_HELP</code>.
</dl>
</body></html>