changeset 4:e6f5077c2ea9

Display an error message when there is no video, and fix exit.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Thu, 23 Feb 2012 21:06:53 +0100
parents 0082e861cf16
children 4a063df30be9
files isshouni.js
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/isshouni.js
+++ b/isshouni.js
@@ -17,6 +17,10 @@
   OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */
 
+if (process.argv.length < 3) {
+  console.log('You should put at least a video on your command line.');
+  process.exit();
+}
 
 var config = require('./config');
 var args = ['-slave'].concat(process.argv.slice(2));
@@ -147,6 +151,7 @@ var commands = {
   'q': function() {
     tty.setRawMode(false);
     disconnect();
+    process.exit();
     return 'quit';
   },
 };