[mw-devel] [Git][arthur/mw][master] Add prefixes to commands in the help listings

Andrew Price welshbyte at sucs.org
Fri Sep 30 21:24:55 BST 2016


Andrew Price pushed to branch master at Justin Mitchell / mw


Commits:
e7a0999b by Andrew Price at 2016-09-30T21:23:26+01:00
Add prefixes to commands in the help listings

- - - - -


4 changed files:

- src/client/Parse.c
- src/client/Parse.h
- src/client/newmain.c
- src/client/talker.c


Changes:

=====================================
src/client/Parse.c
=====================================
--- a/src/client/Parse.c
+++ b/src/client/Parse.c
@@ -291,7 +291,7 @@ int command_compare(const char *input, const char *comm)
 	return(c);
 }
 
-void help_list(CommandList *c, unsigned int hidestuff)
+void help_list(CommandList *c, unsigned int hidestuff, const char * const prefix)
 {
 	char		buff[10];
 	int		count;
@@ -306,12 +306,12 @@ void help_list(CommandList *c, unsigned int hidestuff)
 		{
 			if (!hidestuff)
 			{
-				printf("%20s - %s\n",c->Command,c->Desc);
+				printf("%8s%-12s - %s\n", prefix, c->Command, c->Desc);
 				count++;
 			}
 			else if (c->Show == 1)
 			{
-				printf("%20s - %s\n",c->Command,c->Desc);
+				printf("%8s%-12s - %s\n", prefix, c->Command, c->Desc);
 				count++;
 			}
 		}


=====================================
src/client/Parse.h
=====================================
--- a/src/client/Parse.h
+++ b/src/client/Parse.h
@@ -90,7 +90,7 @@ extern void c_version(CommandList *cm, int argc, const char **argv, char *args);
 extern void c_alias(CommandList *cm, int argc, const char **argv, char *args);
 extern void c_unalias(CommandList *cm, int argc, const char **argv, char *args);
 
-void help_list(CommandList *c, unsigned int hidestuff);
+void help_list(CommandList *c, unsigned int hidestuff, const char * const prefix);
 char *remove_first_word(char *args);
 
 #endif


=====================================
src/client/newmain.c
=====================================
--- a/src/client/newmain.c
+++ b/src/client/newmain.c
@@ -45,7 +45,6 @@ extern int busy; /* if true dont display messages  i.e. during new/write */
 extern unsigned long rights;
 extern struct user * const user;
 extern CommandList table[];
-extern void help_list(CommandList *cm, unsigned int hidestuff);
 
 static void help(const char *topic, int wiz)
 {
@@ -123,7 +122,7 @@ void c_help(CommandList *cm, int argc, const char **argv, char *args)
 	if (argc>1)
 		help(argv[1], u_god(user));
 	else
-		help_list(table, 1);
+		help_list(table, 1, CMD_BOARD_STR);
 }
 
 void c_cd(CommandList *cm, int argc, const char **argv, char *args)


=====================================
src/client/talker.c
=====================================
--- a/src/client/talker.c
+++ b/src/client/talker.c
@@ -1264,7 +1264,7 @@ void t_help(CommandList *cm, int argc, const char **argv, char *args)
 
 	if (argc < 2)
 	{
-		help_list(chattable, 1);
+		help_list(chattable, 1, CMD_TALK_STR);
 		return;
 	}
 
@@ -1411,4 +1411,4 @@ int ChangeRoom(char *room, int quiet)
 	}
 
 	return(0);
-}
\ No newline at end of file
+}



View it on GitLab: https://projects.sucs.org/arthur/mw/commit/e7a0999b2ab2052e7de25145b84ac143d12b13c6
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sucs.org/pipermail/mw-devel/attachments/20160930/159b44f6/attachment-0001.html>


More information about the mw-devel mailing list