pax_global_header 0000666 0000000 0000000 00000000064 12642477672 0014533 g ustar 00root root 0000000 0000000 52 comment=9a5c90af79fb8f5f29c97e6b92b63f41e2df4f34
meow-3.7.0/ 0000775 0000000 0000000 00000000000 12642477672 0012511 5 ustar 00root root 0000000 0000000 meow-3.7.0/.editorconfig 0000664 0000000 0000000 00000000347 12642477672 0015172 0 ustar 00root root 0000000 0000000 root = true
[*]
indent_style = tab
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[{package.json,*.yml}]
indent_style = space
indent_size = 2
[*.md]
trim_trailing_whitespace = false
meow-3.7.0/.gitattributes 0000664 0000000 0000000 00000000014 12642477672 0015377 0 ustar 00root root 0000000 0000000 * text=auto
meow-3.7.0/.gitignore 0000664 0000000 0000000 00000000015 12642477672 0014475 0 ustar 00root root 0000000 0000000 node_modules
meow-3.7.0/.travis.yml 0000664 0000000 0000000 00000000112 12642477672 0014614 0 ustar 00root root 0000000 0000000 sudo: false
language: node_js
node_js:
- 'stable'
- '0.12'
- '0.10'
meow-3.7.0/fixture.js 0000775 0000000 0000000 00000000624 12642477672 0014542 0 ustar 00root root 0000000 0000000 #!/usr/bin/env node
'use strict';
var meow = require('./');
var cli = meow({
description: 'Custom description',
help: [
'Usage',
' foo '
]
}, {
alias: {u: 'unicorn'},
default: {meow: 'dog', camelCaseOption: 'foo'}
});
if (cli.flags.camelCaseOption === 'foo') {
Object.keys(cli.flags).forEach(function (el) {
console.log(el);
});
} else {
console.log(cli.flags.camelCaseOption);
}
meow-3.7.0/index.js 0000664 0000000 0000000 00000004011 12642477672 0014152 0 ustar 00root root 0000000 0000000 'use strict';
var path = require('path');
var minimist = require('minimist');
var objectAssign = require('object-assign');
var camelcaseKeys = require('camelcase-keys');
var decamelize = require('decamelize');
var mapObj = require('map-obj');
var trimNewlines = require('trim-newlines');
var redent = require('redent');
var readPkgUp = require('read-pkg-up');
var loudRejection = require('loud-rejection');
var normalizePackageData = require('normalize-package-data');
// get the uncached parent
delete require.cache[__filename];
var parentDir = path.dirname(module.parent.filename);
module.exports = function (opts, minimistOpts) {
loudRejection();
if (Array.isArray(opts) || typeof opts === 'string') {
opts = {help: opts};
}
opts = objectAssign({
pkg: readPkgUp.sync({
cwd: parentDir,
normalize: false
}).pkg,
argv: process.argv.slice(2)
}, opts);
minimistOpts = objectAssign({}, minimistOpts);
minimistOpts.default = mapObj(minimistOpts.default || {}, function (key, value) {
return [decamelize(key, '-'), value];
});
if (Array.isArray(opts.help)) {
opts.help = opts.help.join('\n');
}
var pkg = typeof opts.pkg === 'string' ? require(path.join(parentDir, opts.pkg)) : opts.pkg;
var argv = minimist(opts.argv, minimistOpts);
var help = redent(trimNewlines(opts.help || ''), 2);
normalizePackageData(pkg);
process.title = pkg.bin ? Object.keys(pkg.bin)[0] : pkg.name;
var description = opts.description;
if (!description && description !== false) {
description = pkg.description;
}
help = (description ? '\n ' + description + '\n' : '') + (help ? '\n' + help : '\n');
var showHelp = function (code) {
console.log(help);
process.exit(code || 0);
};
if (argv.version && opts.version !== false) {
console.log(typeof opts.version === 'string' ? opts.version : pkg.version);
process.exit();
}
if (argv.help && opts.help !== false) {
showHelp();
}
var _ = argv._;
delete argv._;
return {
input: _,
flags: camelcaseKeys(argv),
pkg: pkg,
help: help,
showHelp: showHelp
};
};
meow-3.7.0/license 0000664 0000000 0000000 00000002137 12642477672 0014061 0 ustar 00root root 0000000 0000000 The MIT License (MIT)
Copyright (c) Sindre Sorhus (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
meow-3.7.0/meow.gif 0000664 0000000 0000000 00002245021 12642477672 0014155 0 ustar 00root root 0000000 0000000 GIF89a% #&#%EM(#(/-L/GHI.Z(
ܐQOknf{ 'OkK qOMwwwLLL)))fff hQn ȋcݔحhTLlrYלkrI97q+.o
- !NETSCAPE2.0 !XMP DataXMP?xpacke ! % , fTsکt,k'vX8x