Skip to content

Commit

Permalink
Add --version and -v argument support.
Browse files Browse the repository at this point in the history
  • Loading branch information
tauren committed Sep 3, 2014
1 parent 1b71dc3 commit 7aa2920
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions jspm.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,19 @@ if (require.main !== module)
return;

(function() {
function showInstructions() {
function showHeader() {
ui.log('\n'
+ ' \033[47m\033[1m \033[0m\n'
+ ' \033[47m\033[93m\033[1m jspm \033[0m\033[90m '
+ 'Browser Package Management'
+ ' \033[0m\n'
+ ' \033[47m\033[1m \033[0m\n'
+ '\n'
);
}

function showInstructions() {
showHeader();
ui.log('\n'
+ 'jspm install <name[=version]> [-o "{package override}" --force] \n'
+ ' install Install / update from package.json\n'
+ ' install jquery Install a package from the registry\n'
Expand Down Expand Up @@ -78,6 +83,13 @@ if (require.main !== module)
);
}

function showVersion() {
showHeader();
ui.log('\n'
+ 'Version: '+require('./package.json').version+'\n'
);
}

var args = process.argv.splice(2);
switch(args[0]) {
case 'inject':
Expand Down Expand Up @@ -251,6 +263,11 @@ if (require.main !== module)
case '--help':
case '-h':
showInstructions();

break;
case '--version':
case '-v':
showVersion();

break;
default:
Expand Down

0 comments on commit 7aa2920

Please sign in to comment.