Fossil SCM

Clarified a falsehood in the new verify_all_options() docs.

stephan 2019-10-03 15:19 double-dash-flag2
Commit 6edf8bcd9ab0784a48081be82f77cc50a4b49a57dab76682b777d7d4655cb637
1 file changed +6 -2
+6 -2
--- src/main.c
+++ src/main.c
@@ -1041,12 +1041,16 @@
10411041
** Exception: if "--" is encountered, it is consumed from the argument
10421042
** list and this function immediately returns. The effect is to treat
10431043
** all arguments after "--" as non-flags (conventionally used to
10441044
** enable passing-in of filenames which start with a dash).
10451045
**
1046
-** This function must only be called one time per app invokation.
1047
-** Calling it more than once results in undefined behaviour.
1046
+** This function must normally only be called one time per app
1047
+** invokation. The exception is commands which process their
1048
+** arguments, call this to confirm that there are no extraneous flags,
1049
+** then modify the arguments list for forwarding to another
1050
+** (sub)command (which itself will call this to confirm its own
1051
+** arguments).
10481052
*/
10491053
void verify_all_options(void){
10501054
int i;
10511055
for(i=1; i<g.argc; i++){
10521056
const char * arg = g.argv[i];
10531057
--- src/main.c
+++ src/main.c
@@ -1041,12 +1041,16 @@
1041 ** Exception: if "--" is encountered, it is consumed from the argument
1042 ** list and this function immediately returns. The effect is to treat
1043 ** all arguments after "--" as non-flags (conventionally used to
1044 ** enable passing-in of filenames which start with a dash).
1045 **
1046 ** This function must only be called one time per app invokation.
1047 ** Calling it more than once results in undefined behaviour.
 
 
 
 
1048 */
1049 void verify_all_options(void){
1050 int i;
1051 for(i=1; i<g.argc; i++){
1052 const char * arg = g.argv[i];
1053
--- src/main.c
+++ src/main.c
@@ -1041,12 +1041,16 @@
1041 ** Exception: if "--" is encountered, it is consumed from the argument
1042 ** list and this function immediately returns. The effect is to treat
1043 ** all arguments after "--" as non-flags (conventionally used to
1044 ** enable passing-in of filenames which start with a dash).
1045 **
1046 ** This function must normally only be called one time per app
1047 ** invokation. The exception is commands which process their
1048 ** arguments, call this to confirm that there are no extraneous flags,
1049 ** then modify the arguments list for forwarding to another
1050 ** (sub)command (which itself will call this to confirm its own
1051 ** arguments).
1052 */
1053 void verify_all_options(void){
1054 int i;
1055 for(i=1; i<g.argc; i++){
1056 const char * arg = g.argv[i];
1057

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button