Example #1
0
File: cli.js Project: eGavr/keylock
var coa = require('coa'),

    keylock = require('./');

///
module.exports = coa.Cmd()
    .name(process.argv[1])
    .title('Keylock')
    .helpful()
        .opt()
        .name('mode').title('learning or applying')
        .long('mode').short('m')
        .end()
    .opt()
        .name('login').title('login')
        .long('login').short('l')
        .end()
    .opt()
        .name('force').title('do not ask about a login existance')
        .long('force').short('f')
        .flag()
        .end()
    .opt()
        .name('debug').title('debug mode')
        .long('debug').short('d')
        .flag()
        .end()
    .opt()
        .name('criterias')
        .title('classification criterias (sumOfAbsoluteSubtractions, sumOfSquaredSubtractions, correlationCoefficient)')
        .long('criteria').short('c')
Example #2
0
	kraken.upload(opts, (data) => {
		if (data.success) {
			cb(options.input, data.kraked_url);
		} else {
			console.log('Fail. Error message: %s', data.message);
			return;
		}
	});
}


function isNumeric(n) {
  return !isNaN(parseFloat(n)) && isFinite(n);
}

coa.Cmd() 
	.name(process.argv[1])
	.title('The command utility to optimize the images')  
	.helpful() 
	.opt() 
		.name('version').title('Version')
		.short('v') 
		.long('version') 
		.only()
		.flag() 
		.act((options) => { 
			return JSON.parse(fs.readFileSync('./package.json')).version;
		})
		.end()
	.opt()
		.name('input').title('input image, required')