mirror of
https://github.com/nodejs/node.git
synced 2026-12-06 03:59:05 -05:00
PR-URL: https://github.com/iojs/io.js/pull/1539 Fixes: https://github.com/iojs/io.js/issues/1253 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com> Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
27 lines
422 B
JavaScript
Executable File
27 lines
422 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
'use strict';
|
|
var pkg = require('./package.json');
|
|
var userHome = require('./');
|
|
|
|
function help() {
|
|
console.log([
|
|
pkg.description,
|
|
'',
|
|
'Example',
|
|
' $ user-home',
|
|
' /Users/sindresorhus'
|
|
].join('\n'));
|
|
}
|
|
|
|
if (process.argv.indexOf('--help') !== -1) {
|
|
help();
|
|
return;
|
|
}
|
|
|
|
if (process.argv.indexOf('--version') !== -1) {
|
|
console.log(pkg.version);
|
|
return;
|
|
}
|
|
|
|
process.stdout.write(userHome);
|