Skip to content

Commit

Permalink
[cli] usage message + version check
Browse files Browse the repository at this point in the history
  • Loading branch information
alunny committed Mar 16, 2012
1 parent 7614da3 commit 111a3c4
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions cli.js
@@ -1,12 +1,18 @@
#!/usr/bin/env node
var pluginstall = require('./pluginstall'),
platform, projectDir, pluginDir,
config, plugin
config, plugin, package;

if (process.argv[0] == 'node') process.argv.shift()

process.argv.shift() // skip "cli.js"

if (process.argv.length == 0) {
console.log('Usage: pluginstall [platform] [project directory] [plugin directory]')
} else if (process.argv[0] === '-v') {
package = require('./package')
console.log('pluginstall version ' + package.version)
} else {
platform = process.argv.shift()
projectDir = process.argv.shift()
pluginDir = process.argv.shift()
Expand All @@ -21,5 +27,4 @@ process.argv.shift() // skip "cli.js"
console.log('plugin installed')
}
});


}

0 comments on commit 111a3c4

Please sign in to comment.