Fossil SCM
The "fossil help -o" command shows command-line options that are common to all commands.
Commit
50eb6bd569ed754eb382a930fa0241300ffaef702cd6c9a50a98a1fb1db29737
Parent
a762ba1f7f3c39e…
2 files changed
+32
-1
-4
+32
-1
| --- src/dispatch.c | ||
| +++ src/dispatch.c | ||
| @@ -489,10 +489,36 @@ | ||
| 489 | 489 | if( zPrefix && memcmp(zPrefix, z, nPrefix)!=0 ) continue; |
| 490 | 490 | aCmd[nCmd++] = aCommand[i].zName; |
| 491 | 491 | } |
| 492 | 492 | multi_column_list(aCmd, nCmd); |
| 493 | 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 | +; | |
| 494 | 520 | |
| 495 | 521 | /* |
| 496 | 522 | ** COMMAND: help |
| 497 | 523 | ** |
| 498 | 524 | ** Usage: %fossil help TOPIC |
| @@ -502,10 +528,11 @@ | ||
| 502 | 528 | ** setting. Webpage names begin with "/". To display a list of available |
| 503 | 529 | ** topics, use one of: |
| 504 | 530 | ** |
| 505 | 531 | ** %fossil help Show common commands |
| 506 | 532 | ** %fossil help -a|--all Show both common and auxiliary commands |
| 533 | +** %fossil help -o|--options Show command-line options common to all cmds | |
| 507 | 534 | ** %fossil help -s|--setting Show setting names |
| 508 | 535 | ** %fossil help -t|--test Show test commands only |
| 509 | 536 | ** %fossil help -x|--aux Show auxiliary commands only |
| 510 | 537 | ** %fossil help -w|--www Show list of webpages |
| 511 | 538 | */ |
| @@ -518,15 +545,19 @@ | ||
| 518 | 545 | const CmdOrPage *pCmd = 0; |
| 519 | 546 | if( g.argc<3 ){ |
| 520 | 547 | z = g.argv[0]; |
| 521 | 548 | fossil_print( |
| 522 | 549 | "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", | |
| 524 | 551 | z, z); |
| 525 | 552 | command_list(0, CMDFLAG_1ST_TIER); |
| 526 | 553 | version_cmd(); |
| 527 | 554 | return; |
| 555 | + } | |
| 556 | + if( find_option("options","o",0) ){ | |
| 557 | + fossil_print("%s", zOptions); | |
| 558 | + return; | |
| 528 | 559 | } |
| 529 | 560 | if( find_option("all","a",0) ){ |
| 530 | 561 | command_list(0, CMDFLAG_1ST_TIER | CMDFLAG_2ND_TIER); |
| 531 | 562 | return; |
| 532 | 563 | } |
| 533 | 564 |
| --- 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 @@ | ||
| 972 | 972 | g.argv[i]); |
| 973 | 973 | } |
| 974 | 974 | } |
| 975 | 975 | } |
| 976 | 976 | |
| 977 | -/* | |
| 978 | -** Print a list of words in multiple columns. | |
| 979 | -*/ | |
| 980 | - | |
| 981 | 977 | |
| 982 | 978 | /* |
| 983 | 979 | ** This function returns a human readable version string. |
| 984 | 980 | */ |
| 985 | 981 | const char *get_version(){ |
| 986 | 982 |
| --- 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 |