summaryrefslogtreecommitdiff
path: root/cd-tool.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cd-tool.cpp')
-rw-r--r--cd-tool.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/cd-tool.cpp b/cd-tool.cpp
index d5d766b..e828233 100644
--- a/cd-tool.cpp
+++ b/cd-tool.cpp
@@ -74,6 +74,22 @@ void showhelp(void) {
"\n", argv[0]);
}
+void probe(void) {
+ std::vector<String> p;
+
+ if (!cdabstract::canprobe()) {
+ printm(M_ERROR, "Can't probe on this platform.\n");
+ exit(-1);
+ }
+
+ p = cdabstract::probe();
+
+ printm(M_BARE, "Alvaible devices:\n");
+ for (std::vector<String>::iterator i = p.begin(); i != p.end(); i++) {
+ printm(M_BARE, *i + "\n");
+ }
+}
+
virtual int startup() throw (GeneralException) {
int type = GUESS, c, size, force = 0, sector;
char * ppf = 0, * iso_name = 0, * arg1 = 0, * arg2 = 0, * f;
@@ -106,6 +122,11 @@ virtual int startup() throw (GeneralException) {
}
iso_name = argv[optind++];
+
+ if (!strcmp(iso_name, "probe")) {
+ probe();
+ exit(-1);
+ }
if (argc == optind) {
showhelp();