Commit e7a0999b authored by Andrew Price's avatar Andrew Price
Browse files

Add prefixes to commands in the help listings

parent 03091bbd
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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++;
			}
		}
+1 −1
Original line number Diff line number Diff line
@@ -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
+1 −2
Original line number Diff line number Diff line
@@ -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)
+2 −2
Original line number Diff line number Diff line
@@ -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;
	}