简体   繁体   中英

How to run bash with commander.js?

我怎样才能运行简单的 bash 命令,比如rm -rf directory或者使用commander.js echo whatever

You can run within your script command like so:

var program = require('commander');

program
    .version('0.0.1')
    .command('rmdir <dir>')

see full examples at: https://github.com/tj/commander.js/#commands

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM