Changeset b14d9f9 in mainline for uspace/app/bdsh/cmds/modules/mount/mount.c
- Timestamp:
- 2017-05-05T17:37:36Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 951f6b9e
- Parents:
- 75b24cd
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/cmds/modules/mount/mount.c
r75b24cd rb14d9f9 49 49 { "help", no_argument, 0, 'h' }, 50 50 { "instance", required_argument, 0, 'i' }, 51 { "types", no_argument, 0, 't' }, 51 52 { 0, 0, 0, 0 } 52 53 }; … … 57 58 { 58 59 static char helpfmt[] = 59 "Usage: %s <fstype> <mp> [dev] [<moptions>]\n"; 60 "Usage: %s <fstype> <mp> [dev] [<moptions>]\n" 61 "Options:\n" 62 " -h, --help A short option summary\n" 63 " -i, --instance ## Mount a specific instance\n" 64 " -t, --types List available file system types\n"; 65 60 66 if (level == HELP_SHORT) { 61 67 printf("'%s' mounts a file system.\n", cmdname); … … 101 107 } 102 108 109 static void print_fstypes(void) 110 { 111 int rc; 112 vfs_fstypes_t fstypes; 113 char **p; 114 115 rc = vfs_fstypes(&fstypes); 116 if (rc != EOK) { 117 printf("Error getting list of available file system types.\n"); 118 return; 119 } 120 121 printf("Available file system types:\n"); 122 p = fstypes.fstypes; 123 while (*p != NULL) 124 printf("\t%s\n", *p++); 125 vfs_fstypes_free(&fstypes); 126 } 127 103 128 /* Main entry point for mount, accepts an array of arguments */ 104 129 int cmd_mount(char **argv) … … 115 140 116 141 for (c = 0, optreset = 1, optind = 0, opt_ind = 0; c != -1;) { 117 c = getopt_long(argc, argv, "i:h ", long_options, &opt_ind);142 c = getopt_long(argc, argv, "i:ht", long_options, &opt_ind); 118 143 switch (c) { 119 144 case 'h': … … 124 149 instance_set = true; 125 150 break; 151 case 't': 152 print_fstypes(); 153 return CMD_SUCCESS; 126 154 } 127 155 } … … 151 179 printf("Unable to mount %s filesystem to %s on %s (rc=%s)\n", 152 180 t_argv[2], t_argv[1], t_argv[3], str_error(rc)); 181 if (rc == ENOFS) 182 print_fstypes(); 153 183 return CMD_FAILURE; 154 184 }
Note:
See TracChangeset
for help on using the changeset viewer.