import{r as e,t}from"./chunk-74CEPOFO-V0JXh91S.mjs";var n={name:`dirname`,summary:`strip last component from file name`,usage:`dirname [OPTION] NAME...`,options:[`    --help       display this help and exit`]},r={name:`dirname`,async execute(r,i){if(t(r))return e(n);let a=r.filter(e=>!e.startsWith(`-`));if(a.length===0)return{stdout:``,stderr:`dirname: missing operand
`,exitCode:1};let o=[];for(let e of a){let t=e.replace(/\/+$/,``),n=t.lastIndexOf(`/`);n===-1?o.push(`.`):n===0?o.push(`/`):o.push(t.slice(0,n))}return{stdout:`${o.join(`
`)}
`,stderr:``,exitCode:0}}},i={name:`dirname`,flags:[],needsArgs:!0};export{r as n,i as t};
//# sourceMappingURL=chunk-4Q4SM6WR-CAvCnPq5.mjs.map