fsevents 1.0.7 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of fsevents might be problematic. Click here for more details.
- package/node_modules/ansi/History.md +7 -0
- package/node_modules/ansi/LICENSE +24 -0
- package/node_modules/ansi/lib/ansi.js +2 -2
- package/node_modules/ansi/package.json +15 -10
- package/node_modules/ansi-regex/package.json +1 -0
- package/node_modules/ansi-styles/package.json +1 -0
- package/node_modules/are-we-there-yet/.npmignore +2 -0
- package/node_modules/are-we-there-yet/index.js +20 -18
- package/node_modules/are-we-there-yet/package.json +15 -13
- package/node_modules/asn1/package.json +3 -1
- package/node_modules/assert-plus/README.md +50 -21
- package/node_modules/assert-plus/assert.js +168 -207
- package/node_modules/assert-plus/package.json +55 -15
- package/node_modules/async/README.md +86 -4
- package/node_modules/async/dist/async.js +4 -3
- package/node_modules/async/dist/async.min.js +1 -1
- package/node_modules/async/lib/async.js +4 -3
- package/node_modules/async/package.json +10 -10
- package/node_modules/aws-sign2/package.json +1 -0
- package/node_modules/aws4/.npmignore +3 -0
- package/node_modules/aws4/.tern-port +1 -0
- package/node_modules/{tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match → aws4}/.travis.yml +2 -0
- package/node_modules/{tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md → aws4/LICENSE} +1 -3
- package/node_modules/aws4/README.md +510 -0
- package/node_modules/aws4/aws4.js +313 -0
- package/node_modules/aws4/example.js +372 -0
- package/node_modules/aws4/node_modules/lru-cache/.npmignore +1 -0
- package/node_modules/aws4/node_modules/lru-cache/.travis.yml +8 -0
- package/node_modules/aws4/node_modules/lru-cache/CONTRIBUTORS +14 -0
- package/node_modules/aws4/node_modules/lru-cache/README.md +137 -0
- package/node_modules/aws4/node_modules/lru-cache/lib/lru-cache.js +334 -0
- package/node_modules/aws4/node_modules/lru-cache/package.json +66 -0
- package/node_modules/aws4/node_modules/lru-cache/test/basic.js +396 -0
- package/node_modules/aws4/node_modules/lru-cache/test/foreach.js +120 -0
- package/node_modules/aws4/node_modules/lru-cache/test/memory-leak.js +51 -0
- package/node_modules/aws4/node_modules/lru-cache/test/serialize.js +216 -0
- package/node_modules/aws4/package.json +113 -0
- package/node_modules/bl/.travis.yml +5 -6
- package/node_modules/bl/bl.js +5 -0
- package/node_modules/bl/package.json +16 -13
- package/node_modules/bl/test/test.js +554 -6
- package/node_modules/block-stream/package.json +1 -0
- package/node_modules/boom/package.json +1 -0
- package/node_modules/caseless/package.json +1 -0
- package/node_modules/chalk/package.json +1 -0
- package/node_modules/combined-stream/package.json +1 -0
- package/node_modules/commander/package.json +1 -0
- package/node_modules/core-util-is/package.json +2 -2
- package/node_modules/cryptiles/package.json +1 -0
- package/node_modules/dashdash/README.md +70 -7
- package/node_modules/dashdash/etc/dashdash.bash_completion.in +388 -0
- package/node_modules/dashdash/lib/dashdash.js +202 -2
- package/node_modules/dashdash/package.json +12 -9
- package/node_modules/debug/.jshintrc +3 -0
- package/node_modules/debug/.npmignore +6 -0
- package/node_modules/debug/History.md +195 -0
- package/node_modules/debug/Makefile +36 -0
- package/node_modules/debug/Readme.md +86 -13
- package/node_modules/debug/bower.json +28 -0
- package/node_modules/debug/browser.js +168 -0
- package/node_modules/debug/component.json +19 -0
- package/node_modules/debug/debug.js +132 -72
- package/node_modules/debug/node.js +209 -0
- package/node_modules/debug/package.json +32 -22
- package/node_modules/deep-extend/README.md +51 -50
- package/node_modules/deep-extend/package.json +14 -16
- package/node_modules/delayed-stream/package.json +1 -0
- package/node_modules/delegates/History.md +6 -0
- package/node_modules/delegates/License +20 -0
- package/node_modules/delegates/package.json +17 -13
- package/node_modules/ecc-jsbn/package.json +3 -1
- package/node_modules/escape-string-regexp/package.json +2 -2
- package/node_modules/extend/package.json +1 -0
- package/node_modules/extsprintf/package.json +4 -2
- package/node_modules/forever-agent/package.json +1 -0
- package/node_modules/form-data/package.json +1 -0
- package/node_modules/fstream/package.json +1 -0
- package/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +1 -0
- package/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json +1 -0
- package/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/package.json +1 -0
- package/node_modules/fstream-ignore/node_modules/minimatch/package.json +1 -0
- package/node_modules/fstream-ignore/package.json +3 -1
- package/node_modules/gauge/package.json +14 -12
- package/node_modules/gauge/progress-bar.js +4 -5
- package/node_modules/gauge/test/progress-bar.js +1 -1
- package/node_modules/generate-function/package.json +1 -0
- package/node_modules/generate-object-property/package.json +1 -0
- package/node_modules/graceful-fs/README.md +17 -0
- package/node_modules/graceful-fs/graceful-fs.js +2 -0
- package/node_modules/graceful-fs/package.json +16 -11
- package/node_modules/graceful-readlink/package.json +1 -0
- package/node_modules/har-validator/README.md +45 -122
- package/node_modules/har-validator/package.json +16 -16
- package/node_modules/has-ansi/package.json +1 -0
- package/node_modules/has-unicode/README.md +6 -3
- package/node_modules/has-unicode/index.js +7 -3
- package/node_modules/has-unicode/package.json +15 -13
- package/node_modules/has-unicode/test/index.js +1 -1
- package/node_modules/hawk/README.md +634 -634
- package/node_modules/hawk/bower.json +24 -24
- package/node_modules/hawk/component.json +18 -18
- package/node_modules/hawk/dist/client.js +343 -340
- package/node_modules/hawk/example/usage.js +78 -78
- package/node_modules/hawk/lib/browser.js +637 -637
- package/node_modules/hawk/lib/client.js +369 -369
- package/node_modules/hawk/lib/crypto.js +126 -126
- package/node_modules/hawk/lib/index.js +15 -15
- package/node_modules/hawk/lib/server.js +548 -540
- package/node_modules/hawk/lib/utils.js +184 -164
- package/node_modules/hawk/package.json +9 -8
- package/node_modules/hawk/test/browser.js +1492 -1492
- package/node_modules/hawk/test/client.js +440 -440
- package/node_modules/hawk/test/crypto.js +70 -70
- package/node_modules/hawk/test/index.js +378 -378
- package/node_modules/hawk/test/readme.js +95 -95
- package/node_modules/hawk/test/server.js +1329 -1302
- package/node_modules/hawk/test/uri.js +838 -838
- package/node_modules/hawk/test/utils.js +149 -121
- package/node_modules/hoek/package.json +1 -0
- package/node_modules/http-signature/CHANGES.md +7 -0
- package/node_modules/http-signature/http_signing.md +71 -3
- package/node_modules/http-signature/lib/signer.js +5 -0
- package/node_modules/http-signature/package.json +13 -11
- package/node_modules/ini/package.json +3 -1
- package/node_modules/is-my-json-valid/formats.js +1 -1
- package/node_modules/is-my-json-valid/package.json +11 -10
- package/node_modules/is-property/package.json +1 -0
- package/node_modules/is-typedarray/package.json +3 -1
- package/node_modules/isarray/package.json +2 -2
- package/node_modules/isstream/package.json +1 -0
- package/node_modules/jodid25519/package.json +3 -1
- package/node_modules/jsbn/package.json +3 -1
- package/node_modules/json-schema/package.json +2 -1
- package/node_modules/json-stringify-safe/package.json +1 -0
- package/node_modules/jsonpointer/package.json +1 -0
- package/node_modules/jsprim/package.json +3 -1
- package/node_modules/lodash._basetostring/package.json +4 -4
- package/node_modules/lodash._createpadding/package.json +3 -2
- package/node_modules/lodash._root/LICENSE +22 -0
- package/node_modules/lodash._root/README.md +18 -0
- package/node_modules/lodash._root/index.js +53 -0
- package/node_modules/lodash._root/package.json +77 -0
- package/node_modules/lodash.pad/LICENSE +2 -2
- package/node_modules/lodash.pad/README.md +4 -6
- package/node_modules/lodash.pad/index.js +347 -15
- package/node_modules/lodash.pad/package.json +20 -34
- package/node_modules/lodash.padleft/package.json +3 -1
- package/node_modules/lodash.padright/package.json +3 -1
- package/node_modules/lodash.repeat/LICENSE +2 -2
- package/node_modules/lodash.repeat/README.md +4 -6
- package/node_modules/lodash.repeat/index.js +262 -11
- package/node_modules/lodash.repeat/package.json +21 -34
- package/node_modules/mime-db/package.json +2 -2
- package/node_modules/mime-types/package.json +2 -2
- package/node_modules/ms/.npmignore +5 -0
- package/node_modules/{deep-extend → ms}/LICENSE +2 -2
- package/node_modules/ms/README.md +35 -0
- package/node_modules/ms/index.js +125 -0
- package/node_modules/ms/package.json +56 -0
- package/node_modules/node-pre-gyp/CHANGELOG.md +8 -0
- package/node_modules/node-pre-gyp/LICENSE +27 -0
- package/node_modules/node-pre-gyp/lib/util/abi_crosswalk.json +36 -0
- package/node_modules/node-pre-gyp/package.json +23 -22
- package/node_modules/node-uuid/package.json +1 -0
- package/node_modules/npmlog/package.json +18 -16
- package/node_modules/oauth-sign/index.js +2 -0
- package/node_modules/oauth-sign/package.json +10 -9
- package/node_modules/once/README.md +18 -0
- package/node_modules/once/once.js +8 -6
- package/node_modules/once/package.json +20 -12
- package/node_modules/pinkie/index.js +3 -3
- package/node_modules/pinkie/package.json +10 -9
- package/node_modules/pinkie/readme.md +1 -1
- package/node_modules/pinkie-promise/package.json +1 -0
- package/node_modules/process-nextick-args/package.json +2 -2
- package/node_modules/qs/.eslintrc +17 -0
- package/node_modules/qs/.travis.yml +66 -5
- package/node_modules/qs/CHANGELOG.md +86 -75
- package/node_modules/qs/README.md +85 -81
- package/node_modules/qs/bower.json +1 -1
- package/node_modules/qs/component.json +1 -1
- package/node_modules/qs/dist/qs.js +108 -177
- package/node_modules/qs/lib/index.js +1 -7
- package/node_modules/qs/lib/parse.js +26 -49
- package/node_modules/qs/lib/stringify.js +22 -46
- package/node_modules/qs/lib/utils.js +45 -73
- package/node_modules/qs/package.json +51 -28
- package/node_modules/qs/test/index.js +5 -0
- package/node_modules/qs/test/parse.js +236 -321
- package/node_modules/qs/test/stringify.js +139 -197
- package/node_modules/qs/test/utils.js +6 -25
- package/node_modules/rc/node_modules/minimist/package.json +1 -0
- package/node_modules/rc/package.json +1 -0
- package/node_modules/readable-stream/package.json +1 -0
- package/node_modules/request/CHANGELOG.md +16 -1
- package/node_modules/request/README.md +1 -1
- package/node_modules/request/lib/har.js +3 -2
- package/node_modules/request/lib/multipart.js +3 -0
- package/node_modules/request/lib/tunnel.js +0 -2
- package/node_modules/request/package.json +20 -17
- package/node_modules/request/request.js +50 -26
- package/node_modules/rimraf/README.md +1 -1
- package/node_modules/rimraf/node_modules/glob/README.md +2 -2
- package/node_modules/rimraf/node_modules/glob/glob.js +14 -1
- package/node_modules/rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy/package.json +1 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/inflight/package.json +1 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/inherits/package.json +2 -1
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +1 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json +1 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +1 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/package.json +1 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy/package.json +1 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/once/package.json +1 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/package.json +1 -0
- package/node_modules/rimraf/node_modules/glob/package.json +11 -11
- package/node_modules/rimraf/package.json +13 -12
- package/node_modules/semver/package.json +3 -1
- package/node_modules/sntp/package.json +1 -0
- package/node_modules/sshpk/.npmignore +1 -0
- package/node_modules/sshpk/bin/sshpk-sign +176 -0
- package/node_modules/sshpk/bin/sshpk-verify +166 -0
- package/node_modules/sshpk/lib/ed-compat.js +2 -0
- package/node_modules/sshpk/lib/key.js +6 -0
- package/node_modules/sshpk/man/man1/sshpk-conv.1 +135 -0
- package/node_modules/sshpk/man/man1/sshpk-sign.1 +81 -0
- package/node_modules/sshpk/man/man1/sshpk-verify.1 +68 -0
- package/node_modules/sshpk/package.json +18 -9
- package/node_modules/string_decoder/package.json +2 -2
- package/node_modules/stringstream/package.json +1 -0
- package/node_modules/strip-ansi/package.json +1 -0
- package/node_modules/strip-json-comments/package.json +1 -0
- package/node_modules/supports-color/package.json +1 -0
- package/node_modules/tar/package.json +1 -0
- package/node_modules/tar-pack/README.md +2 -2
- package/node_modules/tar-pack/package.json +25 -26
- package/node_modules/tough-cookie/package.json +1 -0
- package/node_modules/tunnel-agent/package.json +1 -0
- package/node_modules/tweetnacl/README.md +1 -1
- package/node_modules/tweetnacl/package.json +13 -11
- package/node_modules/uid-number/package.json +14 -13
- package/node_modules/uid-number/uid-number.js +9 -4
- package/node_modules/util-deprecate/package.json +2 -2
- package/node_modules/verror/package.json +1 -0
- package/node_modules/{tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy → wrappy}/package.json +3 -2
- package/node_modules/xtend/package.json +1 -0
- package/package.json +2 -2
- package/node_modules/are-we-there-yet/README.md~ +0 -183
- package/node_modules/bl/test/basic-test.js +0 -541
- package/node_modules/bl/test/sauce.js +0 -38
- package/node_modules/debug/index.js +0 -5
- package/node_modules/debug/lib/debug.js +0 -147
- package/node_modules/deep-extend/test/index.spec.js +0 -220
- package/node_modules/deep-extend/test/mocha.opts +0 -1
- package/node_modules/gauge/README.md~ +0 -161
- package/node_modules/has-unicode/README.md~ +0 -4
- package/node_modules/once/LICENSE +0 -27
- package/node_modules/once/test/once.js +0 -18
- package/node_modules/sshpk/node_modules/assert-plus/README.md +0 -155
- package/node_modules/sshpk/node_modules/assert-plus/assert.js +0 -206
- package/node_modules/sshpk/node_modules/assert-plus/package.json +0 -88
- package/node_modules/tar-pack/node_modules/rimraf/README.md +0 -43
- package/node_modules/tar-pack/node_modules/rimraf/bin.js +0 -40
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/README.md +0 -359
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/common.js +0 -226
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/glob.js +0 -752
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/.eslintrc +0 -17
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/README.md +0 -37
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/inflight.js +0 -44
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy/package.json +0 -58
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/package.json +0 -67
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/test.js +0 -97
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inherits/LICENSE +0 -16
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inherits/README.md +0 -42
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inherits/inherits.js +0 -1
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inherits/inherits_browser.js +0 -23
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inherits/package.json +0 -58
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inherits/test.js +0 -25
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/README.md +0 -216
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/minimatch.js +0 -912
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore +0 -3
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md +0 -122
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js +0 -8
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js +0 -191
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore +0 -2
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile +0 -6
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md +0 -89
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js +0 -5
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js +0 -50
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +0 -79
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js +0 -84
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml +0 -4
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE +0 -18
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown +0 -62
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js +0 -6
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js +0 -13
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json +0 -90
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js +0 -39
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +0 -81
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/package.json +0 -66
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/README.md +0 -51
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy/LICENSE +0 -15
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy/README.md +0 -36
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy/test/basic.js +0 -51
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy/wrappy.js +0 -33
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/once.js +0 -21
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/package.json +0 -70
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/index.js +0 -20
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/package.json +0 -78
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/readme.md +0 -51
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/package.json +0 -79
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/sync.js +0 -460
- package/node_modules/tar-pack/node_modules/rimraf/package.json +0 -69
- package/node_modules/tar-pack/node_modules/rimraf/rimraf.js +0 -333
- package/node_modules/uid-number/LICENCE +0 -25
- /package/node_modules/{sshpk/node_modules/assert-plus → assert-plus}/AUTHORS +0 -0
- /package/node_modules/{sshpk/node_modules/assert-plus → assert-plus}/CHANGES.md +0 -0
- /package/node_modules/{tar-pack/node_modules/rimraf → aws4/node_modules/lru-cache}/LICENSE +0 -0
- /package/node_modules/{tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight → uid-number}/LICENSE +0 -0
- /package/node_modules/{tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy → wrappy}/LICENSE +0 -0
- /package/node_modules/{tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy → wrappy}/README.md +0 -0
- /package/node_modules/{tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy → wrappy}/test/basic.js +0 -0
- /package/node_modules/{tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy → wrappy}/wrappy.js +0 -0
@@ -232,6 +232,52 @@ variable can also be included in **help output**:
|
|
232
232
|
-f FILE, --file=FILE File to process
|
233
233
|
|
234
234
|
|
235
|
+
# Bash completion
|
236
|
+
|
237
|
+
Dashdash provides a simple way to create a Bash completion file that you
|
238
|
+
can place in your "bash_completion.d" directory -- sometimes that is
|
239
|
+
"/usr/local/etc/bash_completion.d/"). Features:
|
240
|
+
|
241
|
+
- Support for short and long opts
|
242
|
+
- Support for knowing which options take arguments
|
243
|
+
- Support for subcommands (e.g. 'git log <TAB>' to show just options for the
|
244
|
+
log subcommand). See
|
245
|
+
[node-cmdln](https://github.com/trentm/node-cmdln#bash-completion) for
|
246
|
+
how to integrate that.
|
247
|
+
- Does the right thing with "--" to stop options.
|
248
|
+
- Custom optarg and arg types for custom completions.
|
249
|
+
|
250
|
+
Dashdash will return bash completion file content given a parser instance:
|
251
|
+
|
252
|
+
var parser = dashdash.createParser({options: options});
|
253
|
+
console.log( parser.bashCompletion({name: 'mycli'}) );
|
254
|
+
|
255
|
+
or directly from a `options` array of options specs:
|
256
|
+
|
257
|
+
var code = dashdash.bashCompletionFromOptions({
|
258
|
+
name: 'mycli',
|
259
|
+
options: OPTIONS
|
260
|
+
});
|
261
|
+
|
262
|
+
Write that content to "/usr/local/etc/bash_completion.d/mycli" and you will
|
263
|
+
have Bash completions for `mycli`. Alternatively you can write it to
|
264
|
+
any file (e.g. "~/.bashrc") and source it.
|
265
|
+
|
266
|
+
You could add a `--completion` hidden option to your tool that emits the
|
267
|
+
completion content and document for your users to call that to install
|
268
|
+
Bash completions.
|
269
|
+
|
270
|
+
See [examples/ddcompletion.js](examples/ddcompletion.js) for a complete
|
271
|
+
example, including how one can define bash functions for completion of custom
|
272
|
+
option types. Also see [node-cmdln](https://github.com/trentm/node-cmdln) for
|
273
|
+
how it uses this for Bash completion for full multi-subcommand tools.
|
274
|
+
|
275
|
+
- TODO: document specExtra
|
276
|
+
- TODO: document includeHidden
|
277
|
+
- TODO: document custom types, `function complete\_FOO` guide, completionType
|
278
|
+
- TODO: document argtypes
|
279
|
+
|
280
|
+
|
235
281
|
# Parser config
|
236
282
|
|
237
283
|
Parser construction (i.e. `dashdash.createParser(CONFIG)`) takes the
|
@@ -279,12 +325,13 @@ following fields:
|
|
279
325
|
|
280
326
|
# Option specs
|
281
327
|
|
282
|
-
Example using all fields:
|
328
|
+
Example using all fields (required fields are noted):
|
283
329
|
|
284
330
|
```javascript
|
285
331
|
{
|
286
|
-
names: ['file', 'f'], // Required (or `name`).
|
332
|
+
names: ['file', 'f'], // Required (one of `names` or `name`).
|
287
333
|
type: 'string', // Required.
|
334
|
+
completionType: 'filename',
|
288
335
|
env: 'MYTOOL_FILE',
|
289
336
|
help: 'Config file to load before running "mytool"',
|
290
337
|
helpArg: 'PATH',
|
@@ -320,6 +367,20 @@ Each option spec in the `options` array must/can have the following fields:
|
|
320
367
|
You can add your own custom option types with `dashdash.addOptionType`.
|
321
368
|
See below.
|
322
369
|
|
370
|
+
- `completionType` (String). Optional. This is used for [Bash
|
371
|
+
completion](#bash-completion) for an option argument. If not specified,
|
372
|
+
then the value of `type` is used. Any string may be specified, but only the
|
373
|
+
following values have meaning:
|
374
|
+
|
375
|
+
- `none`: Provide no completions.
|
376
|
+
- `file`: Bash's default completion (i.e. `complete -o default`), which
|
377
|
+
includes filenames.
|
378
|
+
- *Any string FOO for which a `function complete_FOO` Bash function is
|
379
|
+
defined.* This is for custom completions for a given tool. Typically
|
380
|
+
these custom functions are provided in the `specExtra` argument to
|
381
|
+
`dashdash.bashCompletionFromOptions()`. See
|
382
|
+
["examples/ddcompletion.js"](examples/ddcompletion.js) for an example.
|
383
|
+
|
323
384
|
- `env` (String or Array of String). Optional. An environment variable name
|
324
385
|
(or names) that can be used as a fallback for this option. For example,
|
325
386
|
given a "foo.js" like this:
|
@@ -349,7 +410,8 @@ Each option spec in the `options` array must/can have the following fields:
|
|
349
410
|
option isn't specified in argv.
|
350
411
|
|
351
412
|
- `hidden` (Boolean). Optional, default false. If true, help output will not
|
352
|
-
include this option.
|
413
|
+
include this option. See also the `includeHidden` option to
|
414
|
+
`bashCompletionFromOptions()` for [Bash completion](#bash-completion).
|
353
415
|
|
354
416
|
|
355
417
|
# Option group headings
|
@@ -435,7 +497,8 @@ you. However, you can add your own via:
|
|
435
497
|
},
|
436
498
|
array: false, // optional
|
437
499
|
arrayFlatten: false, // optional
|
438
|
-
default:
|
500
|
+
default: ..., // optional
|
501
|
+
completionType: ... // optional
|
439
502
|
});
|
440
503
|
|
441
504
|
For example, a simple option type that accepts 'yes', 'y', 'no' or 'n' as
|
@@ -470,9 +533,9 @@ a boolean argument would look like:
|
|
470
533
|
|
471
534
|
See "examples/custom-option-\*.js" for other examples.
|
472
535
|
See the `addOptionType` block comment in "lib/dashdash.js" for more details.
|
473
|
-
Please let me know [
|
474
|
-
|
475
|
-
|
536
|
+
Please let me know [with an
|
537
|
+
issue](https://github.com/trentm/node-dashdash/issues/new) if you write a
|
538
|
+
generally useful one.
|
476
539
|
|
477
540
|
|
478
541
|
|
@@ -0,0 +1,388 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
#
|
3
|
+
# Bash completion generated for '{{name}}' at {{date}}.
|
4
|
+
#
|
5
|
+
# The original template lives here:
|
6
|
+
# https://github.com/trentm/node-dashdash/blob/master/etc/dashdash.bash_completion.in
|
7
|
+
#
|
8
|
+
|
9
|
+
#
|
10
|
+
# Copyright 2016 Trent Mick
|
11
|
+
# Copyright 2016 Joyent, Inc.
|
12
|
+
#
|
13
|
+
#
|
14
|
+
# A generic Bash completion driver script.
|
15
|
+
#
|
16
|
+
# This is meant to provide a re-usable chunk of Bash to use for
|
17
|
+
# "etc/bash_completion.d/" files for individual tools. Only the "Configuration"
|
18
|
+
# section with tool-specific info need differ. Features:
|
19
|
+
#
|
20
|
+
# - support for short and long opts
|
21
|
+
# - support for knowing which options take arguments
|
22
|
+
# - support for subcommands (e.g. 'git log <TAB>' to show just options for the
|
23
|
+
# log subcommand)
|
24
|
+
# - does the right thing with "--" to stop options
|
25
|
+
# - custom optarg and arg types for custom completions
|
26
|
+
# - (TODO) support for shells other than Bash (tcsh, zsh, fish?, etc.)
|
27
|
+
#
|
28
|
+
#
|
29
|
+
# Examples/design:
|
30
|
+
#
|
31
|
+
# 1. Bash "default" completion. By default Bash's 'complete -o default' is
|
32
|
+
# enabled. That means when there are no completions (e.g. if no opts match
|
33
|
+
# the current word), then you'll get Bash's default completion. Most notably
|
34
|
+
# that means you get filename completion. E.g.:
|
35
|
+
# $ tool ./<TAB>
|
36
|
+
# $ tool READ<TAB>
|
37
|
+
#
|
38
|
+
# 2. all opts and subcmds:
|
39
|
+
# $ tool <TAB>
|
40
|
+
# $ tool -v <TAB> # assuming '-v' doesn't take an arg
|
41
|
+
# $ tool -<TAB> # matching opts
|
42
|
+
# $ git lo<TAB> # matching subcmds
|
43
|
+
#
|
44
|
+
# Long opt completions are given *without* the '=', i.e. we prefer space
|
45
|
+
# separated because that's easier for good completions.
|
46
|
+
#
|
47
|
+
# 3. long opt arg with '='
|
48
|
+
# $ tool --file=<TAB>
|
49
|
+
# $ tool --file=./d<TAB>
|
50
|
+
# We maintain the "--file=" prefix. Limitation: With the attached prefix
|
51
|
+
# the 'complete -o filenames' doesn't know to do dirname '/' suffixing. Meh.
|
52
|
+
#
|
53
|
+
# 4. envvars:
|
54
|
+
# $ tool $<TAB>
|
55
|
+
# $ tool $P<TAB>
|
56
|
+
# Limitation: Currently only getting exported vars, so we miss "PS1" and
|
57
|
+
# others.
|
58
|
+
#
|
59
|
+
# 5. Defer to other completion in a subshell:
|
60
|
+
# $ tool --file $(cat ./<TAB>
|
61
|
+
# We get this from 'complete -o default ...'.
|
62
|
+
#
|
63
|
+
# 6. Custom completion types from a provided bash function.
|
64
|
+
# $ tool --profile <TAB> # complete available "profiles"
|
65
|
+
#
|
66
|
+
#
|
67
|
+
# Dev Notes:
|
68
|
+
# - compgen notes, from http://unix.stackexchange.com/questions/151118/understand-compgen-builtin-command
|
69
|
+
# - https://www.gnu.org/software/bash/manual/html_node/Programmable-Completion-Builtins.html
|
70
|
+
#
|
71
|
+
|
72
|
+
|
73
|
+
# Debugging this completion:
|
74
|
+
# 1. Uncomment the "_{{name}}_log_file=..." line.
|
75
|
+
# 2. 'tail -f /var/tmp/dashdash-completion.log' in one terminal.
|
76
|
+
# 3. Re-source this bash completion file.
|
77
|
+
#_{{name}}_log=/var/tmp/dashdash-completion.log
|
78
|
+
|
79
|
+
function _{{name}}_completer {
|
80
|
+
|
81
|
+
# ---- cmd definition
|
82
|
+
|
83
|
+
{{spec}}
|
84
|
+
|
85
|
+
|
86
|
+
# ---- locals
|
87
|
+
|
88
|
+
declare -a argv
|
89
|
+
|
90
|
+
|
91
|
+
# ---- support functions
|
92
|
+
|
93
|
+
function trace {
|
94
|
+
[[ -n "$_{{name}}_log" ]] && echo "$*" >&2
|
95
|
+
}
|
96
|
+
|
97
|
+
function _dashdash_complete {
|
98
|
+
local idx context
|
99
|
+
idx=$1
|
100
|
+
context=$2
|
101
|
+
|
102
|
+
local shortopts longopts optargs subcmds allsubcmds argtypes
|
103
|
+
shortopts="$(eval "echo \${cmd${context}_shortopts}")"
|
104
|
+
longopts="$(eval "echo \${cmd${context}_longopts}")"
|
105
|
+
optargs="$(eval "echo \${cmd${context}_optargs}")"
|
106
|
+
subcmds="$(eval "echo \${cmd${context}_subcmds}")"
|
107
|
+
allsubcmds="$(eval "echo \${cmd${context}_allsubcmds}")"
|
108
|
+
IFS=', ' read -r -a argtypes <<< "$(eval "echo \${cmd${context}_argtypes}")"
|
109
|
+
|
110
|
+
trace ""
|
111
|
+
trace "_dashdash_complete(idx=$idx, context=$context)"
|
112
|
+
trace " shortopts: $shortopts"
|
113
|
+
trace " longopts: $longopts"
|
114
|
+
trace " optargs: $optargs"
|
115
|
+
trace " subcmds: $subcmds"
|
116
|
+
trace " allsubcmds: $allsubcmds"
|
117
|
+
|
118
|
+
# Get 'state' of option parsing at this COMP_POINT.
|
119
|
+
# Copying "dashdash.js#parse()" behaviour here.
|
120
|
+
local state=
|
121
|
+
local nargs=0
|
122
|
+
local i=$idx
|
123
|
+
local argtype
|
124
|
+
local optname
|
125
|
+
local prefix
|
126
|
+
local word
|
127
|
+
local dashdashseen=
|
128
|
+
while [[ $i -lt $len && $i -le $COMP_CWORD ]]; do
|
129
|
+
argtype=
|
130
|
+
optname=
|
131
|
+
prefix=
|
132
|
+
word=
|
133
|
+
|
134
|
+
arg=${argv[$i]}
|
135
|
+
trace " consider argv[$i]: '$arg'"
|
136
|
+
|
137
|
+
if [[ "$arg" == "--" && $i -lt $COMP_CWORD ]]; then
|
138
|
+
trace " dashdash seen"
|
139
|
+
dashdashseen=yes
|
140
|
+
state=arg
|
141
|
+
word=$arg
|
142
|
+
elif [[ -z "$dashdashseen" && "${arg:0:2}" == "--" ]]; then
|
143
|
+
arg=${arg:2}
|
144
|
+
if [[ "$arg" == *"="* ]]; then
|
145
|
+
optname=${arg%%=*}
|
146
|
+
val=${arg##*=}
|
147
|
+
trace " long opt: optname='$optname' val='$val'"
|
148
|
+
state=arg
|
149
|
+
argtype=$(echo "$optargs" | awk -F "-$optname=" '{print $2}' | cut -d' ' -f1)
|
150
|
+
word=$val
|
151
|
+
prefix="--$optname="
|
152
|
+
else
|
153
|
+
optname=$arg
|
154
|
+
val=
|
155
|
+
trace " long opt: optname='$optname'"
|
156
|
+
state=longopt
|
157
|
+
word=--$optname
|
158
|
+
|
159
|
+
if [[ "$optargs" == *"-$optname="* && $i -lt $COMP_CWORD ]]; then
|
160
|
+
i=$(( $i + 1 ))
|
161
|
+
state=arg
|
162
|
+
argtype=$(echo "$optargs" | awk -F "-$optname=" '{print $2}' | cut -d' ' -f1)
|
163
|
+
word=${argv[$i]}
|
164
|
+
trace " takes arg (consume argv[$i], word='$word')"
|
165
|
+
fi
|
166
|
+
fi
|
167
|
+
elif [[ -z "$dashdashseen" && "${arg:0:1}" == "-" ]]; then
|
168
|
+
trace " short opt group"
|
169
|
+
state=shortopt
|
170
|
+
word=$arg
|
171
|
+
|
172
|
+
local j=1
|
173
|
+
while [[ $j -lt ${#arg} ]]; do
|
174
|
+
optname=${arg:$j:1}
|
175
|
+
trace " consider index $j: optname '$optname'"
|
176
|
+
|
177
|
+
if [[ "$optargs" == *"-$optname="* ]]; then
|
178
|
+
argtype=$(echo "$optargs" | awk -F "-$optname=" '{print $2}' | cut -d' ' -f1)
|
179
|
+
if [[ $(( $j + 1 )) -lt ${#arg} ]]; then
|
180
|
+
state=arg
|
181
|
+
word=${arg:$(( $j + 1 ))}
|
182
|
+
trace " takes arg (rest of this arg, word='$word', argtype='$argtype')"
|
183
|
+
elif [[ $i -lt $COMP_CWORD ]]; then
|
184
|
+
state=arg
|
185
|
+
i=$(( $i + 1 ))
|
186
|
+
word=${argv[$i]}
|
187
|
+
trace " takes arg (word='$word', argtype='$argtype')"
|
188
|
+
fi
|
189
|
+
break
|
190
|
+
fi
|
191
|
+
|
192
|
+
j=$(( $j + 1 ))
|
193
|
+
done
|
194
|
+
elif [[ $i -lt $COMP_CWORD && -n "$arg" ]] && $(echo "$allsubcmds" | grep -w "$arg" >/dev/null); then
|
195
|
+
trace " complete subcmd: recurse _dashdash_complete"
|
196
|
+
_dashdash_complete $(( $i + 1 )) "${context}__${arg/-/_}"
|
197
|
+
return
|
198
|
+
else
|
199
|
+
trace " not an opt or a complete subcmd"
|
200
|
+
state=arg
|
201
|
+
word=$arg
|
202
|
+
nargs=$(( $nargs + 1 ))
|
203
|
+
if [[ ${#argtypes[@]} -gt 0 ]]; then
|
204
|
+
argtype="${argtypes[$(( $nargs - 1 ))]}"
|
205
|
+
if [[ -z "$argtype" ]]; then
|
206
|
+
# If we have more args than argtypes, we use the
|
207
|
+
# last type.
|
208
|
+
argtype="${argtypes[@]: -1:1}"
|
209
|
+
fi
|
210
|
+
fi
|
211
|
+
fi
|
212
|
+
|
213
|
+
trace " state=$state prefix='$prefix' word='$word'"
|
214
|
+
i=$(( $i + 1 ))
|
215
|
+
done
|
216
|
+
|
217
|
+
trace " parsed: state=$state optname='$optname' argtype='$argtype' prefix='$prefix' word='$word' dashdashseen=$dashdashseen"
|
218
|
+
local compgen_opts=
|
219
|
+
if [[ -n "$prefix" ]]; then
|
220
|
+
compgen_opts="$compgen_opts -P $prefix"
|
221
|
+
fi
|
222
|
+
|
223
|
+
case $state in
|
224
|
+
shortopt)
|
225
|
+
compgen $compgen_opts -W "$shortopts $longopts" -- "$word"
|
226
|
+
;;
|
227
|
+
longopt)
|
228
|
+
compgen $compgen_opts -W "$longopts" -- "$word"
|
229
|
+
;;
|
230
|
+
arg)
|
231
|
+
# If we don't know what completion to do, then emit nothing. We
|
232
|
+
# expect that we are running with:
|
233
|
+
# complete -o default ...
|
234
|
+
# where "default" means: "Use Readline's default completion if
|
235
|
+
# the compspec generates no matches." This gives us the good filename
|
236
|
+
# completion, completion in subshells/backticks.
|
237
|
+
#
|
238
|
+
# We cannot support an argtype="directory" because
|
239
|
+
# compgen -S '/' -A directory -- "$word"
|
240
|
+
# doesn't give a satisfying result. It doesn't stop at the trailing '/'
|
241
|
+
# so you cannot descend into dirs.
|
242
|
+
if [[ "${word:0:1}" == '$' ]]; then
|
243
|
+
# By default, Bash will complete '$<TAB>' to all envvars. Apparently
|
244
|
+
# 'complete -o default' does *not* give us that. The following
|
245
|
+
# gets *close* to the same completions: '-A export' misses envvars
|
246
|
+
# like "PS1".
|
247
|
+
trace " completing envvars"
|
248
|
+
compgen $compgen_opts -P '$' -A export -- "${word:1}"
|
249
|
+
elif [[ -z "$argtype" ]]; then
|
250
|
+
# Only include opts in completions if $word is not empty.
|
251
|
+
# This is to avoid completing the leading '-', which foils
|
252
|
+
# using 'default' completion.
|
253
|
+
if [[ -n "$dashdashseen" ]]; then
|
254
|
+
trace " completing subcmds, if any (no argtype, dashdash seen)"
|
255
|
+
compgen $compgen_opts -W "$subcmds" -- "$word"
|
256
|
+
elif [[ -z "$word" ]]; then
|
257
|
+
trace " completing subcmds, if any (no argtype, empty word)"
|
258
|
+
compgen $compgen_opts -W "$subcmds" -- "$word"
|
259
|
+
else
|
260
|
+
trace " completing opts & subcmds (no argtype)"
|
261
|
+
compgen $compgen_opts -W "$shortopts $longopts $subcmds" -- "$word"
|
262
|
+
fi
|
263
|
+
elif [[ $argtype == "none" ]]; then
|
264
|
+
# We want *no* completions, i.e. some way to get the active
|
265
|
+
# 'complete -o default' to not do filename completion.
|
266
|
+
trace " completing 'none' (hack to imply no completions)"
|
267
|
+
echo "##-no completions-##"
|
268
|
+
elif [[ $argtype == "file" ]]; then
|
269
|
+
# 'complete -o default' gives the best filename completion, at least
|
270
|
+
# on Mac.
|
271
|
+
trace " completing 'file' (let 'complete -o default' handle it)"
|
272
|
+
echo ""
|
273
|
+
elif ! type complete_$argtype 2>/dev/null >/dev/null; then
|
274
|
+
trace " completing '$argtype' (fallback to default b/c complete_$argtype is unknown)"
|
275
|
+
echo ""
|
276
|
+
else
|
277
|
+
trace " completing custom '$argtype'"
|
278
|
+
completions=$(complete_$argtype "$word")
|
279
|
+
if [[ -z "$completions" ]]; then
|
280
|
+
trace " no custom '$argtype' completions"
|
281
|
+
# These are in alpha order so they show up correctly.
|
282
|
+
echo "##-no -$argtype- completions-##"
|
283
|
+
else
|
284
|
+
echo $completions
|
285
|
+
fi
|
286
|
+
fi
|
287
|
+
;;
|
288
|
+
*)
|
289
|
+
trace " unknown state: $state"
|
290
|
+
;;
|
291
|
+
esac
|
292
|
+
}
|
293
|
+
|
294
|
+
|
295
|
+
trace ""
|
296
|
+
trace "-- $(date)"
|
297
|
+
#trace "\$IFS: '$IFS'"
|
298
|
+
#trace "\$@: '$@'"
|
299
|
+
#trace "COMP_WORDBREAKS: '$COMP_WORDBREAKS'"
|
300
|
+
trace "COMP_CWORD: '$COMP_CWORD'"
|
301
|
+
trace "COMP_LINE: '$COMP_LINE'"
|
302
|
+
trace "COMP_POINT: $COMP_POINT"
|
303
|
+
|
304
|
+
# Guard against negative COMP_CWORD. This is a Bash bug at least on
|
305
|
+
# Mac 10.10.4's bash. See
|
306
|
+
# <https://lists.gnu.org/archive/html/bug-bash/2009-07/msg00125.html>.
|
307
|
+
if [[ $COMP_CWORD -lt 0 ]]; then
|
308
|
+
trace "abort on negative COMP_CWORD"
|
309
|
+
exit 1;
|
310
|
+
fi
|
311
|
+
|
312
|
+
# I don't know how to do array manip on argv vars,
|
313
|
+
# so copy over to argv array to work on them.
|
314
|
+
shift # the leading '--'
|
315
|
+
i=0
|
316
|
+
len=$#
|
317
|
+
while [[ $# -gt 0 ]]; do
|
318
|
+
argv[$i]=$1
|
319
|
+
shift;
|
320
|
+
i=$(( $i + 1 ))
|
321
|
+
done
|
322
|
+
trace "argv: '${argv[@]}'"
|
323
|
+
trace "argv[COMP_CWORD-1]: '${argv[$(( $COMP_CWORD - 1 ))]}'"
|
324
|
+
trace "argv[COMP_CWORD]: '${argv[$COMP_CWORD]}'"
|
325
|
+
trace "argv len: '$len'"
|
326
|
+
|
327
|
+
_dashdash_complete 1 ""
|
328
|
+
}
|
329
|
+
|
330
|
+
|
331
|
+
# ---- mainline
|
332
|
+
|
333
|
+
# Note: This if-block to help work with 'compdef' and 'compctl' is
|
334
|
+
# adapted from 'npm completion'.
|
335
|
+
if type complete &>/dev/null; then
|
336
|
+
function _{{name}}_completion {
|
337
|
+
local _log_file=/dev/null
|
338
|
+
[[ -z "$_{{name}}_log" ]] || _log_file="$_{{name}}_log"
|
339
|
+
COMPREPLY=($(COMP_CWORD="$COMP_CWORD" \
|
340
|
+
COMP_LINE="$COMP_LINE" \
|
341
|
+
COMP_POINT="$COMP_POINT" \
|
342
|
+
_{{name}}_completer -- "${COMP_WORDS[@]}" \
|
343
|
+
2>$_log_file)) || return $?
|
344
|
+
}
|
345
|
+
complete -o default -F _{{name}}_completion {{name}}
|
346
|
+
elif type compdef &>/dev/null; then
|
347
|
+
function _{{name}}_completion {
|
348
|
+
local _log_file=/dev/null
|
349
|
+
[[ -z "$_{{name}}_log" ]] || _log_file="$_{{name}}_log"
|
350
|
+
compadd -- $(COMP_CWORD=$((CURRENT-1)) \
|
351
|
+
COMP_LINE=$BUFFER \
|
352
|
+
COMP_POINT=0 \
|
353
|
+
_{{name}}_completer -- "${words[@]}" \
|
354
|
+
2>$_log_file)
|
355
|
+
}
|
356
|
+
compdef _{{name}}_completion {{name}}
|
357
|
+
elif type compctl &>/dev/null; then
|
358
|
+
function _{{name}}_completion {
|
359
|
+
local cword line point words si
|
360
|
+
read -Ac words
|
361
|
+
read -cn cword
|
362
|
+
let cword-=1
|
363
|
+
read -l line
|
364
|
+
read -ln point
|
365
|
+
local _log_file=/dev/null
|
366
|
+
[[ -z "$_{{name}}_log" ]] || _log_file="$_{{name}}_log"
|
367
|
+
reply=($(COMP_CWORD="$cword" \
|
368
|
+
COMP_LINE="$line" \
|
369
|
+
COMP_POINT="$point" \
|
370
|
+
_{{name}}_completer -- "${words[@]}" \
|
371
|
+
2>$_log_file)) || return $?
|
372
|
+
}
|
373
|
+
compctl -K _{{name}}_completion {{name}}
|
374
|
+
fi
|
375
|
+
|
376
|
+
|
377
|
+
##
|
378
|
+
## This is a Bash completion file for the '{{name}}' command. You can install
|
379
|
+
## with either:
|
380
|
+
##
|
381
|
+
## cp FILE /usr/local/etc/bash_completion.d/{{name}} # Mac
|
382
|
+
## cp FILE /etc/bash_completion.d/{{name}} # Linux
|
383
|
+
##
|
384
|
+
## or:
|
385
|
+
##
|
386
|
+
## cp FILE > ~/.{{name}}.completion
|
387
|
+
## echo "source ~/.{{name}}.completion" >> ~/.bashrc
|
388
|
+
##
|