@hyperone/cli-ext-config-autocomplete
Advanced tools
Comparing version 2.0.13 to 2.0.14
@@ -1,1 +0,1 @@ | ||
!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=6)}([function(e,t){e.exports=require("@hyperone/cli-framework")},function(e,t){e.exports=require("fs")},function(e,t){e.exports=require("path")},function(e){e.exports=JSON.parse('{"name":"@hyperone/cli-ext-config-autocomplete","version":"2.0.13","description":"Extension to manage autocompletion of CLI.","main":"dist/index.js","browser":"index.js","scripts":{"prepack":"NODE_ENV=production webpack","build":"webpack","watch":"webpack --watch","clean":"rm dist -rf"},"devDependencies":{"webpack":"^4.43.0","webpack-cli":"^3.3.12","webpack-dev-server":"^3.11.0"},"author":"Adam Dobrawy","license":"MIT","dependencies":{"@hyperone/cli-core":"^2.0.13","@hyperone/cli-framework":"^2.0.13","shlex":"^2.0.2"},"gitHead":"9f7621663b4418ffaf570e6a0d025f4b73ec2626","publishConfig":{"access":"public"}}')},function(e,t,n){"use strict";class o{constructor(e){this.i=0,this.string=e,this.whitespace=" \t\r\n",this.quotes="'\"",this.escapes="\\",this.escapedQuotes='"',this.ansiCQuotes=!0,this.localeQuotes=!0,this.debug=!1}readChar(){return this.string.charAt(this.i++)}processEscapes(e,t,n){if(!n&&!this.escapedQuotes.includes(t))return e;let o="["+this.escapes.replace(/(.)/g,"\\$1")+"]";if(!n&&this.escapedQuotes.includes(t)){let n=new RegExp(o+"("+o+"|\\"+t+")","g");return e.replace(n,"$1")}if(n){let t={"([\\\\'\"?])":e=>e,a:()=>"",b:()=>"\b","e|E":()=>"",f:()=>"\f",n:()=>"\n",r:()=>"\r",t:()=>"\t",v:()=>"\v","([0-7]{1,3})":e=>String.fromCharCode(parseInt(e,8)),"x([0-9a-fA-F]{1,2})":e=>String.fromCharCode(parseInt(e,16)),"u([0-9a-fA-F]{1,4})":e=>String.fromCharCode(parseInt(e,16)),"U([0-9a-fA-F]{1,8})":e=>String.fromCharCode(parseInt(e,16)),"c(.)":e=>"?"===e?"":"@"===e?"\0":String.fromCharCode(31&e.charCodeAt(0))},n=new RegExp(o+"("+Object.keys(t).join("|")+")","g");return e.replace(n,(function(e,n){for(let e in t){let o=new RegExp("^"+e+"$").exec(n);if(null!==o)return t[e].apply(null,o.slice(1))}}))}}*[Symbol.iterator](){let e,t=!1,n=!1,o=!1,r=-2;for(this.debug&&console.log("full input:",">"+this.string+"<");;){const i=this.i,s=this.readChar();if(this.debug&&console.log("position:",i,"input:",">"+s+"<","accumulated:",e,"inQuote:",t,"inDollarQuote:",n,"lastDollar:",r,"escaped:",o),""===s){if(t)throw new Error("Got EOF while in a quoted string");if(o)throw new Error("Got EOF while in an escape sequence");return void(void 0!==e&&(yield e))}if(o)"\n"===s||(e=t?(e||"")+o+s:(e||"")+s),o=!1;else if(!this.escapes.includes(s)||t&&!1===n&&!this.escapedQuotes.includes(t))if(!1===t)this.quotes.includes(s)?(t=s,r===i-1&&("'"!==s||this.ansiCQuotes)&&('"'!==s||this.localeQuotes)&&(n=s),e=e||"",!1!==n&&(e=e.slice(0,-1))):(!1===t&&"$"===s&&(r=i),this.whitespace.includes(s)?(void 0!==e&&(yield e),e=void 0):e=(e||"")+s);else{if(s===t){e=this.processEscapes(e,t,"'"===n),t=!1,n=!1;continue}e=(e||"")+s}else o=s}}}t.split=function(e){return Array.from(new o(e))},t.quote=function(e){if(""===e)return"''";return/[^\w@%\-+=:,./]/.test(e)?"'"+e.replace(/'/g,"'\"'\"'")+"'":e}},function(e,t){e.exports=require("os")},function(e,t,n){"use strict";n.r(t);var o=n(0),r=n(4);const i=(e,t)=>e.filter(e=>e.startsWith(t)).join("\n");var s=new o.Command({name:"comply",summary:"List suggestion for command",options:[{name:"cmd",required:!0}],handler:async(e,t)=>{let n=t;for(;n.parent;)n=n.parent;const o=Object(r.split)(e._all.cmd),s=o[o.length-1];let a,c,l,u=n;for(c=1;c<o.length&&u.findCommand&&(l=await u.loadCommands(),a=o[c],l.some(e=>e.name==a));c++)u=l.find(e=>e.name==a);if(s.startsWith("-")){const e=(await u.getOptions()).map(e=>"--"+e.name);return i(e,s)}if(u.findCommand&&l){const e=l.map(e=>e.name);return i(e,a)}return i([],s)}}),a=n(1),c=n.n(a),l=n(2),u=n.n(l),p=n(5),d=n.n(p),f=new o.Command({name:"install",summary:"Update shell configuration to support autocomplete",description:"Only the Bash shell is currently supported. Let us know if you need support from other shells.",handler:async(e,t)=>{const n=["_cli()","{",`words=$(IFS=" "; ${process.pkg?process.argv[0]:`${process.argv[0]} ${process.argv[1]}`} config autocomplete comply --cmd "\${COMP_WORDS[*]}")`,'COMPREPLY=( $(compgen -W "${words}" -- ${cur}) )',"return 0","}","complete -F _cli h1"].join("\n");await c.a.promises.mkdir(await t.device.dataDir(),{recursive:!0});const o=u.a.join(await t.device.dataDir(),"completion.sh");await c.a.promises.writeFile(o,n,{mode:493});const r=[`# begin ${t.device.scope} completion`,"source "+o,`# end ${t.device.scope} completion`].join("\n");t.device.log("Completion shim saved in path "+o);const i=u.a.join(d.a.homedir(),".bash_profile");await c.a.promises.writeFile(i,r,{flag:"a"}),t.device.log("Completion appended loader in path "+i)}});t.default={name:n(3).name,version:n(3).version,load:async e=>e.loadHook.push(()=>{const t=new o.Category({name:"autocomplete",summary:"Manage autocomplete of CLI"});e.addCommand(t),t.loadHook.push(()=>{t.addCommand(s),t.addCommand(f)})})}}]); | ||
!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=6)}([function(e,t){e.exports=require("@hyperone/cli-framework")},function(e,t){e.exports=require("fs")},function(e,t){e.exports=require("path")},function(e){e.exports=JSON.parse('{"name":"@hyperone/cli-ext-config-autocomplete","version":"2.0.14","description":"Extension to manage autocompletion of CLI.","main":"dist/index.js","browser":"index.js","scripts":{"prepack":"NODE_ENV=production webpack","build":"webpack","watch":"webpack --watch","clean":"rm dist -rf"},"devDependencies":{"webpack":"^4.43.0","webpack-cli":"^3.3.12","webpack-dev-server":"^3.11.0"},"author":"Adam Dobrawy","license":"MIT","dependencies":{"@hyperone/cli-core":"^2.0.14","@hyperone/cli-framework":"^2.0.14","shlex":"^2.0.2"},"gitHead":"8a06a2020264c832a69e967bf25996889b8c5820","publishConfig":{"access":"public"}}')},function(e,t,n){"use strict";class o{constructor(e){this.i=0,this.string=e,this.whitespace=" \t\r\n",this.quotes="'\"",this.escapes="\\",this.escapedQuotes='"',this.ansiCQuotes=!0,this.localeQuotes=!0,this.debug=!1}readChar(){return this.string.charAt(this.i++)}processEscapes(e,t,n){if(!n&&!this.escapedQuotes.includes(t))return e;let o="["+this.escapes.replace(/(.)/g,"\\$1")+"]";if(!n&&this.escapedQuotes.includes(t)){let n=new RegExp(o+"("+o+"|\\"+t+")","g");return e.replace(n,"$1")}if(n){let t={"([\\\\'\"?])":e=>e,a:()=>"",b:()=>"\b","e|E":()=>"",f:()=>"\f",n:()=>"\n",r:()=>"\r",t:()=>"\t",v:()=>"\v","([0-7]{1,3})":e=>String.fromCharCode(parseInt(e,8)),"x([0-9a-fA-F]{1,2})":e=>String.fromCharCode(parseInt(e,16)),"u([0-9a-fA-F]{1,4})":e=>String.fromCharCode(parseInt(e,16)),"U([0-9a-fA-F]{1,8})":e=>String.fromCharCode(parseInt(e,16)),"c(.)":e=>"?"===e?"":"@"===e?"\0":String.fromCharCode(31&e.charCodeAt(0))},n=new RegExp(o+"("+Object.keys(t).join("|")+")","g");return e.replace(n,(function(e,n){for(let e in t){let o=new RegExp("^"+e+"$").exec(n);if(null!==o)return t[e].apply(null,o.slice(1))}}))}}*[Symbol.iterator](){let e,t=!1,n=!1,o=!1,r=-2;for(this.debug&&console.log("full input:",">"+this.string+"<");;){const i=this.i,s=this.readChar();if(this.debug&&console.log("position:",i,"input:",">"+s+"<","accumulated:",e,"inQuote:",t,"inDollarQuote:",n,"lastDollar:",r,"escaped:",o),""===s){if(t)throw new Error("Got EOF while in a quoted string");if(o)throw new Error("Got EOF while in an escape sequence");return void(void 0!==e&&(yield e))}if(o)"\n"===s||(e=t?(e||"")+o+s:(e||"")+s),o=!1;else if(!this.escapes.includes(s)||t&&!1===n&&!this.escapedQuotes.includes(t))if(!1===t)this.quotes.includes(s)?(t=s,r===i-1&&("'"!==s||this.ansiCQuotes)&&('"'!==s||this.localeQuotes)&&(n=s),e=e||"",!1!==n&&(e=e.slice(0,-1))):(!1===t&&"$"===s&&(r=i),this.whitespace.includes(s)?(void 0!==e&&(yield e),e=void 0):e=(e||"")+s);else{if(s===t){e=this.processEscapes(e,t,"'"===n),t=!1,n=!1;continue}e=(e||"")+s}else o=s}}}t.split=function(e){return Array.from(new o(e))},t.quote=function(e){if(""===e)return"''";return/[^\w@%\-+=:,./]/.test(e)?"'"+e.replace(/'/g,"'\"'\"'")+"'":e}},function(e,t){e.exports=require("os")},function(e,t,n){"use strict";n.r(t);var o=n(0),r=n(4);const i=(e,t)=>e.filter(e=>e.startsWith(t)).join("\n");var s=new o.Command({name:"comply",summary:"List suggestion for command",options:[{name:"cmd",required:!0}],handler:async(e,t)=>{let n=t;for(;n.parent;)n=n.parent;const o=Object(r.split)(e._all.cmd),s=o[o.length-1];let a,c,l,u=n;for(c=1;c<o.length&&u.findCommand&&(l=await u.loadCommands(),a=o[c],l.some(e=>e.name==a));c++)u=l.find(e=>e.name==a);if(s.startsWith("-")){const e=(await u.getOptions()).map(e=>"--"+e.name);return i(e,s)}if(u.findCommand&&l){const e=l.map(e=>e.name);return i(e,a)}return i([],s)}}),a=n(1),c=n.n(a),l=n(2),u=n.n(l),p=n(5),d=n.n(p),f=new o.Command({name:"install",summary:"Update shell configuration to support autocomplete",description:"Only the Bash shell is currently supported. Let us know if you need support from other shells.",handler:async(e,t)=>{const n=["_cli()","{",`words=$(IFS=" "; ${process.pkg?process.argv[0]:`${process.argv[0]} ${process.argv[1]}`} config autocomplete comply --cmd "\${COMP_WORDS[*]}")`,'COMPREPLY=( $(compgen -W "${words}" -- ${cur}) )',"return 0","}","complete -F _cli h1"].join("\n");await c.a.promises.mkdir(await t.device.dataDir(),{recursive:!0});const o=u.a.join(await t.device.dataDir(),"completion.sh");await c.a.promises.writeFile(o,n,{mode:493});const r=[`# begin ${t.device.scope} completion`,"source "+o,`# end ${t.device.scope} completion`].join("\n");t.device.log("Completion shim saved in path "+o);const i=u.a.join(d.a.homedir(),".bash_profile");await c.a.promises.writeFile(i,r,{flag:"a"}),t.device.log("Completion appended loader in path "+i)}});t.default={name:n(3).name,version:n(3).version,load:async e=>e.loadHook.push(()=>{const t=new o.Category({name:"autocomplete",summary:"Manage autocomplete of CLI"});e.addCommand(t),t.loadHook.push(()=>{t.addCommand(s),t.addCommand(f)})})}}]); |
{ | ||
"name": "@hyperone/cli-ext-config-autocomplete", | ||
"version": "2.0.13", | ||
"version": "2.0.14", | ||
"description": "Extension to manage autocompletion of CLI.", | ||
@@ -21,7 +21,7 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@hyperone/cli-core": "^2.0.13", | ||
"@hyperone/cli-framework": "^2.0.13", | ||
"@hyperone/cli-core": "^2.0.14", | ||
"@hyperone/cli-framework": "^2.0.14", | ||
"shlex": "^2.0.2" | ||
}, | ||
"gitHead": "9f7621663b4418ffaf570e6a0d025f4b73ec2626", | ||
"gitHead": "8a06a2020264c832a69e967bf25996889b8c5820", | ||
"publishConfig": { | ||
@@ -28,0 +28,0 @@ "access": "public" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package