Subversion Repositories HelenOS

Rev

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

Rev 3386 Rev 4153
Line 67... Line 67...
67
    }
67
    }
68
 
68
 
69
    return HELP_IS_RUBBISH;
69
    return HELP_IS_RUBBISH;
70
}
70
}
71
 
71
 
72
void *help_cmd_help(unsigned int level)
72
void help_cmd_help(unsigned int level)
73
{
73
{
74
    if (level == HELP_SHORT) {
74
    if (level == HELP_SHORT) {
75
        printf(
75
        printf(
76
        "\n  %s [command] <extended>\n"
76
        "\n  %s [command] <extended>\n"
77
        "  Use help [command] extended for detailed help on [command] "
77
        "  Use help [command] extended for detailed help on [command] "
Line 84... Line 84...
84
        "   %s [command] extended  Show extended help for [command]\n"
84
        "   %s [command] extended  Show extended help for [command]\n"
85
        "\n  If no argument is given to %s, a list of commands are shown\n\n",
85
        "\n  If no argument is given to %s, a list of commands are shown\n\n",
86
        cmdname, cmdname, cmdname, cmdname);
86
        cmdname, cmdname, cmdname, cmdname);
87
    }
87
    }
88
 
88
 
89
    return CMD_VOID;
89
    return;
90
}
90
}
91
 
91
 
92
int *cmd_help(char *argv[])
92
int cmd_help(char *argv[])
93
{
93
{
94
    module_t *mod;
94
    module_t *mod;
95
    builtin_t *cmd;
95
    builtin_t *cmd;
96
    unsigned int i = 0;
96
    unsigned int i = 0;
97
    int rc = 0;
97
    int rc = 0;
Line 131... Line 131...
131
    printf("\n  Available commands are:\n");
131
    printf("\n  Available commands are:\n");
132
    printf("  ------------------------------------------------------------\n");
132
    printf("  ------------------------------------------------------------\n");
133
 
133
 
134
    /* First, show a list of built in commands that are available in this mode */
134
    /* First, show a list of built in commands that are available in this mode */
135
    for (cmd = builtins; cmd->name != NULL; cmd++, i++) {
135
    for (cmd = builtins; cmd->name != NULL; cmd++, i++) {
136
        if (!builtin_is_restricted(i)) {
-
 
137
            if (is_builtin_alias(cmd->name))
136
            if (is_builtin_alias(cmd->name))
138
                printf("   %-16s\tAlias for `%s'\n", cmd->name,
137
                printf("   %-16s\tAlias for `%s'\n", cmd->name,
139
                    alias_for_builtin(cmd->name));
138
                    alias_for_builtin(cmd->name));
140
            else
139
            else
141
                printf("   %-16s\t%s\n", cmd->name, cmd->desc);
140
                printf("   %-16s\t%s\n", cmd->name, cmd->desc);
142
        }
-
 
143
    }
141
    }
144
 
142
 
145
    i = 0;
143
    i = 0;
146
 
144
 
147
    /* Now, show a list of module commands that are available in this mode */
145
    /* Now, show a list of module commands that are available in this mode */
148
    for (mod = modules; mod->name != NULL; mod++, i++) {
146
    for (mod = modules; mod->name != NULL; mod++, i++) {
149
        if (!module_is_restricted(i)) {
-
 
150
            if (is_module_alias(mod->name))
147
            if (is_module_alias(mod->name))
151
                printf("   %-16s\tAlias for `%s'\n", mod->name,
148
                printf("   %-16s\tAlias for `%s'\n", mod->name,
152
                    alias_for_module(mod->name));
149
                    alias_for_module(mod->name));
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
        }
-
 
156
    }
152
    }
157
 
153
 
158
    printf("\n  Try %s %s for more information on how `%s' works.\n\n",
154
    printf("\n  Try %s %s for more information on how `%s' works.\n\n",
159
        cmdname, cmdname, cmdname);
155
        cmdname, cmdname, cmdname);
160
 
156