static int c_option;
static int d_option;
static int f_option;
+static int F_option;
static int n_option;
static int q_option;
static int r_option;
" -d, --default display default device\n"
" -a, --auto turn auto-eject feature on or off\n"
" -c, --changerslot switch discs on a CD-ROM changer\n"
+ " -F, --force don't care about device type\n"
" -i, --manualeject <on|off> toggle manual eject protection on/off\n"
" -t, --trayclose close tray\n"
" -T, --traytoggle toggle tray\n"
{"verbose", no_argument, NULL, 'v'},
{"default", no_argument, NULL, 'd'},
{"auto", required_argument, NULL, 'a'},
+ {"force", no_argument, NULL, 'F'},
{"changerslot", required_argument, NULL, 'c'},
{"manualeject", required_argument, NULL, 'i'},
{"trayclose", no_argument, NULL, 't'},
int c;
while ((c = getopt_long(argc, argv,
- "a:c:i:x:dfhnqrstTXvVpm", long_opts, NULL)) != -1) {
+ "a:c:i:x:dfFhnqrstTXvVpm", long_opts, NULL)) != -1) {
switch (c) {
case 'a':
a_option = 1;
case 'f':
f_option = 1;
break;
+ case 'F':
+ F_option = 1;
+ break;
case 'h':
usage(stdout);
break;
} else
verbose(_("%s: is whole-disk device"), device);
- if (!is_hotpluggable(device))
+ if (F_option == 0 && is_hotpluggable(device) == 0)
errx(EXIT_FAILURE, _("%s: is not hot-pluggable device"), device);
/* handle -n option */