Fossil SCM

The "fossil help -o" command shows command-line options that are common to all commands.

drh 2018-10-06 14:14 trunk
Commit 50eb6bd569ed754eb382a930fa0241300ffaef702cd6c9a50a98a1fb1db29737
2 files changed +32 -1 -4
+32 -1
--- src/dispatch.c
+++ src/dispatch.c
@@ -489,10 +489,36 @@
489489
if( zPrefix && memcmp(zPrefix, z, nPrefix)!=0 ) continue;
490490
aCmd[nCmd++] = aCommand[i].zName;
491491
}
492492
multi_column_list(aCmd, nCmd);
493493
}
494
+
495
+/*
496
+** Documentation on universal command-line options.
497
+*/
498
+/* @-comment: # */
499
+static const char zOptions[] =
500
+@ Command-line options common to all commands:
501
+@
502
+@ --args FILENAME Read additional arguments and options from FILENAME
503
+@ --cgitrace Active CGI tracing
504
+@ --comfmtflags VALUE Set comment formatting flags to VALUE
505
+@ --errorlog FILENAME Log errors to FILENAME
506
+@ --help Show help on the command rather than running it
507
+@ --httptrace Trace outbound HTTP requests
508
+@ --localtime Display times using the local timezone
509
+@ --no-th-hook Do not run TH1 hooks
510
+@ --quiet Reduce the amount of output
511
+@ --sqlstats Show SQL usage statistics when done
512
+@ --sqltrace Trace all SQL commands
513
+@ --sshtrace Trace SSH activity
514
+@ --ssl-identity NAME Set the SSL identity to NAME
515
+@ --systemtrace Trace calls to system()
516
+@ --user|-U USER Make the default user be USER
517
+@ --utc Display times using UTC
518
+@ --vfs NAME Cause SQLite to use the NAME VFS
519
+;
494520
495521
/*
496522
** COMMAND: help
497523
**
498524
** Usage: %fossil help TOPIC
@@ -502,10 +528,11 @@
502528
** setting. Webpage names begin with "/". To display a list of available
503529
** topics, use one of:
504530
**
505531
** %fossil help Show common commands
506532
** %fossil help -a|--all Show both common and auxiliary commands
533
+** %fossil help -o|--options Show command-line options common to all cmds
507534
** %fossil help -s|--setting Show setting names
508535
** %fossil help -t|--test Show test commands only
509536
** %fossil help -x|--aux Show auxiliary commands only
510537
** %fossil help -w|--www Show list of webpages
511538
*/
@@ -518,15 +545,19 @@
518545
const CmdOrPage *pCmd = 0;
519546
if( g.argc<3 ){
520547
z = g.argv[0];
521548
fossil_print(
522549
"Usage: %s help TOPIC\n"
523
- "Common commands: (use \"%s help -a|--all\" for a complete list)\n",
550
+ "Common commands: (use \"%s help help\" for more options)\n",
524551
z, z);
525552
command_list(0, CMDFLAG_1ST_TIER);
526553
version_cmd();
527554
return;
555
+ }
556
+ if( find_option("options","o",0) ){
557
+ fossil_print("%s", zOptions);
558
+ return;
528559
}
529560
if( find_option("all","a",0) ){
530561
command_list(0, CMDFLAG_1ST_TIER | CMDFLAG_2ND_TIER);
531562
return;
532563
}
533564
--- src/dispatch.c
+++ src/dispatch.c
@@ -489,10 +489,36 @@
489 if( zPrefix && memcmp(zPrefix, z, nPrefix)!=0 ) continue;
490 aCmd[nCmd++] = aCommand[i].zName;
491 }
492 multi_column_list(aCmd, nCmd);
493 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
494
495 /*
496 ** COMMAND: help
497 **
498 ** Usage: %fossil help TOPIC
@@ -502,10 +528,11 @@
502 ** setting. Webpage names begin with "/". To display a list of available
503 ** topics, use one of:
504 **
505 ** %fossil help Show common commands
506 ** %fossil help -a|--all Show both common and auxiliary commands
 
507 ** %fossil help -s|--setting Show setting names
508 ** %fossil help -t|--test Show test commands only
509 ** %fossil help -x|--aux Show auxiliary commands only
510 ** %fossil help -w|--www Show list of webpages
511 */
@@ -518,15 +545,19 @@
518 const CmdOrPage *pCmd = 0;
519 if( g.argc<3 ){
520 z = g.argv[0];
521 fossil_print(
522 "Usage: %s help TOPIC\n"
523 "Common commands: (use \"%s help -a|--all\" for a complete list)\n",
524 z, z);
525 command_list(0, CMDFLAG_1ST_TIER);
526 version_cmd();
527 return;
 
 
 
 
528 }
529 if( find_option("all","a",0) ){
530 command_list(0, CMDFLAG_1ST_TIER | CMDFLAG_2ND_TIER);
531 return;
532 }
533
--- src/dispatch.c
+++ src/dispatch.c
@@ -489,10 +489,36 @@
489 if( zPrefix && memcmp(zPrefix, z, nPrefix)!=0 ) continue;
490 aCmd[nCmd++] = aCommand[i].zName;
491 }
492 multi_column_list(aCmd, nCmd);
493 }
494
495 /*
496 ** Documentation on universal command-line options.
497 */
498 /* @-comment: # */
499 static const char zOptions[] =
500 @ Command-line options common to all commands:
501 @
502 @ --args FILENAME Read additional arguments and options from FILENAME
503 @ --cgitrace Active CGI tracing
504 @ --comfmtflags VALUE Set comment formatting flags to VALUE
505 @ --errorlog FILENAME Log errors to FILENAME
506 @ --help Show help on the command rather than running it
507 @ --httptrace Trace outbound HTTP requests
508 @ --localtime Display times using the local timezone
509 @ --no-th-hook Do not run TH1 hooks
510 @ --quiet Reduce the amount of output
511 @ --sqlstats Show SQL usage statistics when done
512 @ --sqltrace Trace all SQL commands
513 @ --sshtrace Trace SSH activity
514 @ --ssl-identity NAME Set the SSL identity to NAME
515 @ --systemtrace Trace calls to system()
516 @ --user|-U USER Make the default user be USER
517 @ --utc Display times using UTC
518 @ --vfs NAME Cause SQLite to use the NAME VFS
519 ;
520
521 /*
522 ** COMMAND: help
523 **
524 ** Usage: %fossil help TOPIC
@@ -502,10 +528,11 @@
528 ** setting. Webpage names begin with "/". To display a list of available
529 ** topics, use one of:
530 **
531 ** %fossil help Show common commands
532 ** %fossil help -a|--all Show both common and auxiliary commands
533 ** %fossil help -o|--options Show command-line options common to all cmds
534 ** %fossil help -s|--setting Show setting names
535 ** %fossil help -t|--test Show test commands only
536 ** %fossil help -x|--aux Show auxiliary commands only
537 ** %fossil help -w|--www Show list of webpages
538 */
@@ -518,15 +545,19 @@
545 const CmdOrPage *pCmd = 0;
546 if( g.argc<3 ){
547 z = g.argv[0];
548 fossil_print(
549 "Usage: %s help TOPIC\n"
550 "Common commands: (use \"%s help help\" for more options)\n",
551 z, z);
552 command_list(0, CMDFLAG_1ST_TIER);
553 version_cmd();
554 return;
555 }
556 if( find_option("options","o",0) ){
557 fossil_print("%s", zOptions);
558 return;
559 }
560 if( find_option("all","a",0) ){
561 command_list(0, CMDFLAG_1ST_TIER | CMDFLAG_2ND_TIER);
562 return;
563 }
564
-4
--- src/main.c
+++ src/main.c
@@ -972,14 +972,10 @@
972972
g.argv[i]);
973973
}
974974
}
975975
}
976976
977
-/*
978
-** Print a list of words in multiple columns.
979
-*/
980
-
981977
982978
/*
983979
** This function returns a human readable version string.
984980
*/
985981
const char *get_version(){
986982
--- src/main.c
+++ src/main.c
@@ -972,14 +972,10 @@
972 g.argv[i]);
973 }
974 }
975 }
976
977 /*
978 ** Print a list of words in multiple columns.
979 */
980
981
982 /*
983 ** This function returns a human readable version string.
984 */
985 const char *get_version(){
986
--- src/main.c
+++ src/main.c
@@ -972,14 +972,10 @@
972 g.argv[i]);
973 }
974 }
975 }
976
 
 
 
 
977
978 /*
979 ** This function returns a human readable version string.
980 */
981 const char *get_version(){
982

Keyboard Shortcuts

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