Subversion Repositories HelenOS

Rev

Rev 3364 | Rev 3376 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3364 Rev 3366
Line 38... Line 38...
38
#include "builtins.h"
38
#include "builtins.h"
39
#include "errors.h"
39
#include "errors.h"
40
 
40
 
41
static char *cmdname = "help";
41
static char *cmdname = "help";
42
extern const char *progname;
42
extern const char *progname;
43
extern unsigned int cli_interactive;
-
 
44
 
43
 
45
#define HELP_IS_MODULE   1
44
#define HELP_IS_MODULE   1
46
#define HELP_IS_BUILTIN  0
45
#define HELP_IS_BUILTIN  0
47
#define HELP_IS_RUBBISH  -1
46
#define HELP_IS_RUBBISH  -1
48
 
47
 
Line 124... Line 123...
124
            help_builtin(mod_switch, level);
123
            help_builtin(mod_switch, level);
125
            return CMD_SUCCESS;
124
            return CMD_SUCCESS;
126
        }
125
        }
127
    }
126
    }
128
 
127
 
129
    printf("%sAvailable commands are:\n", cli_interactive ? "\n  " : "");
128
    printf("\n  Available commands are:\n");
130
    if (cli_interactive)
-
 
131
        printf(
-
 
132
            "  ------------------------------------------------------------\n");
129
    printf("  ------------------------------------------------------------\n");
133
 
130
 
134
    /* First, show a list of built in commands that are available in this mode */
131
    /* First, show a list of built in commands that are available in this mode */
135
    for (cmd = builtins; cmd->name != NULL; cmd++, i++) {
132
    for (cmd = builtins; cmd->name != NULL; cmd++, i++) {
136
        if (!builtin_is_restricted(i)) {
133
        if (!builtin_is_restricted(i)) {
137
            if (is_builtin_alias(cmd->name))
134
            if (is_builtin_alias(cmd->name))
Line 153... Line 150...
153
            else
150
            else
154
                printf("   %-16s\t%s\n", mod->name, mod->desc);
151
                printf("   %-16s\t%s\n", mod->name, mod->desc);
155
        }
152
        }
156
    }
153
    }
157
 
154
 
158
    /* Provide  a little more information and inform them of history / line
-
 
159
     * editing features if they are present */
-
 
160
    if (cli_interactive)
-
 
161
        printf("\n  Try %s %s for more information on how `%s' works.\n\n",
155
    printf("\n  Try %s %s for more information on how `%s' works.\n\n",
162
            cmdname, cmdname, cmdname);
156
        cmdname, cmdname, cmdname);
163
 
157
 
164
    return CMD_SUCCESS;
158
    return CMD_SUCCESS;
165
}
159
}