Changeset e6cb880 in mainline


Ignore:
Timestamp:
2011-02-27T22:19:22Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
128b8ee, 3f7efa79
Parents:
05155a1
git-author:
Maurizio Lombardi <m.lombardi85@…> (2011-02-27 22:19:22)
git-committer:
Jakub Jermar <jakub@…> (2011-02-27 22:19:22)
Message:

The "mount" command does not display any help message about required parameters.
(Thanks to Maurizio Lombardi.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/cmds/modules/mount/mount.c

    r05155a1 re6cb880  
    3131#include <vfs/vfs.h>
    3232#include <errno.h>
     33#include <getopt.h>
    3334#include "config.h"
    3435#include "util.h"
     
    4041static const char *cmdname = "mount";
    4142
    42 /* Dispays help for mount in various levels */
     43static struct option const long_options[] = {
     44        { "help", no_argument, 0, 'h' },
     45        { 0, 0, 0, 0 }
     46};
     47
     48
     49/* Displays help for mount in various levels */
    4350void help_cmd_mount(unsigned int level)
    4451{
     
    5966        unsigned int argc;
    6067        const char *mopts = "";
    61         int rc;
     68        int rc, c, opt_ind;
    6269
    6370        argc = cli_count_args(argv);
    6471
     72        for (c = 0, optind = 0, opt_ind = 0; c != -1;) {
     73                c = getopt_long(argc, argv, "h", long_options, &opt_ind);
     74                switch (c) {
     75                case 'h':
     76                        help_cmd_mount(HELP_LONG);
     77                        return CMD_SUCCESS;
     78                }
     79        }
     80
    6581        if ((argc < 4) || (argc > 5)) {
    66                 printf("%s: invalid number of arguments.\n",
     82                printf("%s: invalid number of arguments. Try `mount --help'\n",
    6783                    cmdname);
    6884                return CMD_FAILURE;
Note: See TracChangeset for help on using the changeset viewer.