Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.action ( () => EnexDump () );
/* HELP */
const command = app._defaultCommand;
const helpLines = [
`enex-dump ${chalk.green ( '--src' )} ${chalk.blue ( './my-notes.enex' )}`,
`enex-dump ${chalk.green ( '--src' )} ${chalk.blue ( './my-notes.enex' )} ${chalk.green ( '--format' )} ${chalk.blue ( 'html' )} ${chalk.green ( '--extension' )} ${chalk.blue ( 'html' )}`,
`enex-dump ${chalk.green ( '--src' )} ${chalk.blue ( './my-notes.enex' )} ${chalk.green ( '--no-metadata' )} ${chalk.green ( '--no-attachments' )}`
];
command.help ( helpLines.join ( '\n' ), { name: 'USAGE - ADVANCED' } );
/* PARSE */
caporal.parse ( process.argv );
}
.action ( () => Template.list () )
/* INSTALL */
.command ( 'install', 'Install a template from a repository' )
.argument ( '', 'Git endpoint url, GitHub shorthand or local path' )
.argument ( '[template]', 'Template name' )
.action ( args => Template.install ( args.repository, args.template ) )
/* UNINSTALL */
.command ( 'uninstall', 'Uninstall one or all templates' )
.argument ( '[template]', 'Template name' )
.action ( args => Template.uninstall ( args.template ) )
/* UPDATE */
.command ( 'update', 'Update one or all templates' )
.argument ( '[template]', 'Template name' )
.action ( args => Template.update ( args.template ) );
caporal.parse ( process.argv );
}
const port = cmdObj.port || '27017'
const db = cmdObj.db || 'artipub'
const username = cmdObj.username || ''
const password = cmdObj.password || ''
process.env.MONGO_HOST = host
process.env.MONGO_PORT = port
process.env.MONGO_DB = db
process.env.MONGO_USERNAME = username
process.env.MONGO_PASSWORD = password
// 开启后段服务
require('./server')
})
program.parse(process.argv)
// note
//
.command('note', COMMAND_DESCRIPTIONS.note)
.alias('n')
.argument('[note...]', COMMAND_DESCRIPTIONS.noteNote)
.action(commands.addNote)
//
// ////////////////////
// about
//
.command('about', COMMAND_DESCRIPTIONS.about)
.alias('a')
.action(commands.about)
// let it begin!
prog.parse(process.argv)
public static async start(version) {
program
.version(version)
.help('Nest.js CLI');
new NewCommand().declare(program);
new GenerateCommand().declare(program);
new InfoCommand().declare(program);
new ServeCommand().declare(program);
program.parse(process.argv);
}
}
updateNotifier ({ pkg }).notify ();
caporal
.version ( pkg.version )
.option ( '--config
updateNotifier ({ pkg }).notify ();
args = _.castArray ( args.titleTorrent || [] ).concat ( args.webtorrentOptions );
const doubleDashIndex = args.findIndex ( x => x === '--' ),
hasWebtorrentOptions = ( doubleDashIndex >= 0 ),
queryOrTorrent = hasWebtorrentOptions ? args.slice ( 0, doubleDashIndex ).join ( ' ' ) : args.join ( ' ' ),
webtorrentOptions = hasWebtorrentOptions ? args.slice ( doubleDashIndex + 1 ) : [];
if ( !queryOrTorrent ) return CLIFlix.wizard ( webtorrentOptions );
return CLIFlix.lucky ( queryOrTorrent, webtorrentOptions );
});
caporal.parse ( process.argv );
}
module.exports = (argv) => program.parse(argv)
async function bootstrap () {
const program = require('caporal');
program
.version(require('./package.json').version)
.help('Nest.js CLI');
require('./bin/create/command')(program);
require('./bin/serve/command')(program);
require('./bin/info/command')(program);
require('./bin/generate/command')(program);
require('./bin/update/command')(program);
try {
await configurationLoader.load();
} catch (error) {
process.stderr.write('[ WARN ] - Can\'t execute generate and serve commands since a project is not initialized\n');
} finally {
program.parse(process.argv);
}
}
return bootstrap();
.action((args, options, logger) => {
shell.cd(`${__dirname}/ethql`);
shell.exec('npm run dev -- --jsonrpc=http://localhost:8545');
})
.command('deploy', 'Deploy solidity to network')
.action((args, options, logger) => {
migrate.run({working_directory: process.cwd()}, (err) => {
if (err) {
return logger.error(err);
}
logger.info('migrated');
});
})
prog.parse(process.argv);