hexo/node_modules/os-name/cli.js

29 lines
430 B
JavaScript

#!/usr/bin/env node
'use strict';
var pkg = require('./package.json');
var osName = require('./');
var argv = process.argv;
function help() {
console.log([
'',
' ' + pkg.description,
'',
' Example',
' os-name',
' OS X Mavericks'
].join('\n'));
}
if (argv.indexOf('--help') !== -1) {
help();
return;
}
if (argv.indexOf('--version') !== -1) {
console.log(pkg.version);
return;
}
console.log(osName());