Fossil SCM

Remove the "commands" command and replace it with --all, --aux, and --test options to the "help" command.

drh 2011-11-04 17:59 trunk
Commit d6a93abf2c967ab57a7ec8e3432ff78724208f0f
1 file changed +18 -29
+18 -29
--- src/main.c
+++ src/main.c
@@ -709,35 +709,10 @@
709709
if( zPrefix && memcmp(zPrefix, z, nPrefix)!=0 ) continue;
710710
aCmd[nCmd++] = aCommand[i].zName;
711711
}
712712
multi_column_list(aCmd, nCmd);
713713
}
714
-
715
-/*
716
-** COMMAND: commands
717
-**
718
-** Usage: %fossil commands ?--test? ?--all? ?--aux?
719
-**
720
-** List available commands. If the --test option is used list only unsupported
721
-** commands intended for testing and debugging. With --all, show all commands
722
-** including test debugging commands. With --aux, show only the auxiliary
723
-** and less often used commands, and/or command aliases.
724
-*/
725
-void cmd_command_list(void){
726
- int cmdFlags = CMDFLAG_1ST_TIER | CMDFLAG_2ND_TIER;
727
- if( find_option("all",0,0)!=0 ){
728
- cmdFlags |= CMDFLAG_TEST;
729
- }else if( find_option("test",0,0)!=0 ){
730
- cmdFlags = CMDFLAG_TEST;
731
- }else if( find_option("aux",0,0)!=0 ){
732
- cmdFlags = CMDFLAG_2ND_TIER;
733
- }else{
734
- fossil_print("Use --test or --all to see test and debug commands.\n");
735
- }
736
- command_list(0, cmdFlags);
737
-}
738
-
739714
740715
/*
741716
** COMMAND: test-list-webpage
742717
**
743718
** List all web pages
@@ -748,11 +723,10 @@
748723
for(i=nCmd=0; i<count(aWebpage); i++){
749724
aCmd[nCmd++] = aWebpage[i].zName;
750725
}
751726
multi_column_list(aCmd, nCmd);
752727
}
753
-
754728
755729
/*
756730
** COMMAND: version
757731
**
758732
** Usage: %fossil version
@@ -770,26 +744,41 @@
770744
**
771745
** Usage: %fossil help COMMAND
772746
** or: %fossil COMMAND -help
773747
**
774748
** Display information on how to use COMMAND. To display a list of
775
-** available commands use:
749
+** available commands one of:
776750
**
777
-** %fossil commands
751
+** %fossil help Show common commands
752
+** %fossil help --all Show both command and auxiliary commands
753
+** %fossil help --test Show test commands only
754
+** %fossil help --aux Show auxiliary commands only
778755
*/
779756
void help_cmd(void){
780757
int rc, idx;
781758
const char *z;
782759
if( g.argc<3 ){
783760
z = fossil_nameofexe();
784761
fossil_print(
785762
"Usage: %s help COMMAND\n"
786
- "Common COMMANDs: (use \"%s commands\" for a complete list)\n",
763
+ "Common COMMANDs: (use \"%s help --all\" for a complete list)\n",
787764
z, z);
788765
command_list(0, CMDFLAG_1ST_TIER);
789766
version_cmd();
790767
return;
768
+ }
769
+ if( find_option("all",0,0) ){
770
+ command_list(0, CMDFLAG_1ST_TIER | CMDFLAG_2ND_TIER);
771
+ return;
772
+ }
773
+ if( find_option("aux",0,0) ){
774
+ command_list(0, CMDFLAG_2ND_TIER);
775
+ return;
776
+ }
777
+ if( find_option("test",0,0) ){
778
+ command_list(0, CMDFLAG_TEST);
779
+ return;
791780
}
792781
rc = name_search(g.argv[2], aCommand, count(aCommand), &idx);
793782
if( rc==1 ){
794783
fossil_print("unknown command: %s\nAvailable commands:\n", g.argv[2]);
795784
command_list(0, 0xff);
796785
--- src/main.c
+++ src/main.c
@@ -709,35 +709,10 @@
709 if( zPrefix && memcmp(zPrefix, z, nPrefix)!=0 ) continue;
710 aCmd[nCmd++] = aCommand[i].zName;
711 }
712 multi_column_list(aCmd, nCmd);
713 }
714
715 /*
716 ** COMMAND: commands
717 **
718 ** Usage: %fossil commands ?--test? ?--all? ?--aux?
719 **
720 ** List available commands. If the --test option is used list only unsupported
721 ** commands intended for testing and debugging. With --all, show all commands
722 ** including test debugging commands. With --aux, show only the auxiliary
723 ** and less often used commands, and/or command aliases.
724 */
725 void cmd_command_list(void){
726 int cmdFlags = CMDFLAG_1ST_TIER | CMDFLAG_2ND_TIER;
727 if( find_option("all",0,0)!=0 ){
728 cmdFlags |= CMDFLAG_TEST;
729 }else if( find_option("test",0,0)!=0 ){
730 cmdFlags = CMDFLAG_TEST;
731 }else if( find_option("aux",0,0)!=0 ){
732 cmdFlags = CMDFLAG_2ND_TIER;
733 }else{
734 fossil_print("Use --test or --all to see test and debug commands.\n");
735 }
736 command_list(0, cmdFlags);
737 }
738
739
740 /*
741 ** COMMAND: test-list-webpage
742 **
743 ** List all web pages
@@ -748,11 +723,10 @@
748 for(i=nCmd=0; i<count(aWebpage); i++){
749 aCmd[nCmd++] = aWebpage[i].zName;
750 }
751 multi_column_list(aCmd, nCmd);
752 }
753
754
755 /*
756 ** COMMAND: version
757 **
758 ** Usage: %fossil version
@@ -770,26 +744,41 @@
770 **
771 ** Usage: %fossil help COMMAND
772 ** or: %fossil COMMAND -help
773 **
774 ** Display information on how to use COMMAND. To display a list of
775 ** available commands use:
776 **
777 ** %fossil commands
 
 
 
778 */
779 void help_cmd(void){
780 int rc, idx;
781 const char *z;
782 if( g.argc<3 ){
783 z = fossil_nameofexe();
784 fossil_print(
785 "Usage: %s help COMMAND\n"
786 "Common COMMANDs: (use \"%s commands\" for a complete list)\n",
787 z, z);
788 command_list(0, CMDFLAG_1ST_TIER);
789 version_cmd();
790 return;
 
 
 
 
 
 
 
 
 
 
 
 
791 }
792 rc = name_search(g.argv[2], aCommand, count(aCommand), &idx);
793 if( rc==1 ){
794 fossil_print("unknown command: %s\nAvailable commands:\n", g.argv[2]);
795 command_list(0, 0xff);
796
--- src/main.c
+++ src/main.c
@@ -709,35 +709,10 @@
709 if( zPrefix && memcmp(zPrefix, z, nPrefix)!=0 ) continue;
710 aCmd[nCmd++] = aCommand[i].zName;
711 }
712 multi_column_list(aCmd, nCmd);
713 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
714
715 /*
716 ** COMMAND: test-list-webpage
717 **
718 ** List all web pages
@@ -748,11 +723,10 @@
723 for(i=nCmd=0; i<count(aWebpage); i++){
724 aCmd[nCmd++] = aWebpage[i].zName;
725 }
726 multi_column_list(aCmd, nCmd);
727 }
 
728
729 /*
730 ** COMMAND: version
731 **
732 ** Usage: %fossil version
@@ -770,26 +744,41 @@
744 **
745 ** Usage: %fossil help COMMAND
746 ** or: %fossil COMMAND -help
747 **
748 ** Display information on how to use COMMAND. To display a list of
749 ** available commands one of:
750 **
751 ** %fossil help Show common commands
752 ** %fossil help --all Show both command and auxiliary commands
753 ** %fossil help --test Show test commands only
754 ** %fossil help --aux Show auxiliary commands only
755 */
756 void help_cmd(void){
757 int rc, idx;
758 const char *z;
759 if( g.argc<3 ){
760 z = fossil_nameofexe();
761 fossil_print(
762 "Usage: %s help COMMAND\n"
763 "Common COMMANDs: (use \"%s help --all\" for a complete list)\n",
764 z, z);
765 command_list(0, CMDFLAG_1ST_TIER);
766 version_cmd();
767 return;
768 }
769 if( find_option("all",0,0) ){
770 command_list(0, CMDFLAG_1ST_TIER | CMDFLAG_2ND_TIER);
771 return;
772 }
773 if( find_option("aux",0,0) ){
774 command_list(0, CMDFLAG_2ND_TIER);
775 return;
776 }
777 if( find_option("test",0,0) ){
778 command_list(0, CMDFLAG_TEST);
779 return;
780 }
781 rc = name_search(g.argv[2], aCommand, count(aCommand), &idx);
782 if( rc==1 ){
783 fossil_print("unknown command: %s\nAvailable commands:\n", g.argv[2]);
784 command_list(0, 0xff);
785

Keyboard Shortcuts

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