Fossil SCM
Added basic implementation of RFE ticket [3a2a26513220342]: -verbose option for the "version" command.
Commit
1be15a57f1a64478aabd54019f97db5ba1e85a73
Parent
0d55a0ad0fc44da…
1 file changed
+26
-1
+26
-1
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -742,17 +742,42 @@ | ||
| 742 | 742 | } |
| 743 | 743 | |
| 744 | 744 | /* |
| 745 | 745 | ** COMMAND: version |
| 746 | 746 | ** |
| 747 | -** Usage: %fossil version | |
| 747 | +** Usage: %fossil version ?-verbose|-v? | |
| 748 | 748 | ** |
| 749 | 749 | ** Print the source code version number for the fossil executable. |
| 750 | +** If the verbose option is specified, additional details will | |
| 751 | +** be output about what optional features this binary was compiled | |
| 752 | +** with | |
| 750 | 753 | */ |
| 751 | 754 | void version_cmd(void){ |
| 752 | 755 | fossil_print("This is fossil version " RELEASE_VERSION " " |
| 753 | 756 | MANIFEST_VERSION " " MANIFEST_DATE " UTC\n"); |
| 757 | + if(!find_option("verbose","v",0)){ | |
| 758 | + return; | |
| 759 | + }else{ | |
| 760 | + fossil_print("Compiled with the following features enabled:\n", | |
| 761 | + COMPILER_NAME); | |
| 762 | + int count = 0; | |
| 763 | +#if defined(FOSSIL_ENABLE_SSL) | |
| 764 | + ++count; | |
| 765 | + fossil_print("\tSSL\n"); | |
| 766 | +#endif | |
| 767 | +#if defined(FOSSIL_ENABLE_TCL) | |
| 768 | + ++count; | |
| 769 | + fossil_print("\tTCL\n"); | |
| 770 | +#endif | |
| 771 | +#if defined(FOSSIL_ENABLE_JSON) | |
| 772 | + ++count; | |
| 773 | + fossil_print("\tJSON\n"); | |
| 774 | +#endif | |
| 775 | + if(!count){ | |
| 776 | + fossil_print("\tno optional features enabled.\n"); | |
| 777 | + } | |
| 778 | + } | |
| 754 | 779 | } |
| 755 | 780 | |
| 756 | 781 | |
| 757 | 782 | /* |
| 758 | 783 | ** COMMAND: help |
| 759 | 784 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -742,17 +742,42 @@ | |
| 742 | } |
| 743 | |
| 744 | /* |
| 745 | ** COMMAND: version |
| 746 | ** |
| 747 | ** Usage: %fossil version |
| 748 | ** |
| 749 | ** Print the source code version number for the fossil executable. |
| 750 | */ |
| 751 | void version_cmd(void){ |
| 752 | fossil_print("This is fossil version " RELEASE_VERSION " " |
| 753 | MANIFEST_VERSION " " MANIFEST_DATE " UTC\n"); |
| 754 | } |
| 755 | |
| 756 | |
| 757 | /* |
| 758 | ** COMMAND: help |
| 759 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -742,17 +742,42 @@ | |
| 742 | } |
| 743 | |
| 744 | /* |
| 745 | ** COMMAND: version |
| 746 | ** |
| 747 | ** Usage: %fossil version ?-verbose|-v? |
| 748 | ** |
| 749 | ** Print the source code version number for the fossil executable. |
| 750 | ** If the verbose option is specified, additional details will |
| 751 | ** be output about what optional features this binary was compiled |
| 752 | ** with |
| 753 | */ |
| 754 | void version_cmd(void){ |
| 755 | fossil_print("This is fossil version " RELEASE_VERSION " " |
| 756 | MANIFEST_VERSION " " MANIFEST_DATE " UTC\n"); |
| 757 | if(!find_option("verbose","v",0)){ |
| 758 | return; |
| 759 | }else{ |
| 760 | fossil_print("Compiled with the following features enabled:\n", |
| 761 | COMPILER_NAME); |
| 762 | int count = 0; |
| 763 | #if defined(FOSSIL_ENABLE_SSL) |
| 764 | ++count; |
| 765 | fossil_print("\tSSL\n"); |
| 766 | #endif |
| 767 | #if defined(FOSSIL_ENABLE_TCL) |
| 768 | ++count; |
| 769 | fossil_print("\tTCL\n"); |
| 770 | #endif |
| 771 | #if defined(FOSSIL_ENABLE_JSON) |
| 772 | ++count; |
| 773 | fossil_print("\tJSON\n"); |
| 774 | #endif |
| 775 | if(!count){ |
| 776 | fossil_print("\tno optional features enabled.\n"); |
| 777 | } |
| 778 | } |
| 779 | } |
| 780 | |
| 781 | |
| 782 | /* |
| 783 | ** COMMAND: help |
| 784 |