From 1ed2f64f2a9617270decd29c35c45ed47bc6fffd Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Tue, 15 Jul 2014 22:54:49 -0400 Subject: [PATCH] error out nicely when debug resultcache cue has no arg --- morituri/rip/debug.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/morituri/rip/debug.py b/morituri/rip/debug.py index 68a57cc..f6d2894 100644 --- a/morituri/rip/debug.py +++ b/morituri/rip/debug.py @@ -33,11 +33,18 @@ class RCCue(logcommand.LogCommand): def do(self, args): self._cache = cache.ResultCache() - persisted = self._cache.getRipResult(args[0], create=False) + try: + discid = args[0] + except IndexError: + self.stderr.write( + 'Please specify a cddb disc id\n') + return 3 + + persisted = self._cache.getRipResult(discid, create=False) if not persisted: self.stderr.write( - 'Could not find a result for cddb disc id %s\n' % args[0]) + 'Could not find a result for cddb disc id %s\n' % discid) return 3 self.stdout.write(persisted.object.table.cue().encode('utf-8'))