From 9f4bc95bd406adecf8803b455cb20e79f3cccadb Mon Sep 17 00:00:00 2001 From: pixel Date: Sun, 12 Oct 2003 13:51:09 +0000 Subject: Some minor fixes and improvements --- cd-tool.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'cd-tool.cpp') 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 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::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(); -- cgit v1.2.3