summaryrefslogtreecommitdiff
path: root/usr.bin/cdio/cdio.c
diff options
context:
space:
mode:
authorMichael Coulter <mjc@cvs.openbsd.org>2007-05-26 03:00:04 +0000
committerMichael Coulter <mjc@cvs.openbsd.org>2007-05-26 03:00:04 +0000
commit2fd3b69c813fcad97c53137d7edffb11552a9445 (patch)
treefda3068684911064b49ad5c1329be3803243f16b /usr.bin/cdio/cdio.c
parent6aa22d3abe9a72898e26f2ea75d631ec6d0271d6 (diff)
cdrip and cdplay commands from Alexey Vatchenko
incorporating some manpage suggestions from jmc@
Diffstat (limited to 'usr.bin/cdio/cdio.c')
-rw-r--r--usr.bin/cdio/cdio.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/usr.bin/cdio/cdio.c b/usr.bin/cdio/cdio.c
index ec5701f080e..1cad5555cc3 100644
--- a/usr.bin/cdio/cdio.c
+++ b/usr.bin/cdio/cdio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cdio.c,v 1.56 2006/08/25 04:38:32 deraadt Exp $ */
+/* $OpenBSD: cdio.c,v 1.57 2007/05/26 03:00:03 mjc Exp $ */
/* Copyright (c) 1995 Serge V. Vakulenko
* All rights reserved.
@@ -105,6 +105,8 @@
#define CMD_CDDB 19
#define CMD_CDID 20
#define CMD_BLANK 21
+#define CMD_CDRIP 22
+#define CMD_CDPLAY 23
struct cmdtab {
int command;
@@ -137,6 +139,8 @@ struct cmdtab {
{ CMD_CDID, "cdid", 3, "" },
{ CMD_QUIT, "exit", 2, "" },
{ CMD_BLANK, "blank", 1, "" },
+{ CMD_CDRIP, "cdrip", 1, "[[track1-trackN] ...]" },
+{ CMD_CDPLAY, "cdplay", 1, "[[track1-trackN] ...]" },
{ 0, 0, 0, 0}
};
@@ -572,6 +576,22 @@ run(int cmd, char *arg)
return 0;
return blank();
+ case CMD_CDRIP:
+ if (fd < 0 && ! open_cd(cdname, 0))
+ return (0);
+
+ while (isspace(*arg))
+ arg++;
+
+ return cdrip(arg);
+ case CMD_CDPLAY:
+ if (fd < 0 && ! open_cd(cdname, 0))
+ return (0);
+
+ while (isspace(*arg))
+ arg++;
+
+ return cdplay(arg);
default:
case CMD_HELP:
help();