comparison isshouni.js @ 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
comparison
equal deleted inserted replaced
3:0082e861cf16 4:e6f5077c2ea9
15 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 */ 18 */
19 19
20 if (process.argv.length < 3) {
21 console.log('You should put at least a video on your command line.');
22 process.exit();
23 }
20 24
21 var config = require('./config'); 25 var config = require('./config');
22 var args = ['-slave'].concat(process.argv.slice(2)); 26 var args = ['-slave'].concat(process.argv.slice(2));
23 27
24 var tty = require('tty'); 28 var tty = require('tty');
145 return 'pause'; 149 return 'pause';
146 }, 150 },
147 'q': function() { 151 'q': function() {
148 tty.setRawMode(false); 152 tty.setRawMode(false);
149 disconnect(); 153 disconnect();
154 process.exit();
150 return 'quit'; 155 return 'quit';
151 }, 156 },
152 }; 157 };
153 158
154 var seek = function(time) { 159 var seek = function(time) {