import{r as e,t}from"./chunk-74CEPOFO-V0JXh91S.mjs";var n={name:`alias`,summary:`define or display aliases`,usage:`alias [name[=value] ...]`,options:[`    --help display this help and exit`]},r=`BASH_ALIAS_`,i={name:`alias`,async execute(i,a){if(t(i))return e(n);if(i.length===0){let e=``;for(let[t,n]of a.env)if(t.startsWith(r)){let i=t.slice(r.length);e+=`alias ${i}='${n}'
`}return{stdout:e,stderr:``,exitCode:0}}let o=i[0]===`--`?i.slice(1):i;for(let e of o){let t=e.indexOf(`=`);if(t===-1){let t=r+e;return a.env.get(t)?{stdout:`alias ${e}='${a.env.get(t)}'
`,stderr:``,exitCode:0}:{stdout:``,stderr:`alias: ${e}: not found
`,exitCode:1}}else{let n=e.slice(0,t),i=e.slice(t+1);(i.startsWith(`'`)&&i.endsWith(`'`)||i.startsWith(`"`)&&i.endsWith(`"`))&&(i=i.slice(1,-1)),a.env.set(r+n,i)}}return{stdout:``,stderr:``,exitCode:0}}},a={name:`unalias`,async execute(n,i){if(t(n))return e({name:`unalias`,summary:`remove alias definitions`,usage:`unalias name [name ...]`,options:[`-a      remove all aliases`,`    --help display this help and exit`]});if(n.length===0)return{stdout:``,stderr:`unalias: usage: unalias [-a] name [name ...]
`,exitCode:1};if(n[0]===`-a`){for(let e of i.env.keys())e.startsWith(r)&&i.env.delete(e);return{stdout:``,stderr:``,exitCode:0}}let a=n[0]===`--`?n.slice(1):n,o=!1,s=``;for(let e of a){let t=r+e;i.env.get(t)?i.env.delete(t):(s+=`unalias: ${e}: not found
`,o=!0)}return{stdout:``,stderr:s,exitCode:o?1:0}}},o={name:`alias`,flags:[]},s={name:`unalias`,flags:[{flag:`-a`,type:`boolean`}]};export{o as i,s as n,i as r,a as t};
//# sourceMappingURL=chunk-VOBGTVA6-D6fSjWnx.mjs.map