Skip to content

Commit

Permalink
Added "--version" command-line parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Anantachai Saothong (Manta) committed Apr 16, 2017
1 parent 85ab391 commit d2e3099
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion edge/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ let inputFiles = []
let optionFilePath = ''
let replaceOriginal = false
let outputDirectory = ''
let printVersion = false

let paramIndex = -1
const paramArray = ps.argv.slice(2)
Expand All @@ -28,12 +29,18 @@ while (++paramIndex < paramArray.length) {
outputDirectory = paramArray[paramIndex + 1]
paramIndex++

} else if (param === '--version' || param === '-v') {
printVersion = true

} else {
inputFiles.push(param)
}
}

if (inputFiles.length === 0) {
if (printVersion) {
console.log('v' + require('../package.json').version)

} else if (inputFiles.length === 0) {
console.log('No files specified.')

} else {
Expand Down

0 comments on commit d2e3099

Please sign in to comment.