在读入命令行参数时,不用输出默认值。

This commit is contained in:
陆柯 2021-09-11 09:11:10 +08:00
parent 541bb5c302
commit d02d43f43c

View File

@ -54,24 +54,24 @@ try {
// 读取命令行参数 // 读取命令行参数
commander commander
.version('1.0', '-v, --version') // 默认是 -V。如果要 -v就要加 '-v --version' .version('1.0', '-v, --version') // 默认是 -V。如果要 -v就要加 '-v --version'
.option('-f, --fromPath <fromPath>', `local distribution path to copy from. Default to ${wo.envi.deploy.fromPath}`) .option('-f, --fromPath <fromPath>', `local distribution path to copy from.`)
.option('-g, --gotoTarget <gotoTarget>', `connection section in config. Default to ${wo.envi.deploy.gotoTarget}`) .option('-g, --gotoTarget <gotoTarget>', `connection section in config.`)
.option('-t, --targetType <targetType>', `target type, git or ssh. Default to ${wo.envi.deploy.connection.targetType}`) .option('-t, --targetType <targetType>', `target type, git or ssh.`)
.option('-H, --host <host>', `Host IP or domain name of the target server. Default to ${wo.envi.deploy.connection.host}`) .option('-H, --host <host>', `Host IP or domain name of the target server.`)
.option('-P, --port <port>', `Ssh port number of the target server. Default to ${wo.envi.deploy.connection.port}`) .option('-P, --port <port>', `Ssh port number of the target server.`)
.option('-b, --targetPath <targetPath>', `Destination path to deploy on the target. Default to ${wo.envi.deploy.connection.targetPath}`) .option('-b, --targetPath <targetPath>', `Destination path to deploy on the target.`)
.option('-d, --targetDir <targetDir>', `Destination folder to deploy on the target. Default to ${wo.envi.deploy.connection.targetDir}`) .option('-d, --targetDir <targetDir>', `Destination folder to deploy on the target.`)
.option('-r, --repo <repo>', `git repo address. Default to ${wo.envi.deploy.connection.repo}`) .option('-r, --repo <repo>', `git repo address.`)
.option('-b, --branch <branch>', `git repo branch. Default to ${wo.envi.deploy.connection.branch}`) .option('-b, --branch <branch>', `git repo branch.`)
.option('-n, --gitname <gitname>', `git user name. Default to ${wo.envi.deploy.connection.gitname}`) .option('-n, --gitname <gitname>', `git user name.`)
.option('-m, --gitemail <gitemail>', `git user email. Default to ${wo.envi.deploy.connection.gitemail}`) .option('-m, --gitemail <gitemail>', `git user email.`)
.option('-u, --user <user>', `User id to login the target server. Default to ${wo.envi.deploy.connection.user}`) .option('-u, --user <user>', `User id to login the target server.`)
.option('-k, --key <key>', `User private key file to login the target server. Default to ${wo.envi.deploy.connection.key}`) .option('-k, --key <key>', `User private key file to login the target server.`)
.option('-p, --password <password>', `User password to login the target server. You may have to enclose it in "". Default to "${wo.envi.deploy.connection.password}"`) .option('-p, --password <password>', `User password to login the target server. You may have to enclose it in "".`)
.parse(process.argv) .parse(process.argv)
wo.envi.deploy.fromPath = commander.fromPath || wo.envi.deploy.fromPath wo.envi.deploy.fromPath = commander.fromPath || wo.envi.deploy.fromPath