just-bash 2.0.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/AGENTS.md +131 -3
- package/dist/bin/chunks/{alias-ZAQAKC5X.js → alias-PCMLRCRW.js} +1 -1
- package/dist/bin/chunks/{awk2-A73ZNFXJ.js → awk2-D2US2LMM.js} +1 -1
- package/dist/bin/{shell/chunks/base64-JPITV4MD.js → chunks/base64-RJX7MYGG.js} +1 -1
- package/dist/bin/{shell/chunks/basename-IYEP3AMY.js → chunks/basename-SO5MVUEX.js} +1 -1
- package/dist/bin/chunks/{bash-WZYHIZP6.js → bash-UT3MT5UU.js} +1 -1
- package/dist/bin/{shell/chunks/cat-XILYL7NW.js → chunks/cat-7TVSOZLU.js} +1 -1
- package/dist/bin/{shell/chunks/chmod-EXWX4N7Y.js → chunks/chmod-3DIKREF7.js} +1 -1
- package/dist/bin/chunks/chunk-ACRTDIBO.js +6 -0
- package/dist/bin/chunks/chunk-KGOUQS5A.js +2 -0
- package/dist/bin/chunks/chunk-OQRRF62X.js +10 -0
- package/dist/bin/chunks/chunk-QSDVMMYI.js +21 -0
- package/dist/bin/chunks/{clear-2APRIRCF.js → clear-CI7A5IXQ.js} +1 -1
- package/dist/bin/chunks/column-TSFEMTG6.js +8 -0
- package/dist/bin/chunks/{comm-KY3COLF5.js → comm-CPIFQTKY.js} +1 -1
- package/dist/bin/{shell/chunks/cp-HES4UN7K.js → chunks/cp-XXWRVG2D.js} +1 -1
- package/dist/bin/chunks/{curl-BN5M3BUX.js → curl-LCMREE7R.js} +1 -1
- package/dist/bin/chunks/{cut-JSIPAKOX.js → cut-VCKWLT2T.js} +1 -1
- package/dist/bin/chunks/{date-CU4J7GHI.js → date-IQLPMFYI.js} +1 -1
- package/dist/bin/{shell/chunks/diff-W4JRNHXW.js → chunks/diff-GI3QVUGD.js} +1 -1
- package/dist/bin/chunks/{dirname-UTCUUILN.js → dirname-EES7TR26.js} +1 -1
- package/dist/bin/chunks/{du-2JU3PUTM.js → du-ZONJJZUK.js} +1 -1
- package/dist/bin/{shell/chunks/echo-HKLPYMNC.js → chunks/echo-WSKTON6U.js} +1 -1
- package/dist/bin/chunks/{env-2SBJNP7X.js → env-YLLSNZZN.js} +1 -1
- package/dist/bin/chunks/expand-77K5HH2M.js +11 -0
- package/dist/bin/chunks/{expr-M74QZQ6C.js → expr-RMGXYNQJ.js} +1 -1
- package/dist/bin/chunks/{file-QPD3U2H7.js → file-XMPFXMUJ.js} +1 -1
- package/dist/bin/{shell/chunks/find-TRBVCSI6.js → chunks/find-P6UQXFKX.js} +1 -1
- package/dist/bin/chunks/fold-452R4I2C.js +12 -0
- package/dist/bin/{shell/chunks/grep-BEZRXAWL.js → chunks/grep-L5HBHEEQ.js} +1 -1
- package/dist/bin/chunks/{gzip-VLTXZB2V.js → gzip-MNCJB6OR.js} +1 -1
- package/dist/bin/chunks/{head-YGMY3DHE.js → head-DYK37Z24.js} +1 -1
- package/dist/bin/chunks/{help-UEF7LW7F.js → help-7C5JICNL.js} +1 -1
- package/dist/bin/{shell/chunks/history-OGBCIAR5.js → chunks/history-G5C2J2OY.js} +1 -1
- package/dist/bin/chunks/{hostname-CV7CGKRN.js → hostname-WXDKRL2Z.js} +1 -1
- package/dist/bin/chunks/{html-to-markdown-HTGML4TH.js → html-to-markdown-EPEXKI4B.js} +1 -1
- package/dist/bin/chunks/join-3IXMEGNA.js +14 -0
- package/dist/bin/chunks/jq-MTQKMJJI.js +16 -0
- package/dist/bin/chunks/{ln-RUR4ALOJ.js → ln-EFFNQ3RY.js} +1 -1
- package/dist/bin/chunks/{ls-GU5227KE.js → ls-FSSC77F4.js} +1 -1
- package/dist/bin/chunks/{md5sum-C7WDEYN5.js → md5sum-VGXAOUBA.js} +1 -1
- package/dist/bin/chunks/{mkdir-4OYU22AA.js → mkdir-XJABRAUN.js} +1 -1
- package/dist/bin/chunks/{mv-H3S4FEWR.js → mv-3ATZ2ABL.js} +1 -1
- package/dist/bin/chunks/nl-DSM3NUGM.js +17 -0
- package/dist/bin/{shell/chunks/od-TXTSFFJY.js → chunks/od-SLM7SRWU.js} +1 -1
- package/dist/bin/chunks/{paste-HHCFASL4.js → paste-FT6WBQZG.js} +1 -1
- package/dist/bin/chunks/{printf-2JFCUFOA.js → printf-HWUQKYUM.js} +1 -1
- package/dist/bin/{shell/chunks/pwd-T5Q3JEBO.js → chunks/pwd-53KG2MCJ.js} +1 -1
- package/dist/bin/chunks/{readlink-M44TLMFS.js → readlink-VL3R4LAM.js} +1 -1
- package/dist/bin/chunks/rev-VP42N2JN.js +7 -0
- package/dist/bin/chunks/{rm-R4M647EC.js → rm-2PKAWTSQ.js} +1 -1
- package/dist/bin/chunks/{sed-QLLAZYHH.js → sed-5LQMJYRJ.js} +1 -1
- package/dist/bin/chunks/{seq-GJMQM7SP.js → seq-AVK43XM2.js} +1 -1
- package/dist/bin/chunks/{sha1sum-WKCGV66X.js → sha1sum-BIUH233Z.js} +1 -1
- package/dist/bin/{shell/chunks/sha256sum-3ZDGP5WC.js → chunks/sha256sum-SUIK2MT2.js} +1 -1
- package/dist/bin/chunks/{sleep-OJPODQGM.js → sleep-O5BOTJGJ.js} +1 -1
- package/dist/bin/chunks/{sort-JL33INQB.js → sort-J5ARYV56.js} +1 -1
- package/dist/bin/chunks/split-JJFZRWRC.js +16 -0
- package/dist/bin/{shell/chunks/stat-CR2INBC2.js → chunks/stat-UEQ7KMY5.js} +1 -1
- package/dist/bin/chunks/strings-ZEKN6D4Q.js +14 -0
- package/dist/bin/chunks/{tac-F4GC3MAI.js → tac-KNRFDAY7.js} +1 -1
- package/dist/bin/chunks/{tail-BYPLMYMZ.js → tail-BES27CZT.js} +1 -1
- package/dist/bin/chunks/{tee-HOMRRC3X.js → tee-ZFIT2GTM.js} +1 -1
- package/dist/bin/{shell/chunks/timeout-MYKG34DQ.js → chunks/timeout-JED4EKFH.js} +1 -1
- package/dist/bin/{shell/chunks/touch-3ZANYAXI.js → chunks/touch-TSNAXMZ2.js} +1 -1
- package/dist/bin/{shell/chunks/tr-E66N7IS2.js → chunks/tr-MBLEXZBI.js} +1 -1
- package/dist/bin/chunks/{tree-EE2PYIMV.js → tree-ESVATRDW.js} +1 -1
- package/dist/bin/chunks/{true-OWPVS7U4.js → true-OVATH2SQ.js} +1 -1
- package/dist/bin/chunks/unexpand-BFVYAPOU.js +11 -0
- package/dist/bin/chunks/{uniq-F5NP3LLU.js → uniq-7JNZWE5D.js} +1 -1
- package/dist/bin/chunks/{wc-NBMNJDZL.js → wc-OFU3HUEZ.js} +1 -1
- package/dist/bin/chunks/{which-6MRG2UCF.js → which-73KOOLC6.js} +1 -1
- package/dist/bin/chunks/xan-ASGSTJP4.js +140 -0
- package/dist/bin/chunks/xan-view-YGORUYA2.js +2 -0
- package/dist/bin/chunks/{xargs-EMY5BOJ2.js → xargs-WIJC4RTG.js} +1 -1
- package/dist/bin/chunks/yq-MF2SNFGL.js +287 -0
- package/dist/bin/just-bash.js +47 -47
- package/dist/bin/shell/chunks/{alias-ZAQAKC5X.js → alias-PCMLRCRW.js} +1 -1
- package/dist/bin/shell/chunks/{awk2-A73ZNFXJ.js → awk2-D2US2LMM.js} +1 -1
- package/dist/bin/{chunks/base64-JPITV4MD.js → shell/chunks/base64-RJX7MYGG.js} +1 -1
- package/dist/bin/{chunks/basename-IYEP3AMY.js → shell/chunks/basename-SO5MVUEX.js} +1 -1
- package/dist/bin/shell/chunks/{bash-WZYHIZP6.js → bash-UT3MT5UU.js} +1 -1
- package/dist/bin/{chunks/cat-XILYL7NW.js → shell/chunks/cat-7TVSOZLU.js} +1 -1
- package/dist/bin/{chunks/chmod-EXWX4N7Y.js → shell/chunks/chmod-3DIKREF7.js} +1 -1
- package/dist/bin/shell/chunks/chunk-ACRTDIBO.js +6 -0
- package/dist/bin/shell/chunks/chunk-KGOUQS5A.js +2 -0
- package/dist/bin/shell/chunks/chunk-OQRRF62X.js +10 -0
- package/dist/bin/shell/chunks/chunk-QSDVMMYI.js +21 -0
- package/dist/bin/shell/chunks/{clear-2APRIRCF.js → clear-CI7A5IXQ.js} +1 -1
- package/dist/bin/shell/chunks/column-TSFEMTG6.js +8 -0
- package/dist/bin/shell/chunks/{comm-KY3COLF5.js → comm-CPIFQTKY.js} +1 -1
- package/dist/bin/{chunks/cp-HES4UN7K.js → shell/chunks/cp-XXWRVG2D.js} +1 -1
- package/dist/bin/shell/chunks/{curl-BN5M3BUX.js → curl-LCMREE7R.js} +1 -1
- package/dist/bin/shell/chunks/{cut-JSIPAKOX.js → cut-VCKWLT2T.js} +1 -1
- package/dist/bin/shell/chunks/{date-CU4J7GHI.js → date-IQLPMFYI.js} +1 -1
- package/dist/bin/{chunks/diff-W4JRNHXW.js → shell/chunks/diff-GI3QVUGD.js} +1 -1
- package/dist/bin/shell/chunks/{dirname-UTCUUILN.js → dirname-EES7TR26.js} +1 -1
- package/dist/bin/shell/chunks/{du-2JU3PUTM.js → du-ZONJJZUK.js} +1 -1
- package/dist/bin/{chunks/echo-HKLPYMNC.js → shell/chunks/echo-WSKTON6U.js} +1 -1
- package/dist/bin/shell/chunks/{env-2SBJNP7X.js → env-YLLSNZZN.js} +1 -1
- package/dist/bin/shell/chunks/expand-77K5HH2M.js +11 -0
- package/dist/bin/shell/chunks/{expr-M74QZQ6C.js → expr-RMGXYNQJ.js} +1 -1
- package/dist/bin/shell/chunks/{file-QPD3U2H7.js → file-XMPFXMUJ.js} +1 -1
- package/dist/bin/{chunks/find-TRBVCSI6.js → shell/chunks/find-P6UQXFKX.js} +1 -1
- package/dist/bin/shell/chunks/fold-452R4I2C.js +12 -0
- package/dist/bin/{chunks/grep-BEZRXAWL.js → shell/chunks/grep-L5HBHEEQ.js} +1 -1
- package/dist/bin/shell/chunks/{gzip-VLTXZB2V.js → gzip-MNCJB6OR.js} +1 -1
- package/dist/bin/shell/chunks/{head-YGMY3DHE.js → head-DYK37Z24.js} +1 -1
- package/dist/bin/shell/chunks/{help-UEF7LW7F.js → help-7C5JICNL.js} +1 -1
- package/dist/bin/{chunks/history-OGBCIAR5.js → shell/chunks/history-G5C2J2OY.js} +1 -1
- package/dist/bin/shell/chunks/{hostname-CV7CGKRN.js → hostname-WXDKRL2Z.js} +1 -1
- package/dist/bin/shell/chunks/{html-to-markdown-HTGML4TH.js → html-to-markdown-EPEXKI4B.js} +1 -1
- package/dist/bin/shell/chunks/join-3IXMEGNA.js +14 -0
- package/dist/bin/shell/chunks/jq-MTQKMJJI.js +16 -0
- package/dist/bin/shell/chunks/{ln-RUR4ALOJ.js → ln-EFFNQ3RY.js} +1 -1
- package/dist/bin/shell/chunks/{ls-GU5227KE.js → ls-FSSC77F4.js} +1 -1
- package/dist/bin/shell/chunks/{md5sum-C7WDEYN5.js → md5sum-VGXAOUBA.js} +1 -1
- package/dist/bin/shell/chunks/{mkdir-4OYU22AA.js → mkdir-XJABRAUN.js} +1 -1
- package/dist/bin/shell/chunks/{mv-H3S4FEWR.js → mv-3ATZ2ABL.js} +1 -1
- package/dist/bin/shell/chunks/nl-DSM3NUGM.js +17 -0
- package/dist/bin/{chunks/od-TXTSFFJY.js → shell/chunks/od-SLM7SRWU.js} +1 -1
- package/dist/bin/shell/chunks/{paste-HHCFASL4.js → paste-FT6WBQZG.js} +1 -1
- package/dist/bin/shell/chunks/{printf-2JFCUFOA.js → printf-HWUQKYUM.js} +1 -1
- package/dist/bin/{chunks/pwd-T5Q3JEBO.js → shell/chunks/pwd-53KG2MCJ.js} +1 -1
- package/dist/bin/shell/chunks/{readlink-M44TLMFS.js → readlink-VL3R4LAM.js} +1 -1
- package/dist/bin/shell/chunks/rev-VP42N2JN.js +7 -0
- package/dist/bin/shell/chunks/{rm-R4M647EC.js → rm-2PKAWTSQ.js} +1 -1
- package/dist/bin/shell/chunks/{sed-QLLAZYHH.js → sed-5LQMJYRJ.js} +1 -1
- package/dist/bin/shell/chunks/{seq-GJMQM7SP.js → seq-AVK43XM2.js} +1 -1
- package/dist/bin/shell/chunks/{sha1sum-WKCGV66X.js → sha1sum-BIUH233Z.js} +1 -1
- package/dist/bin/{chunks/sha256sum-3ZDGP5WC.js → shell/chunks/sha256sum-SUIK2MT2.js} +1 -1
- package/dist/bin/shell/chunks/{sleep-OJPODQGM.js → sleep-O5BOTJGJ.js} +1 -1
- package/dist/bin/shell/chunks/{sort-JL33INQB.js → sort-J5ARYV56.js} +1 -1
- package/dist/bin/shell/chunks/split-JJFZRWRC.js +16 -0
- package/dist/bin/{chunks/stat-CR2INBC2.js → shell/chunks/stat-UEQ7KMY5.js} +1 -1
- package/dist/bin/shell/chunks/strings-ZEKN6D4Q.js +14 -0
- package/dist/bin/shell/chunks/{tac-F4GC3MAI.js → tac-KNRFDAY7.js} +1 -1
- package/dist/bin/shell/chunks/{tail-BYPLMYMZ.js → tail-BES27CZT.js} +1 -1
- package/dist/bin/shell/chunks/{tee-HOMRRC3X.js → tee-ZFIT2GTM.js} +1 -1
- package/dist/bin/{chunks/timeout-MYKG34DQ.js → shell/chunks/timeout-JED4EKFH.js} +1 -1
- package/dist/bin/{chunks/touch-3ZANYAXI.js → shell/chunks/touch-TSNAXMZ2.js} +1 -1
- package/dist/bin/{chunks/tr-E66N7IS2.js → shell/chunks/tr-MBLEXZBI.js} +1 -1
- package/dist/bin/shell/chunks/{tree-EE2PYIMV.js → tree-ESVATRDW.js} +1 -1
- package/dist/bin/shell/chunks/{true-OWPVS7U4.js → true-OVATH2SQ.js} +1 -1
- package/dist/bin/shell/chunks/unexpand-BFVYAPOU.js +11 -0
- package/dist/bin/shell/chunks/{uniq-F5NP3LLU.js → uniq-7JNZWE5D.js} +1 -1
- package/dist/bin/shell/chunks/{wc-NBMNJDZL.js → wc-OFU3HUEZ.js} +1 -1
- package/dist/bin/shell/chunks/{which-6MRG2UCF.js → which-73KOOLC6.js} +1 -1
- package/dist/bin/shell/chunks/xan-ASGSTJP4.js +140 -0
- package/dist/bin/shell/chunks/xan-view-YGORUYA2.js +2 -0
- package/dist/bin/shell/chunks/{xargs-EMY5BOJ2.js → xargs-WIJC4RTG.js} +1 -1
- package/dist/bin/shell/chunks/yq-MF2SNFGL.js +287 -0
- package/dist/bin/shell/shell.js +78 -78
- package/dist/bundle/browser.js +486 -393
- package/dist/bundle/chunks/{alias-JFIUWFGE.js → alias-4UGRF4DM.js} +1 -1
- package/dist/bundle/chunks/{awk2-QWBT4IFJ.js → awk2-46RTIZKB.js} +1 -1
- package/dist/bundle/chunks/{base64-TUA2XORD.js → base64-F5R4G5EG.js} +1 -1
- package/dist/bundle/chunks/{basename-5UVU5RXR.js → basename-CFA5ZIGT.js} +1 -1
- package/dist/bundle/chunks/{bash-BASUPKHJ.js → bash-ZILV3VHA.js} +1 -1
- package/dist/bundle/chunks/{cat-47EP4IAV.js → cat-CE7XIAD2.js} +1 -1
- package/dist/bundle/chunks/{chmod-XJXFAD4M.js → chmod-FBHLEIY6.js} +1 -1
- package/dist/bundle/chunks/chunk-4JO5BKO4.js +5 -0
- package/dist/bundle/chunks/chunk-DXB73IDG.js +1 -0
- package/dist/bundle/chunks/chunk-SYMJJMQ4.js +20 -0
- package/dist/bundle/chunks/chunk-U4UYWYTO.js +9 -0
- package/dist/bundle/chunks/{clear-XD3TJRVQ.js → clear-VT2LJIDX.js} +1 -1
- package/dist/bundle/chunks/column-XPDNNO5Y.js +7 -0
- package/dist/bundle/chunks/{comm-KSJ4BBRQ.js → comm-AXQM7FFF.js} +1 -1
- package/dist/bundle/chunks/{cp-37OVLNLD.js → cp-PBJT3GBF.js} +1 -1
- package/dist/bundle/chunks/{curl-C43O5WQS.js → curl-TVZH24MD.js} +1 -1
- package/dist/bundle/chunks/{cut-FIZRELKC.js → cut-MCCSW2TZ.js} +1 -1
- package/dist/bundle/chunks/{date-NN5C354M.js → date-PN3CMG7K.js} +1 -1
- package/dist/bundle/chunks/{diff-GLRVCAKJ.js → diff-ZLJYSBRK.js} +1 -1
- package/dist/bundle/chunks/{dirname-U2KVUSQY.js → dirname-YPJLCQYA.js} +1 -1
- package/dist/bundle/chunks/{du-KRAFOIQK.js → du-3NURMGXT.js} +1 -1
- package/dist/bundle/chunks/{echo-WUKBESC7.js → echo-VUHWYV6L.js} +1 -1
- package/dist/bundle/chunks/{env-MSPSPGCD.js → env-EG5SQSAQ.js} +1 -1
- package/dist/bundle/chunks/expand-VSTNOVF5.js +10 -0
- package/dist/bundle/chunks/{expr-HYOCSWK6.js → expr-DG4E7SIS.js} +1 -1
- package/dist/bundle/chunks/{file-LQXX6P4Y.js → file-AWZ3TUFP.js} +1 -1
- package/dist/bundle/chunks/{find-GM7FJ4D3.js → find-QJDJJ5KW.js} +1 -1
- package/dist/bundle/chunks/fold-6CFXIPYZ.js +11 -0
- package/dist/bundle/chunks/{grep-ZJVDG3FA.js → grep-4K5T3MYL.js} +1 -1
- package/dist/bundle/chunks/{gzip-UQS7KRTV.js → gzip-7QAS5P2Y.js} +1 -1
- package/dist/bundle/chunks/{head-6PAUYCDP.js → head-FZ6IQHYW.js} +1 -1
- package/dist/bundle/chunks/{help-5E6PYJWQ.js → help-75YOGKM4.js} +1 -1
- package/dist/bundle/chunks/{history-SG6VRATI.js → history-MQDK2OPD.js} +1 -1
- package/dist/bundle/chunks/{hostname-K4BA3P6X.js → hostname-NWR32CGF.js} +1 -1
- package/dist/bundle/chunks/{html-to-markdown-ZSZ34PAN.js → html-to-markdown-ZK6GQVSL.js} +1 -1
- package/dist/bundle/chunks/join-X3QYPZUA.js +13 -0
- package/dist/bundle/chunks/jq-QAA4WF2O.js +15 -0
- package/dist/bundle/chunks/{ln-XFYHBIFL.js → ln-Y7YB677N.js} +1 -1
- package/dist/bundle/chunks/{ls-JGYJQA2Y.js → ls-CS3TIKWR.js} +1 -1
- package/dist/bundle/chunks/{md5sum-PIH6F3O3.js → md5sum-LJHKXLVT.js} +1 -1
- package/dist/bundle/chunks/{mkdir-HA2FJX4O.js → mkdir-7UKY4B3B.js} +1 -1
- package/dist/bundle/chunks/{mv-7I62SB3I.js → mv-FXHEKRTB.js} +1 -1
- package/dist/bundle/chunks/nl-KWQGFZH5.js +16 -0
- package/dist/bundle/chunks/{od-SOCTFI2F.js → od-ECWXNUB4.js} +1 -1
- package/dist/bundle/chunks/{paste-QBGVCQFT.js → paste-QTGVEPH5.js} +1 -1
- package/dist/bundle/chunks/{printf-HBP44PXI.js → printf-VG2POOXB.js} +1 -1
- package/dist/bundle/chunks/{pwd-CEF235GL.js → pwd-AC4P3JKI.js} +1 -1
- package/dist/bundle/chunks/{readlink-MQIMKDSA.js → readlink-EM4O3U4P.js} +1 -1
- package/dist/bundle/chunks/rev-FKUV5GH5.js +6 -0
- package/dist/bundle/chunks/{rm-NF3FNLAY.js → rm-I2SRVF7H.js} +1 -1
- package/dist/bundle/chunks/{sed-H2RWPMTM.js → sed-ZKODWZ6F.js} +1 -1
- package/dist/bundle/chunks/{seq-VKYIUOPJ.js → seq-5VRIVQYP.js} +1 -1
- package/dist/bundle/chunks/{sha1sum-HVHNZSEC.js → sha1sum-NRUZZ4Q6.js} +1 -1
- package/dist/bundle/chunks/{sha256sum-REOOJORK.js → sha256sum-5ZGJ4NJL.js} +1 -1
- package/dist/bundle/chunks/{sleep-AFN3PHJW.js → sleep-AK4QE4WR.js} +1 -1
- package/dist/bundle/chunks/{sort-XODGFZC4.js → sort-PMLMEZ4E.js} +1 -1
- package/dist/bundle/chunks/split-YBTFW7MT.js +15 -0
- package/dist/bundle/chunks/{stat-FVFLDQGP.js → stat-IVQBBOKN.js} +1 -1
- package/dist/bundle/chunks/strings-LRU5XCFP.js +13 -0
- package/dist/bundle/chunks/{tac-VIFKNLII.js → tac-2X4JLF4W.js} +1 -1
- package/dist/bundle/chunks/{tail-QXKYHAML.js → tail-PD4RZR6J.js} +1 -1
- package/dist/bundle/chunks/{tee-W5HCCBPO.js → tee-2QU4NRSJ.js} +1 -1
- package/dist/bundle/chunks/{timeout-XAA3N7CF.js → timeout-X3X3N6IE.js} +1 -1
- package/dist/bundle/chunks/{touch-FOE745V2.js → touch-MVQSKQKT.js} +1 -1
- package/dist/bundle/chunks/{tr-LMLGE4IE.js → tr-EDGW5FG6.js} +1 -1
- package/dist/bundle/chunks/{tree-WBUGLVP5.js → tree-5TYW7S7K.js} +1 -1
- package/dist/bundle/chunks/{true-6LGCG4EY.js → true-CNJ54NE6.js} +1 -1
- package/dist/bundle/chunks/unexpand-I7A2VXFD.js +10 -0
- package/dist/bundle/chunks/{uniq-7PFWPNWK.js → uniq-ONGDGSEB.js} +1 -1
- package/dist/bundle/chunks/{wc-GV5WUREX.js → wc-Y5MNUNQQ.js} +1 -1
- package/dist/bundle/chunks/{which-KHFYPBWW.js → which-M5MQ6QXQ.js} +1 -1
- package/dist/bundle/chunks/xan-B3RI2BDO.js +139 -0
- package/dist/bundle/chunks/xan-view-33AU6NPN.js +1 -0
- package/dist/bundle/chunks/{xargs-NQBNFMCT.js → xargs-2IMBHM4N.js} +1 -1
- package/dist/bundle/chunks/yq-KANM4MD2.js +286 -0
- package/dist/bundle/index.js +41 -41
- package/dist/commands/column/column.d.ts +9 -0
- package/dist/commands/expand/expand.d.ts +10 -0
- package/dist/commands/expand/unexpand.d.ts +10 -0
- package/dist/commands/fold/fold.d.ts +10 -0
- package/dist/commands/join/join.d.ts +10 -0
- package/dist/commands/nl/nl.d.ts +10 -0
- package/dist/commands/query-engine/evaluator.d.ts +25 -0
- package/dist/commands/query-engine/index.d.ts +8 -0
- package/dist/commands/{jq → query-engine}/parser.d.ts +3 -2
- package/dist/commands/registry.d.ts +1 -1
- package/dist/commands/rev/rev.d.ts +11 -0
- package/dist/commands/split/split.d.ts +10 -0
- package/dist/commands/strings/strings.d.ts +10 -0
- package/dist/commands/xan/aggregation.d.ts +20 -0
- package/dist/commands/xan/csv.d.ts +16 -0
- package/dist/commands/xan/moonblade-parser.d.ts +80 -0
- package/dist/commands/xan/moonblade-to-jq.d.ts +12 -0
- package/dist/commands/xan/subcommands.d.ts +15 -0
- package/dist/commands/xan/xan-agg.d.ts +8 -0
- package/dist/commands/xan/xan-columns.d.ts +8 -0
- package/dist/commands/xan/xan-core.d.ts +10 -0
- package/dist/commands/xan/xan-data.d.ts +52 -0
- package/dist/commands/xan/xan-filter.d.ts +8 -0
- package/dist/commands/xan/xan-map.d.ts +11 -0
- package/dist/commands/xan/xan-reshape.d.ts +40 -0
- package/dist/commands/xan/xan-simple.d.ts +40 -0
- package/dist/commands/xan/xan-utils.d.ts +19 -0
- package/dist/commands/xan/xan-view.d.ts +12 -0
- package/dist/commands/xan/xan.d.ts +8 -0
- package/dist/commands/yq/formats.d.ts +64 -0
- package/dist/commands/yq/yq.d.ts +11 -0
- package/package.json +10 -3
- package/dist/bin/chunks/chunk-SJXDWN5X.js +0 -2
- package/dist/bin/chunks/jq-TRAUXD47.js +0 -19
- package/dist/bin/shell/chunks/chunk-SJXDWN5X.js +0 -2
- package/dist/bin/shell/chunks/jq-TRAUXD47.js +0 -19
- package/dist/bundle/chunks/chunk-2RUN43TJ.js +0 -1
- package/dist/bundle/chunks/jq-PO3DWIV2.js +0 -18
- package/dist/commands/jq/evaluator.d.ts +0 -18
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as I}from"./chunk-TA7RUHGQ.js";import{a as F,b as H}from"./chunk-GTNBSMZR.js";import"./chunk-SJXDWN5X.js";var L=(n,t,e)=>{let s=n instanceof RegExp?_(n,e):n,r=t instanceof RegExp?_(t,e):t,i=s!==null&&r!=null&&ut(s,r,e);return i&&{start:i[0],end:i[1],pre:e.slice(0,i[0]),body:e.slice(i[0]+s.length,i[1]),post:e.slice(i[1]+r.length)}},_=(n,t)=>{let e=t.match(n);return e?e[0]:null},ut=(n,t,e)=>{let s,r,i,o,l,h=e.indexOf(n),f=e.indexOf(t,h+1),u=h;if(h>=0&&f>0){if(n===t)return[h,f];for(s=[],i=e.length;u>=0&&!l;){if(u===h)s.push(u),h=e.indexOf(n,u+1);else if(s.length===1){let d=s.pop();d!==void 0&&(l=[d,f])}else r=s.pop(),r!==void 0&&r<i&&(i=r,o=f),f=e.indexOf(t,u+1);u=h<f&&h>=0?h:f}s.length&&o!==void 0&&(l=[i,o])}return l};var J="\0SLASH"+Math.random()+"\0",U="\0OPEN"+Math.random()+"\0",G="\0CLOSE"+Math.random()+"\0",Z="\0COMMA"+Math.random()+"\0",K="\0PERIOD"+Math.random()+"\0",ft=new RegExp(J,"g"),pt=new RegExp(U,"g"),dt=new RegExp(G,"g"),gt=new RegExp(Z,"g"),mt=new RegExp(K,"g"),yt=/\\\\/g,wt=/\\{/g,St=/\\}/g,xt=/\\,/g,$t=/\\./g;function k(n){return isNaN(n)?n.charCodeAt(0):parseInt(n,10)}function bt(n){return n.replace(yt,J).replace(wt,U).replace(St,G).replace(xt,Z).replace($t,K)}function Et(n){return n.replace(ft,"\\").replace(pt,"{").replace(dt,"}").replace(gt,",").replace(mt,".")}function V(n){if(!n)return[""];let t=[],e=L("{","}",n);if(!e)return n.split(",");let{pre:s,body:r,post:i}=e,o=s.split(",");o[o.length-1]+="{"+r+"}";let l=V(i);return i.length&&(o[o.length-1]+=l.shift(),o.push.apply(o,l)),t.push.apply(t,o),t}function X(n){return n?(n.slice(0,2)==="{}"&&(n="\\{\\}"+n.slice(2)),P(bt(n),!0).map(Et)):[]}function At(n){return"{"+n+"}"}function vt(n){return/^-?0\d/.test(n)}function Mt(n,t){return n<=t}function Nt(n,t){return n>=t}function P(n,t){let e=[],s=L("{","}",n);if(!s)return[n];let r=s.pre,i=s.post.length?P(s.post,!1):[""];if(/\$$/.test(s.pre))for(let o=0;o<i.length;o++){let l=r+"{"+s.body+"}"+i[o];e.push(l)}else{let o=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),h=o||l,f=s.body.indexOf(",")>=0;if(!h&&!f)return s.post.match(/,(?!,).*\}/)?(n=s.pre+"{"+s.body+G+s.post,P(n)):[n];let u;if(h)u=s.body.split(/\.\./);else if(u=V(s.body),u.length===1&&u[0]!==void 0&&(u=P(u[0],!1).map(At),u.length===1))return i.map(a=>s.pre+u[0]+a);let d;if(h&&u[0]!==void 0&&u[1]!==void 0){let a=k(u[0]),c=k(u[1]),g=Math.max(u[0].length,u[1].length),p=u.length===3&&u[2]!==void 0?Math.abs(k(u[2])):1,m=Mt;c<a&&(p*=-1,m=Nt);let w=u.some(vt);d=[];for(let S=a;m(S,c);S+=p){let x;if(l)x=String.fromCharCode(S),x==="\\"&&(x="");else if(x=String(S),w){let b=g-x.length;if(b>0){let v=new Array(b+1).join("0");S<0?x="-"+v+x.slice(1):x=v+x}}d.push(x)}}else{d=[];for(let a=0;a<u.length;a++)d.push.apply(d,P(u[a],!1))}for(let a=0;a<d.length;a++)for(let c=0;c<i.length;c++){let g=r+d[a]+i[c];(!t||h||g)&&e.push(g)}}return e}var O=n=>{if(typeof n!="string")throw new TypeError("invalid pattern");if(n.length>65536)throw new TypeError("pattern is too long")};var Tt={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},z=n=>n.replace(/[[\]\\-]/g,"\\$&"),Pt=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Y=n=>n.join(""),Q=(n,t)=>{let e=t;if(n.charAt(e)!=="[")throw new Error("not in a brace expression");let s=[],r=[],i=e+1,o=!1,l=!1,h=!1,f=!1,u=e,d="";t:for(;i<n.length;){let p=n.charAt(i);if((p==="!"||p==="^")&&i===e+1){f=!0,i++;continue}if(p==="]"&&o&&!h){u=i+1;break}if(o=!0,p==="\\"&&!h){h=!0,i++;continue}if(p==="["&&!h){for(let[m,[y,w,S]]of Object.entries(Tt))if(n.startsWith(m,i)){if(d)return["$.",!1,n.length-e,!0];i+=m.length,S?r.push(y):s.push(y),l=l||w;continue t}}if(h=!1,d){p>d?s.push(z(d)+"-"+z(p)):p===d&&s.push(z(p)),d="",i++;continue}if(n.startsWith("-]",i+1)){s.push(z(p+"-")),i+=2;continue}if(n.startsWith("-",i+1)){d=p,i+=2;continue}s.push(z(p)),i++}if(u<i)return["",!1,0,!1];if(!s.length&&!r.length)return["$.",!1,n.length-e,!0];if(r.length===0&&s.length===1&&/^\\?.$/.test(s[0])&&!f){let p=s[0].length===2?s[0].slice(-1):s[0];return[Pt(p),!1,u-e,!1]}let a="["+(f?"^":"")+Y(s)+"]",c="["+(f?"":"^")+Y(r)+"]";return[s.length&&r.length?"("+a+"|"+c+")":s.length?a:c,l,u-e,!0]};var M=(n,{windowsPathsNoEscape:t=!1,magicalBraces:e=!0}={})=>e?t?n.replace(/\[([^\/\\])\]/g,"$1"):n.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"):t?n.replace(/\[([^\/\\{}])\]/g,"$1"):n.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1");var Ot=new Set(["!","?","+","*","@"]),tt=n=>Ot.has(n),zt="(?!(?:^|/)\\.\\.?(?:$|/))",C="(?!\\.)",Ct=new Set(["[","."]),Rt=new Set(["..","."]),Dt=new Set("().*{}+?[]^$\\!"),Wt=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),B="[^/]",et=B+"*?",st=B+"+?",N=class n{type;#s;#n;#r=!1;#t=[];#e;#o;#c;#a=!1;#i;#h;#u=!1;constructor(t,e,s={}){this.type=t,t&&(this.#n=!0),this.#e=e,this.#s=this.#e?this.#e.#s:this,this.#i=this.#s===this?s:this.#s.#i,this.#c=this.#s===this?[]:this.#s.#c,t==="!"&&!this.#s.#a&&this.#c.push(this),this.#o=this.#e?this.#e.#t.length:0}get hasMagic(){if(this.#n!==void 0)return this.#n;for(let t of this.#t)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#n=!0;return this.#n}toString(){return this.#h!==void 0?this.#h:this.type?this.#h=this.type+"("+this.#t.map(t=>String(t)).join("|")+")":this.#h=this.#t.map(t=>String(t)).join("")}#p(){if(this!==this.#s)throw new Error("should only call on root");if(this.#a)return this;this.toString(),this.#a=!0;let t;for(;t=this.#c.pop();){if(t.type!=="!")continue;let e=t,s=e.#e;for(;s;){for(let r=e.#o+1;!s.type&&r<s.#t.length;r++)for(let i of t.#t){if(typeof i=="string")throw new Error("string part in extglob AST??");i.copyIn(s.#t[r])}e=s,s=e.#e}}return this}push(...t){for(let e of t)if(e!==""){if(typeof e!="string"&&!(e instanceof n&&e.#e===this))throw new Error("invalid part: "+e);this.#t.push(e)}}toJSON(){let t=this.type===null?this.#t.slice().map(e=>typeof e=="string"?e:e.toJSON()):[this.type,...this.#t.map(e=>e.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#s||this.#s.#a&&this.#e?.type==="!")&&t.push({}),t}isStart(){if(this.#s===this)return!0;if(!this.#e?.isStart())return!1;if(this.#o===0)return!0;let t=this.#e;for(let e=0;e<this.#o;e++){let s=t.#t[e];if(!(s instanceof n&&s.type==="!"))return!1}return!0}isEnd(){if(this.#s===this||this.#e?.type==="!")return!0;if(!this.#e?.isEnd())return!1;if(!this.type)return this.#e?.isEnd();let t=this.#e?this.#e.#t.length:0;return this.#o===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let e=new n(this.type,t);for(let s of this.#t)e.copyIn(s);return e}static#l(t,e,s,r){let i=!1,o=!1,l=-1,h=!1;if(e.type===null){let c=s,g="";for(;c<t.length;){let p=t.charAt(c++);if(i||p==="\\"){i=!i,g+=p;continue}if(o){c===l+1?(p==="^"||p==="!")&&(h=!0):p==="]"&&!(c===l+2&&h)&&(o=!1),g+=p;continue}else if(p==="["){o=!0,l=c,h=!1,g+=p;continue}if(!r.noext&&tt(p)&&t.charAt(c)==="("){e.push(g),g="";let m=new n(p,e);c=n.#l(t,m,c,r),e.push(m);continue}g+=p}return e.push(g),c}let f=s+1,u=new n(null,e),d=[],a="";for(;f<t.length;){let c=t.charAt(f++);if(i||c==="\\"){i=!i,a+=c;continue}if(o){f===l+1?(c==="^"||c==="!")&&(h=!0):c==="]"&&!(f===l+2&&h)&&(o=!1),a+=c;continue}else if(c==="["){o=!0,l=f,h=!1,a+=c;continue}if(tt(c)&&t.charAt(f)==="("){u.push(a),a="";let g=new n(c,u);u.push(g),f=n.#l(t,g,f,r);continue}if(c==="|"){u.push(a),a="",d.push(u),u=new n(null,e);continue}if(c===")")return a===""&&e.#t.length===0&&(e.#u=!0),u.push(a),a="",e.push(...d,u),f;a+=c}return e.type=null,e.#n=void 0,e.#t=[t.substring(s-1)],f}static fromGlob(t,e={}){let s=new n(null,void 0,e);return n.#l(t,s,0,e),s}toMMPattern(){if(this!==this.#s)return this.#s.toMMPattern();let t=this.toString(),[e,s,r,i]=this.toRegExpSource();if(!(r||this.#n||this.#i.nocase&&!this.#i.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return s;let l=(this.#i.nocase?"i":"")+(i?"u":"");return Object.assign(new RegExp(`^${e}$`,l),{_src:e,_glob:t})}get options(){return this.#i}toRegExpSource(t){let e=t??!!this.#i.dot;if(this.#s===this&&this.#p(),!this.type){let h=this.isStart()&&this.isEnd()&&!this.#t.some(c=>typeof c!="string"),f=this.#t.map(c=>{let[g,p,m,y]=typeof c=="string"?n.#d(c,this.#n,h):c.toRegExpSource(t);return this.#n=this.#n||m,this.#r=this.#r||y,g}).join(""),u="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&Rt.has(this.#t[0]))){let g=Ct,p=e&&g.has(f.charAt(0))||f.startsWith("\\.")&&g.has(f.charAt(2))||f.startsWith("\\.\\.")&&g.has(f.charAt(4)),m=!e&&!t&&g.has(f.charAt(0));u=p?zt:m?C:""}let d="";return this.isEnd()&&this.#s.#a&&this.#e?.type==="!"&&(d="(?:$|\\/)"),[u+f+d,M(f),this.#n=!!this.#n,this.#r]}let s=this.type==="*"||this.type==="+",r=this.type==="!"?"(?:(?!(?:":"(?:",i=this.#f(e);if(this.isStart()&&this.isEnd()&&!i&&this.type!=="!"){let h=this.toString();return this.#t=[h],this.type=null,this.#n=void 0,[h,M(this.toString()),!1,!1]}let o=!s||t||e||!C?"":this.#f(!0);o===i&&(o=""),o&&(i=`(?:${i})(?:${o})*?`);let l="";if(this.type==="!"&&this.#u)l=(this.isStart()&&!e?C:"")+st;else{let h=this.type==="!"?"))"+(this.isStart()&&!e&&!t?C:"")+et+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;l=r+i+h}return[l,M(i),this.#n=!!this.#n,this.#r]}#f(t){return this.#t.map(e=>{if(typeof e=="string")throw new Error("string type in extglob ast??");let[s,r,i,o]=e.toRegExpSource(t);return this.#r=this.#r||o,s}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join("|")}static#d(t,e,s=!1){let r=!1,i="",o=!1;for(let l=0;l<t.length;l++){let h=t.charAt(l);if(r){r=!1,i+=(Dt.has(h)?"\\":"")+h;continue}if(h==="\\"){l===t.length-1?i+="\\\\":r=!0;continue}if(h==="["){let[f,u,d,a]=Q(t,l);if(d){i+=f,o=o||u,l+=d-1,e=e||a;continue}}if(h==="*"){i+=s&&t==="*"?st:et,e=!0;continue}if(h==="?"){i+=B,e=!0;continue}i+=Wt(h)}return[i,M(t),!!e,o]}};var q=(n,{windowsPathsNoEscape:t=!1,magicalBraces:e=!1}={})=>e?t?n.replace(/[?*()[\]{}]/g,"[$&]"):n.replace(/[?*()[\]\\{}]/g,"\\$&"):t?n.replace(/[?*()[\]]/g,"[$&]"):n.replace(/[?*()[\]\\]/g,"\\$&");var $=(n,t,e={})=>(O(t),!e.nocomment&&t.charAt(0)==="#"?!1:new T(t,e).match(n)),jt=/^\*+([^+@!?\*\[\(]*)$/,Lt=n=>t=>!t.startsWith(".")&&t.endsWith(n),kt=n=>t=>t.endsWith(n),Gt=n=>(n=n.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(n)),Bt=n=>(n=n.toLowerCase(),t=>t.toLowerCase().endsWith(n)),qt=/^\*+\.\*+$/,Ft=n=>!n.startsWith(".")&&n.includes("."),Ht=n=>n!=="."&&n!==".."&&n.includes("."),It=/^\.\*+$/,_t=n=>n!=="."&&n!==".."&&n.startsWith("."),Jt=/^\*+$/,Ut=n=>n.length!==0&&!n.startsWith("."),Zt=n=>n.length!==0&&n!=="."&&n!=="..",Kt=/^\?+([^+@!?\*\[\(]*)?$/,Vt=([n,t=""])=>{let e=rt([n]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},Xt=([n,t=""])=>{let e=ot([n]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},Yt=([n,t=""])=>{let e=ot([n]);return t?s=>e(s)&&s.endsWith(t):e},Qt=([n,t=""])=>{let e=rt([n]);return t?s=>e(s)&&s.endsWith(t):e},rt=([n])=>{let t=n.length;return e=>e.length===t&&!e.startsWith(".")},ot=([n])=>{let t=n.length;return e=>e.length===t&&e!=="."&&e!==".."},at=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",nt={win32:{sep:"\\"},posix:{sep:"/"}},te=at==="win32"?nt.win32.sep:nt.posix.sep;$.sep=te;var A=Symbol("globstar **");$.GLOBSTAR=A;var ee="[^/]",se=ee+"*?",ne="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",ie="(?:(?!(?:\\/|^)\\.).)*?",re=(n,t={})=>e=>$(e,n,t);$.filter=re;var E=(n,t={})=>Object.assign({},n,t),oe=n=>{if(!n||typeof n!="object"||!Object.keys(n).length)return $;let t=$;return Object.assign((s,r,i={})=>t(s,r,E(n,i)),{Minimatch:class extends t.Minimatch{constructor(r,i={}){super(r,E(n,i))}static defaults(r){return t.defaults(E(n,r)).Minimatch}},AST:class extends t.AST{constructor(r,i,o={}){super(r,i,E(n,o))}static fromGlob(r,i={}){return t.AST.fromGlob(r,E(n,i))}},unescape:(s,r={})=>t.unescape(s,E(n,r)),escape:(s,r={})=>t.escape(s,E(n,r)),filter:(s,r={})=>t.filter(s,E(n,r)),defaults:s=>t.defaults(E(n,s)),makeRe:(s,r={})=>t.makeRe(s,E(n,r)),braceExpand:(s,r={})=>t.braceExpand(s,E(n,r)),match:(s,r,i={})=>t.match(s,r,E(n,i)),sep:t.sep,GLOBSTAR:A})};$.defaults=oe;var ct=(n,t={})=>(O(n),t.nobrace||!/\{(?:(?!\{).)*\}/.test(n)?[n]:X(n));$.braceExpand=ct;var ae=(n,t={})=>new T(n,t).makeRe();$.makeRe=ae;var ce=(n,t,e={})=>{let s=new T(t,e);return n=n.filter(r=>s.match(r)),s.options.nonull&&!n.length&&n.push(t),n};$.match=ce;var it=/[?*]|[+@!]\(.*?\)|\[|\]/,he=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),T=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,e={}){O(t),e=e||{},this.options=e,this.pattern=t,this.platform=e.platform||at,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=e.windowsNoMagicRoot!==void 0?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let e of t)if(typeof e!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=(...i)=>console.error(...i)),this.debug(this.pattern,this.globSet);let s=this.globSet.map(i=>this.slashSplit(i));this.globParts=this.preprocess(s),this.debug(this.pattern,this.globParts);let r=this.globParts.map((i,o,l)=>{if(this.isWindows&&this.windowsNoMagicRoot){let h=i[0]===""&&i[1]===""&&(i[2]==="?"||!it.test(i[2]))&&!it.test(i[3]),f=/^[a-z]:/i.test(i[0]);if(h)return[...i.slice(0,4),...i.slice(4).map(u=>this.parse(u))];if(f)return[i[0],...i.slice(1).map(u=>this.parse(u))]}return i.map(h=>this.parse(h))});if(this.debug(this.pattern,r),this.set=r.filter(i=>i.indexOf(!1)===-1),this.isWindows)for(let i=0;i<this.set.length;i++){let o=this.set[i];o[0]===""&&o[1]===""&&this.globParts[i][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let s=0;s<t.length;s++)for(let r=0;r<t[s].length;r++)t[s][r]==="**"&&(t[s][r]="*");let{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):e>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(e=>{let s=-1;for(;(s=e.indexOf("**",s+1))!==-1;){let r=s;for(;e[r+1]==="**";)r++;r!==s&&e.splice(s,r-s)}return e})}levelOneOptimize(t){return t.map(e=>(e=e.reduce((s,r)=>{let i=s[s.length-1];return r==="**"&&i==="**"?s:r===".."&&i&&i!==".."&&i!=="."&&i!=="**"?(s.pop(),s):(s.push(r),s)},[]),e.length===0?[""]:e))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let r=1;r<t.length-1;r++){let i=t[r];r===1&&i===""&&t[0]===""||(i==="."||i==="")&&(e=!0,t.splice(r,1),r--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(e=!0,t.pop())}let s=0;for(;(s=t.indexOf("..",s+1))!==-1;){let r=t[s-1];r&&r!=="."&&r!==".."&&r!=="**"&&(e=!0,t.splice(s-1,2),s-=2)}}while(e);return t.length===0?[""]:t}firstPhasePreProcess(t){let e=!1;do{e=!1;for(let s of t){let r=-1;for(;(r=s.indexOf("**",r+1))!==-1;){let o=r;for(;s[o+1]==="**";)o++;o>r&&s.splice(r+1,o-r);let l=s[r+1],h=s[r+2],f=s[r+3];if(l!==".."||!h||h==="."||h===".."||!f||f==="."||f==="..")continue;e=!0,s.splice(r,1);let u=s.slice(0);u[r]="**",t.push(u),r--}if(!this.preserveMultipleSlashes){for(let o=1;o<s.length-1;o++){let l=s[o];o===1&&l===""&&s[0]===""||(l==="."||l==="")&&(e=!0,s.splice(o,1),o--)}s[0]==="."&&s.length===2&&(s[1]==="."||s[1]==="")&&(e=!0,s.pop())}let i=0;for(;(i=s.indexOf("..",i+1))!==-1;){let o=s[i-1];if(o&&o!=="."&&o!==".."&&o!=="**"){e=!0;let h=i===1&&s[i+1]==="**"?["."]:[];s.splice(i-1,2,...h),s.length===0&&s.push(""),i-=2}}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++)for(let s=e+1;s<t.length;s++){let r=this.partsMatch(t[e],t[s],!this.preserveMultipleSlashes);if(r){t[e]=[],t[s]=r;break}}return t.filter(e=>e.length)}partsMatch(t,e,s=!1){let r=0,i=0,o=[],l="";for(;r<t.length&&i<e.length;)if(t[r]===e[i])o.push(l==="b"?e[i]:t[r]),r++,i++;else if(s&&t[r]==="**"&&e[i]===t[r+1])o.push(t[r]),r++;else if(s&&e[i]==="**"&&t[r]===e[i+1])o.push(e[i]),i++;else if(t[r]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(l==="b")return!1;l="a",o.push(t[r]),r++,i++}else if(e[i]==="*"&&t[r]&&(this.options.dot||!t[r].startsWith("."))&&t[r]!=="**"){if(l==="a")return!1;l="b",o.push(e[i]),r++,i++}else return!1;return t.length===e.length&&o}parseNegate(){if(this.nonegate)return;let t=this.pattern,e=!1,s=0;for(let r=0;r<t.length&&t.charAt(r)==="!";r++)e=!e,s++;s&&(this.pattern=t.slice(s)),this.negate=e}matchOne(t,e,s=!1){let r=this.options;if(this.isWindows){let p=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),m=!p&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),y=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),w=!y&&e[0]===""&&e[1]===""&&e[2]==="?"&&typeof e[3]=="string"&&/^[a-z]:$/i.test(e[3]),S=m?3:p?0:void 0,x=w?3:y?0:void 0;if(typeof S=="number"&&typeof x=="number"){let[b,v]=[t[S],e[x]];b.toLowerCase()===v.toLowerCase()&&(e[x]=b,x>S?e=e.slice(x):S>x&&(t=t.slice(S)))}}let{optimizationLevel:i=1}=this.options;i>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var o=0,l=0,h=t.length,f=e.length;o<h&&l<f;o++,l++){this.debug("matchOne loop");var u=e[l],d=t[o];if(this.debug(e,u,d),u===!1)return!1;if(u===A){this.debug("GLOBSTAR",[e,u,d]);var a=o,c=l+1;if(c===f){for(this.debug("** at the end");o<h;o++)if(t[o]==="."||t[o]===".."||!r.dot&&t[o].charAt(0)===".")return!1;return!0}for(;a<h;){var g=t[a];if(this.debug(`
|
|
2
|
+
import{a as I}from"./chunk-TA7RUHGQ.js";import{a as F,b as H}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var L=(n,t,e)=>{let s=n instanceof RegExp?_(n,e):n,r=t instanceof RegExp?_(t,e):t,i=s!==null&&r!=null&&ut(s,r,e);return i&&{start:i[0],end:i[1],pre:e.slice(0,i[0]),body:e.slice(i[0]+s.length,i[1]),post:e.slice(i[1]+r.length)}},_=(n,t)=>{let e=t.match(n);return e?e[0]:null},ut=(n,t,e)=>{let s,r,i,o,l,h=e.indexOf(n),f=e.indexOf(t,h+1),u=h;if(h>=0&&f>0){if(n===t)return[h,f];for(s=[],i=e.length;u>=0&&!l;){if(u===h)s.push(u),h=e.indexOf(n,u+1);else if(s.length===1){let d=s.pop();d!==void 0&&(l=[d,f])}else r=s.pop(),r!==void 0&&r<i&&(i=r,o=f),f=e.indexOf(t,u+1);u=h<f&&h>=0?h:f}s.length&&o!==void 0&&(l=[i,o])}return l};var J="\0SLASH"+Math.random()+"\0",U="\0OPEN"+Math.random()+"\0",G="\0CLOSE"+Math.random()+"\0",Z="\0COMMA"+Math.random()+"\0",K="\0PERIOD"+Math.random()+"\0",ft=new RegExp(J,"g"),pt=new RegExp(U,"g"),dt=new RegExp(G,"g"),gt=new RegExp(Z,"g"),mt=new RegExp(K,"g"),yt=/\\\\/g,wt=/\\{/g,St=/\\}/g,xt=/\\,/g,$t=/\\./g;function k(n){return isNaN(n)?n.charCodeAt(0):parseInt(n,10)}function bt(n){return n.replace(yt,J).replace(wt,U).replace(St,G).replace(xt,Z).replace($t,K)}function Et(n){return n.replace(ft,"\\").replace(pt,"{").replace(dt,"}").replace(gt,",").replace(mt,".")}function V(n){if(!n)return[""];let t=[],e=L("{","}",n);if(!e)return n.split(",");let{pre:s,body:r,post:i}=e,o=s.split(",");o[o.length-1]+="{"+r+"}";let l=V(i);return i.length&&(o[o.length-1]+=l.shift(),o.push.apply(o,l)),t.push.apply(t,o),t}function X(n){return n?(n.slice(0,2)==="{}"&&(n="\\{\\}"+n.slice(2)),P(bt(n),!0).map(Et)):[]}function At(n){return"{"+n+"}"}function vt(n){return/^-?0\d/.test(n)}function Mt(n,t){return n<=t}function Nt(n,t){return n>=t}function P(n,t){let e=[],s=L("{","}",n);if(!s)return[n];let r=s.pre,i=s.post.length?P(s.post,!1):[""];if(/\$$/.test(s.pre))for(let o=0;o<i.length;o++){let l=r+"{"+s.body+"}"+i[o];e.push(l)}else{let o=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),h=o||l,f=s.body.indexOf(",")>=0;if(!h&&!f)return s.post.match(/,(?!,).*\}/)?(n=s.pre+"{"+s.body+G+s.post,P(n)):[n];let u;if(h)u=s.body.split(/\.\./);else if(u=V(s.body),u.length===1&&u[0]!==void 0&&(u=P(u[0],!1).map(At),u.length===1))return i.map(a=>s.pre+u[0]+a);let d;if(h&&u[0]!==void 0&&u[1]!==void 0){let a=k(u[0]),c=k(u[1]),g=Math.max(u[0].length,u[1].length),p=u.length===3&&u[2]!==void 0?Math.abs(k(u[2])):1,m=Mt;c<a&&(p*=-1,m=Nt);let w=u.some(vt);d=[];for(let S=a;m(S,c);S+=p){let x;if(l)x=String.fromCharCode(S),x==="\\"&&(x="");else if(x=String(S),w){let b=g-x.length;if(b>0){let v=new Array(b+1).join("0");S<0?x="-"+v+x.slice(1):x=v+x}}d.push(x)}}else{d=[];for(let a=0;a<u.length;a++)d.push.apply(d,P(u[a],!1))}for(let a=0;a<d.length;a++)for(let c=0;c<i.length;c++){let g=r+d[a]+i[c];(!t||h||g)&&e.push(g)}}return e}var O=n=>{if(typeof n!="string")throw new TypeError("invalid pattern");if(n.length>65536)throw new TypeError("pattern is too long")};var Tt={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},z=n=>n.replace(/[[\]\\-]/g,"\\$&"),Pt=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Y=n=>n.join(""),Q=(n,t)=>{let e=t;if(n.charAt(e)!=="[")throw new Error("not in a brace expression");let s=[],r=[],i=e+1,o=!1,l=!1,h=!1,f=!1,u=e,d="";t:for(;i<n.length;){let p=n.charAt(i);if((p==="!"||p==="^")&&i===e+1){f=!0,i++;continue}if(p==="]"&&o&&!h){u=i+1;break}if(o=!0,p==="\\"&&!h){h=!0,i++;continue}if(p==="["&&!h){for(let[m,[y,w,S]]of Object.entries(Tt))if(n.startsWith(m,i)){if(d)return["$.",!1,n.length-e,!0];i+=m.length,S?r.push(y):s.push(y),l=l||w;continue t}}if(h=!1,d){p>d?s.push(z(d)+"-"+z(p)):p===d&&s.push(z(p)),d="",i++;continue}if(n.startsWith("-]",i+1)){s.push(z(p+"-")),i+=2;continue}if(n.startsWith("-",i+1)){d=p,i+=2;continue}s.push(z(p)),i++}if(u<i)return["",!1,0,!1];if(!s.length&&!r.length)return["$.",!1,n.length-e,!0];if(r.length===0&&s.length===1&&/^\\?.$/.test(s[0])&&!f){let p=s[0].length===2?s[0].slice(-1):s[0];return[Pt(p),!1,u-e,!1]}let a="["+(f?"^":"")+Y(s)+"]",c="["+(f?"":"^")+Y(r)+"]";return[s.length&&r.length?"("+a+"|"+c+")":s.length?a:c,l,u-e,!0]};var M=(n,{windowsPathsNoEscape:t=!1,magicalBraces:e=!0}={})=>e?t?n.replace(/\[([^\/\\])\]/g,"$1"):n.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"):t?n.replace(/\[([^\/\\{}])\]/g,"$1"):n.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1");var Ot=new Set(["!","?","+","*","@"]),tt=n=>Ot.has(n),zt="(?!(?:^|/)\\.\\.?(?:$|/))",C="(?!\\.)",Ct=new Set(["[","."]),Rt=new Set(["..","."]),Dt=new Set("().*{}+?[]^$\\!"),Wt=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),B="[^/]",et=B+"*?",st=B+"+?",N=class n{type;#s;#n;#r=!1;#t=[];#e;#o;#c;#a=!1;#i;#h;#u=!1;constructor(t,e,s={}){this.type=t,t&&(this.#n=!0),this.#e=e,this.#s=this.#e?this.#e.#s:this,this.#i=this.#s===this?s:this.#s.#i,this.#c=this.#s===this?[]:this.#s.#c,t==="!"&&!this.#s.#a&&this.#c.push(this),this.#o=this.#e?this.#e.#t.length:0}get hasMagic(){if(this.#n!==void 0)return this.#n;for(let t of this.#t)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#n=!0;return this.#n}toString(){return this.#h!==void 0?this.#h:this.type?this.#h=this.type+"("+this.#t.map(t=>String(t)).join("|")+")":this.#h=this.#t.map(t=>String(t)).join("")}#p(){if(this!==this.#s)throw new Error("should only call on root");if(this.#a)return this;this.toString(),this.#a=!0;let t;for(;t=this.#c.pop();){if(t.type!=="!")continue;let e=t,s=e.#e;for(;s;){for(let r=e.#o+1;!s.type&&r<s.#t.length;r++)for(let i of t.#t){if(typeof i=="string")throw new Error("string part in extglob AST??");i.copyIn(s.#t[r])}e=s,s=e.#e}}return this}push(...t){for(let e of t)if(e!==""){if(typeof e!="string"&&!(e instanceof n&&e.#e===this))throw new Error("invalid part: "+e);this.#t.push(e)}}toJSON(){let t=this.type===null?this.#t.slice().map(e=>typeof e=="string"?e:e.toJSON()):[this.type,...this.#t.map(e=>e.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#s||this.#s.#a&&this.#e?.type==="!")&&t.push({}),t}isStart(){if(this.#s===this)return!0;if(!this.#e?.isStart())return!1;if(this.#o===0)return!0;let t=this.#e;for(let e=0;e<this.#o;e++){let s=t.#t[e];if(!(s instanceof n&&s.type==="!"))return!1}return!0}isEnd(){if(this.#s===this||this.#e?.type==="!")return!0;if(!this.#e?.isEnd())return!1;if(!this.type)return this.#e?.isEnd();let t=this.#e?this.#e.#t.length:0;return this.#o===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let e=new n(this.type,t);for(let s of this.#t)e.copyIn(s);return e}static#l(t,e,s,r){let i=!1,o=!1,l=-1,h=!1;if(e.type===null){let c=s,g="";for(;c<t.length;){let p=t.charAt(c++);if(i||p==="\\"){i=!i,g+=p;continue}if(o){c===l+1?(p==="^"||p==="!")&&(h=!0):p==="]"&&!(c===l+2&&h)&&(o=!1),g+=p;continue}else if(p==="["){o=!0,l=c,h=!1,g+=p;continue}if(!r.noext&&tt(p)&&t.charAt(c)==="("){e.push(g),g="";let m=new n(p,e);c=n.#l(t,m,c,r),e.push(m);continue}g+=p}return e.push(g),c}let f=s+1,u=new n(null,e),d=[],a="";for(;f<t.length;){let c=t.charAt(f++);if(i||c==="\\"){i=!i,a+=c;continue}if(o){f===l+1?(c==="^"||c==="!")&&(h=!0):c==="]"&&!(f===l+2&&h)&&(o=!1),a+=c;continue}else if(c==="["){o=!0,l=f,h=!1,a+=c;continue}if(tt(c)&&t.charAt(f)==="("){u.push(a),a="";let g=new n(c,u);u.push(g),f=n.#l(t,g,f,r);continue}if(c==="|"){u.push(a),a="",d.push(u),u=new n(null,e);continue}if(c===")")return a===""&&e.#t.length===0&&(e.#u=!0),u.push(a),a="",e.push(...d,u),f;a+=c}return e.type=null,e.#n=void 0,e.#t=[t.substring(s-1)],f}static fromGlob(t,e={}){let s=new n(null,void 0,e);return n.#l(t,s,0,e),s}toMMPattern(){if(this!==this.#s)return this.#s.toMMPattern();let t=this.toString(),[e,s,r,i]=this.toRegExpSource();if(!(r||this.#n||this.#i.nocase&&!this.#i.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return s;let l=(this.#i.nocase?"i":"")+(i?"u":"");return Object.assign(new RegExp(`^${e}$`,l),{_src:e,_glob:t})}get options(){return this.#i}toRegExpSource(t){let e=t??!!this.#i.dot;if(this.#s===this&&this.#p(),!this.type){let h=this.isStart()&&this.isEnd()&&!this.#t.some(c=>typeof c!="string"),f=this.#t.map(c=>{let[g,p,m,y]=typeof c=="string"?n.#d(c,this.#n,h):c.toRegExpSource(t);return this.#n=this.#n||m,this.#r=this.#r||y,g}).join(""),u="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&Rt.has(this.#t[0]))){let g=Ct,p=e&&g.has(f.charAt(0))||f.startsWith("\\.")&&g.has(f.charAt(2))||f.startsWith("\\.\\.")&&g.has(f.charAt(4)),m=!e&&!t&&g.has(f.charAt(0));u=p?zt:m?C:""}let d="";return this.isEnd()&&this.#s.#a&&this.#e?.type==="!"&&(d="(?:$|\\/)"),[u+f+d,M(f),this.#n=!!this.#n,this.#r]}let s=this.type==="*"||this.type==="+",r=this.type==="!"?"(?:(?!(?:":"(?:",i=this.#f(e);if(this.isStart()&&this.isEnd()&&!i&&this.type!=="!"){let h=this.toString();return this.#t=[h],this.type=null,this.#n=void 0,[h,M(this.toString()),!1,!1]}let o=!s||t||e||!C?"":this.#f(!0);o===i&&(o=""),o&&(i=`(?:${i})(?:${o})*?`);let l="";if(this.type==="!"&&this.#u)l=(this.isStart()&&!e?C:"")+st;else{let h=this.type==="!"?"))"+(this.isStart()&&!e&&!t?C:"")+et+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;l=r+i+h}return[l,M(i),this.#n=!!this.#n,this.#r]}#f(t){return this.#t.map(e=>{if(typeof e=="string")throw new Error("string type in extglob ast??");let[s,r,i,o]=e.toRegExpSource(t);return this.#r=this.#r||o,s}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join("|")}static#d(t,e,s=!1){let r=!1,i="",o=!1;for(let l=0;l<t.length;l++){let h=t.charAt(l);if(r){r=!1,i+=(Dt.has(h)?"\\":"")+h;continue}if(h==="\\"){l===t.length-1?i+="\\\\":r=!0;continue}if(h==="["){let[f,u,d,a]=Q(t,l);if(d){i+=f,o=o||u,l+=d-1,e=e||a;continue}}if(h==="*"){i+=s&&t==="*"?st:et,e=!0;continue}if(h==="?"){i+=B,e=!0;continue}i+=Wt(h)}return[i,M(t),!!e,o]}};var q=(n,{windowsPathsNoEscape:t=!1,magicalBraces:e=!1}={})=>e?t?n.replace(/[?*()[\]{}]/g,"[$&]"):n.replace(/[?*()[\]\\{}]/g,"\\$&"):t?n.replace(/[?*()[\]]/g,"[$&]"):n.replace(/[?*()[\]\\]/g,"\\$&");var $=(n,t,e={})=>(O(t),!e.nocomment&&t.charAt(0)==="#"?!1:new T(t,e).match(n)),jt=/^\*+([^+@!?\*\[\(]*)$/,Lt=n=>t=>!t.startsWith(".")&&t.endsWith(n),kt=n=>t=>t.endsWith(n),Gt=n=>(n=n.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(n)),Bt=n=>(n=n.toLowerCase(),t=>t.toLowerCase().endsWith(n)),qt=/^\*+\.\*+$/,Ft=n=>!n.startsWith(".")&&n.includes("."),Ht=n=>n!=="."&&n!==".."&&n.includes("."),It=/^\.\*+$/,_t=n=>n!=="."&&n!==".."&&n.startsWith("."),Jt=/^\*+$/,Ut=n=>n.length!==0&&!n.startsWith("."),Zt=n=>n.length!==0&&n!=="."&&n!=="..",Kt=/^\?+([^+@!?\*\[\(]*)?$/,Vt=([n,t=""])=>{let e=rt([n]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},Xt=([n,t=""])=>{let e=ot([n]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},Yt=([n,t=""])=>{let e=ot([n]);return t?s=>e(s)&&s.endsWith(t):e},Qt=([n,t=""])=>{let e=rt([n]);return t?s=>e(s)&&s.endsWith(t):e},rt=([n])=>{let t=n.length;return e=>e.length===t&&!e.startsWith(".")},ot=([n])=>{let t=n.length;return e=>e.length===t&&e!=="."&&e!==".."},at=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",nt={win32:{sep:"\\"},posix:{sep:"/"}},te=at==="win32"?nt.win32.sep:nt.posix.sep;$.sep=te;var A=Symbol("globstar **");$.GLOBSTAR=A;var ee="[^/]",se=ee+"*?",ne="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",ie="(?:(?!(?:\\/|^)\\.).)*?",re=(n,t={})=>e=>$(e,n,t);$.filter=re;var E=(n,t={})=>Object.assign({},n,t),oe=n=>{if(!n||typeof n!="object"||!Object.keys(n).length)return $;let t=$;return Object.assign((s,r,i={})=>t(s,r,E(n,i)),{Minimatch:class extends t.Minimatch{constructor(r,i={}){super(r,E(n,i))}static defaults(r){return t.defaults(E(n,r)).Minimatch}},AST:class extends t.AST{constructor(r,i,o={}){super(r,i,E(n,o))}static fromGlob(r,i={}){return t.AST.fromGlob(r,E(n,i))}},unescape:(s,r={})=>t.unescape(s,E(n,r)),escape:(s,r={})=>t.escape(s,E(n,r)),filter:(s,r={})=>t.filter(s,E(n,r)),defaults:s=>t.defaults(E(n,s)),makeRe:(s,r={})=>t.makeRe(s,E(n,r)),braceExpand:(s,r={})=>t.braceExpand(s,E(n,r)),match:(s,r,i={})=>t.match(s,r,E(n,i)),sep:t.sep,GLOBSTAR:A})};$.defaults=oe;var ct=(n,t={})=>(O(n),t.nobrace||!/\{(?:(?!\{).)*\}/.test(n)?[n]:X(n));$.braceExpand=ct;var ae=(n,t={})=>new T(n,t).makeRe();$.makeRe=ae;var ce=(n,t,e={})=>{let s=new T(t,e);return n=n.filter(r=>s.match(r)),s.options.nonull&&!n.length&&n.push(t),n};$.match=ce;var it=/[?*]|[+@!]\(.*?\)|\[|\]/,he=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),T=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,e={}){O(t),e=e||{},this.options=e,this.pattern=t,this.platform=e.platform||at,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=e.windowsNoMagicRoot!==void 0?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let e of t)if(typeof e!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=(...i)=>console.error(...i)),this.debug(this.pattern,this.globSet);let s=this.globSet.map(i=>this.slashSplit(i));this.globParts=this.preprocess(s),this.debug(this.pattern,this.globParts);let r=this.globParts.map((i,o,l)=>{if(this.isWindows&&this.windowsNoMagicRoot){let h=i[0]===""&&i[1]===""&&(i[2]==="?"||!it.test(i[2]))&&!it.test(i[3]),f=/^[a-z]:/i.test(i[0]);if(h)return[...i.slice(0,4),...i.slice(4).map(u=>this.parse(u))];if(f)return[i[0],...i.slice(1).map(u=>this.parse(u))]}return i.map(h=>this.parse(h))});if(this.debug(this.pattern,r),this.set=r.filter(i=>i.indexOf(!1)===-1),this.isWindows)for(let i=0;i<this.set.length;i++){let o=this.set[i];o[0]===""&&o[1]===""&&this.globParts[i][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let s=0;s<t.length;s++)for(let r=0;r<t[s].length;r++)t[s][r]==="**"&&(t[s][r]="*");let{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):e>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(e=>{let s=-1;for(;(s=e.indexOf("**",s+1))!==-1;){let r=s;for(;e[r+1]==="**";)r++;r!==s&&e.splice(s,r-s)}return e})}levelOneOptimize(t){return t.map(e=>(e=e.reduce((s,r)=>{let i=s[s.length-1];return r==="**"&&i==="**"?s:r===".."&&i&&i!==".."&&i!=="."&&i!=="**"?(s.pop(),s):(s.push(r),s)},[]),e.length===0?[""]:e))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let r=1;r<t.length-1;r++){let i=t[r];r===1&&i===""&&t[0]===""||(i==="."||i==="")&&(e=!0,t.splice(r,1),r--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(e=!0,t.pop())}let s=0;for(;(s=t.indexOf("..",s+1))!==-1;){let r=t[s-1];r&&r!=="."&&r!==".."&&r!=="**"&&(e=!0,t.splice(s-1,2),s-=2)}}while(e);return t.length===0?[""]:t}firstPhasePreProcess(t){let e=!1;do{e=!1;for(let s of t){let r=-1;for(;(r=s.indexOf("**",r+1))!==-1;){let o=r;for(;s[o+1]==="**";)o++;o>r&&s.splice(r+1,o-r);let l=s[r+1],h=s[r+2],f=s[r+3];if(l!==".."||!h||h==="."||h===".."||!f||f==="."||f==="..")continue;e=!0,s.splice(r,1);let u=s.slice(0);u[r]="**",t.push(u),r--}if(!this.preserveMultipleSlashes){for(let o=1;o<s.length-1;o++){let l=s[o];o===1&&l===""&&s[0]===""||(l==="."||l==="")&&(e=!0,s.splice(o,1),o--)}s[0]==="."&&s.length===2&&(s[1]==="."||s[1]==="")&&(e=!0,s.pop())}let i=0;for(;(i=s.indexOf("..",i+1))!==-1;){let o=s[i-1];if(o&&o!=="."&&o!==".."&&o!=="**"){e=!0;let h=i===1&&s[i+1]==="**"?["."]:[];s.splice(i-1,2,...h),s.length===0&&s.push(""),i-=2}}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++)for(let s=e+1;s<t.length;s++){let r=this.partsMatch(t[e],t[s],!this.preserveMultipleSlashes);if(r){t[e]=[],t[s]=r;break}}return t.filter(e=>e.length)}partsMatch(t,e,s=!1){let r=0,i=0,o=[],l="";for(;r<t.length&&i<e.length;)if(t[r]===e[i])o.push(l==="b"?e[i]:t[r]),r++,i++;else if(s&&t[r]==="**"&&e[i]===t[r+1])o.push(t[r]),r++;else if(s&&e[i]==="**"&&t[r]===e[i+1])o.push(e[i]),i++;else if(t[r]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(l==="b")return!1;l="a",o.push(t[r]),r++,i++}else if(e[i]==="*"&&t[r]&&(this.options.dot||!t[r].startsWith("."))&&t[r]!=="**"){if(l==="a")return!1;l="b",o.push(e[i]),r++,i++}else return!1;return t.length===e.length&&o}parseNegate(){if(this.nonegate)return;let t=this.pattern,e=!1,s=0;for(let r=0;r<t.length&&t.charAt(r)==="!";r++)e=!e,s++;s&&(this.pattern=t.slice(s)),this.negate=e}matchOne(t,e,s=!1){let r=this.options;if(this.isWindows){let p=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),m=!p&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),y=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),w=!y&&e[0]===""&&e[1]===""&&e[2]==="?"&&typeof e[3]=="string"&&/^[a-z]:$/i.test(e[3]),S=m?3:p?0:void 0,x=w?3:y?0:void 0;if(typeof S=="number"&&typeof x=="number"){let[b,v]=[t[S],e[x]];b.toLowerCase()===v.toLowerCase()&&(e[x]=b,x>S?e=e.slice(x):S>x&&(t=t.slice(S)))}}let{optimizationLevel:i=1}=this.options;i>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var o=0,l=0,h=t.length,f=e.length;o<h&&l<f;o++,l++){this.debug("matchOne loop");var u=e[l],d=t[o];if(this.debug(e,u,d),u===!1)return!1;if(u===A){this.debug("GLOBSTAR",[e,u,d]);var a=o,c=l+1;if(c===f){for(this.debug("** at the end");o<h;o++)if(t[o]==="."||t[o]===".."||!r.dot&&t[o].charAt(0)===".")return!1;return!0}for(;a<h;){var g=t[a];if(this.debug(`
|
|
3
3
|
globstar while`,t,a,e,c,g),this.matchOne(t.slice(a),e.slice(c),s))return this.debug("globstar found match!",a,h,g),!0;if(g==="."||g===".."||!r.dot&&g.charAt(0)==="."){this.debug("dot detected!",t,a,e,c);break}this.debug("globstar swallow a segment, and continue"),a++}return!!(s&&(this.debug(`
|
|
4
4
|
>>> no match, partial?`,t,a,e,c),a===h))}let p;if(typeof u=="string"?(p=d===u,this.debug("string match",u,d,p)):(p=u.test(d),this.debug("pattern match",u,d,p)),!p)return!1}if(o===h&&l===f)return!0;if(o===h)return s;if(l===f)return o===h-1&&t[o]==="";throw new Error("wtf?")}braceExpand(){return ct(this.pattern,this.options)}parse(t){O(t);let e=this.options;if(t==="**")return A;if(t==="")return"";let s,r=null;(s=t.match(Jt))?r=e.dot?Zt:Ut:(s=t.match(jt))?r=(e.nocase?e.dot?Bt:Gt:e.dot?kt:Lt)(s[1]):(s=t.match(Kt))?r=(e.nocase?e.dot?Xt:Vt:e.dot?Yt:Qt)(s):(s=t.match(qt))?r=e.dot?Ht:Ft:(s=t.match(It))&&(r=_t);let i=N.fromGlob(t,this.options).toMMPattern();return r&&typeof i=="object"&&Reflect.defineProperty(i,"test",{value:r}),i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let e=this.options,s=e.noglobstar?se:e.dot?ne:ie,r=new Set(e.nocase?["i"]:[]),i=t.map(h=>{let f=h.map(d=>{if(d instanceof RegExp)for(let a of d.flags.split(""))r.add(a);return typeof d=="string"?he(d):d===A?A:d._src});f.forEach((d,a)=>{let c=f[a+1],g=f[a-1];d!==A||g===A||(g===void 0?c!==void 0&&c!==A?f[a+1]="(?:\\/|"+s+"\\/)?"+c:f[a]=s:c===void 0?f[a-1]=g+"(?:\\/|\\/"+s+")?":c!==A&&(f[a-1]=g+"(?:\\/|\\/"+s+"\\/)"+c,f[a+1]=A))});let u=f.filter(d=>d!==A);if(this.partial&&u.length>=1){let d=[];for(let a=1;a<=u.length;a++)d.push(u.slice(0,a).join("/"));return"(?:"+d.join("|")+")"}return u.join("/")}).join("|"),[o,l]=t.length>1?["(?:",")"]:["",""];i="^"+o+i+l+"$",this.partial&&(i="^(?:\\/|"+o+i.slice(1,-1)+l+")$"),this.negate&&(i="^(?!"+i+").+$");try{this.regexp=new RegExp(i,[...r].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&e)return!0;let s=this.options;this.isWindows&&(t=t.split("\\").join("/"));let r=this.slashSplit(t);this.debug(this.pattern,"split",r);let i=this.set;this.debug(this.pattern,"set",i);let o=r[r.length-1];if(!o)for(let l=r.length-2;!o&&l>=0;l--)o=r[l];for(let l=0;l<i.length;l++){let h=i[l],f=r;if(s.matchBase&&h.length===1&&(f=[o]),this.matchOne(f,h,e))return s.flipNegate?!0:!this.negate}return s.flipNegate?!1:this.negate}static defaults(t){return $.defaults(t).Minimatch}};$.AST=N;$.Minimatch=T;$.escape=q;$.unescape=M;function R(n){if(n<1024)return String(n);if(n<1024*1024){let e=n/1024;return e<10?`${e.toFixed(1)}K`:`${Math.round(e)}K`}if(n<1024*1024*1024){let e=n/1048576;return e<10?`${e.toFixed(1)}M`:`${Math.round(e)}M`}let t=n/(1024*1024*1024);return t<10?`${t.toFixed(1)}G`:`${Math.round(t)}G`}function D(n){let e=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][n.getMonth()],s=String(n.getDate()).padStart(2," "),r=new Date,i=new Date(r.getTime()-4320*60*60*1e3);if(n>i){let l=String(n.getHours()).padStart(2,"0"),h=String(n.getMinutes()).padStart(2,"0");return`${e} ${s} ${l}:${h}`}let o=n.getFullYear();return`${e} ${s} ${o}`}var le={name:"ls",summary:"list directory contents",usage:"ls [OPTION]... [FILE]...",options:["-a, --all do not ignore entries starting with .","-A, --almost-all do not list . and ..","-d, --directory list directories themselves, not their contents","-h, --human-readable with -l, print sizes like 1K 234M 2G etc.","-l use a long listing format","-r, --reverse reverse order while sorting","-R, --recursive list subdirectories recursively","-S sort by file size, largest first","-t sort by time, newest first","-1 list one file per line"," --help display this help and exit"]},ue={showAll:{short:"a",long:"all",type:"boolean"},showAlmostAll:{short:"A",long:"almost-all",type:"boolean"},longFormat:{short:"l",type:"boolean"},humanReadable:{short:"h",long:"human-readable",type:"boolean"},recursive:{short:"R",long:"recursive",type:"boolean"},reverse:{short:"r",long:"reverse",type:"boolean"},sortBySize:{short:"S",type:"boolean"},directoryOnly:{short:"d",long:"directory",type:"boolean"},sortByTime:{short:"t",type:"boolean"},onePerLine:{short:"1",type:"boolean"}},Le={name:"ls",async execute(n,t){if(H(n))return F(le);let e=I("ls",n,ue);if(!e.ok)return e.error;let s=e.result.flags.showAll,r=e.result.flags.showAlmostAll,i=e.result.flags.longFormat,o=e.result.flags.humanReadable,l=e.result.flags.recursive,h=e.result.flags.reverse,f=e.result.flags.sortBySize,u=e.result.flags.directoryOnly,d=e.result.flags.sortByTime;e.result.flags.onePerLine;let a=e.result.positional;a.length===0&&a.push(".");let c="",g="",p=0;for(let m=0;m<a.length;m++){let y=a[m];if(m>0&&c&&!c.endsWith(`
|
|
5
5
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as m}from"./chunk-GX4MPCG6.js";import"./chunk-GTNBSMZR.js";import"./chunk-
|
|
2
|
+
import{a as m}from"./chunk-GX4MPCG6.js";import"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var o=m("md5sum","md5","compute MD5 message digest");export{o as md5sumCommand};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a}from"./chunk-TA7RUHGQ.js";import{a as l}from"./chunk-4VDEBYW7.js";import"./chunk-GTNBSMZR.js";import"./chunk-
|
|
2
|
+
import{a}from"./chunk-TA7RUHGQ.js";import{a as l}from"./chunk-4VDEBYW7.js";import"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var g={recursive:{short:"p",long:"parents",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"}},y={name:"mkdir",async execute(u,o){let e=a("mkdir",u,g);if(!e.ok)return e.error;let m=e.result.flags.recursive,f=e.result.flags.verbose,n=e.result.positional;if(n.length===0)return{stdout:"",stderr:`mkdir: missing operand
|
|
3
3
|
`,exitCode:1};let c="",t="",d=0;for(let r of n)try{let i=o.fs.resolvePath(o.cwd,r);await o.fs.mkdir(i,{recursive:m}),f&&(c+=`mkdir: created directory '${r}'
|
|
4
4
|
`)}catch(i){let s=l(i);s.includes("ENOENT")||s.includes("no such file")?t+=`mkdir: cannot create directory '${r}': No such file or directory
|
|
5
5
|
`:s.includes("EEXIST")||s.includes("already exists")?t+=`mkdir: cannot create directory '${r}': File exists
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as y}from"./chunk-TA7RUHGQ.js";import{a as $}from"./chunk-4VDEBYW7.js";import{a as g,b as u}from"./chunk-GTNBSMZR.js";import"./chunk-
|
|
2
|
+
import{a as y}from"./chunk-TA7RUHGQ.js";import{a as $}from"./chunk-4VDEBYW7.js";import{a as g,b as u}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var C={name:"mv",summary:"move (rename) files",usage:"mv [OPTION]... SOURCE... DEST",options:["-f, --force do not prompt before overwriting","-n, --no-clobber do not overwrite an existing file","-v, --verbose explain what is being done"," --help display this help and exit"]},P={force:{short:"f",long:"force",type:"boolean"},noClobber:{short:"n",long:"no-clobber",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"}},O={name:"mv",async execute(m,t){if(u(m))return g(C);let s=y("mv",m,P);if(!s.ok)return s.error;let p=s.result.flags.force,d=s.result.flags.noClobber,w=s.result.flags.verbose,l=s.result.positional;if(d&&(p=!1),l.length<2)return{stdout:"",stderr:`mv: missing destination file operand
|
|
3
3
|
`,exitCode:1};let r=l.pop()??"",v=l,n=t.fs.resolvePath(t.cwd,r),h="",c="",b=0,a=!1;try{a=(await t.fs.stat(n)).isDirectory}catch{}if(v.length>1&&!a)return{stdout:"",stderr:`mv: target '${r}' is not a directory
|
|
4
4
|
`,exitCode:1};for(let e of v)try{let f=t.fs.resolvePath(t.cwd,e),o=n;if(a){let i=e.split("/").pop()||e;o=n==="/"?`/${i}`:`${n}/${i}`}if(d)try{await t.fs.stat(o);continue}catch{}if(await t.fs.mv(f,o),w){let i=a?`${r}/${e.split("/").pop()||e}`:r;h+=`renamed '${e}' -> '${i}'
|
|
5
5
|
`}}catch(f){let o=$(f);o.includes("ENOENT")||o.includes("no such file")?c+=`mv: cannot stat '${e}': No such file or directory
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as f,b as m,c}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var h={name:"nl",summary:"number lines of files",usage:"nl [OPTION]... [FILE]...",description:"Write each FILE to standard output, with line numbers added. If no FILE is specified, standard input is read.",options:["-b STYLE Body numbering style: a (all), t (non-empty), n (none)","-n FORMAT Number format: ln (left), rn (right), rz (right zeros)","-w WIDTH Number width (default: 6)","-s SEP Separator after number (default: TAB)","-v START Starting line number (default: 1)","-i INCR Line number increment (default: 1)"],examples:["nl file.txt # Number non-empty lines","nl -ba file.txt # Number all lines","nl -n rz -w 3 file.txt # Right-justified with zeros","nl -s ': ' file.txt # Use ': ' as separator"]};function p(r,s,i){let l=String(r);switch(s){case"ln":return l.padEnd(i);case"rn":return l.padStart(i);case"rz":return l.padStart(i,"0");default:return s}}function N(r,s){switch(s){case"a":return!0;case"t":return r.trim().length>0;case"n":return!1;default:return s}}function b(r,s,i){if(r==="")return{output:"",nextNumber:i};let l=r.split(`
|
|
3
|
+
`),t=[],u=i,o=r.endsWith(`
|
|
4
|
+
`)&&l[l.length-1]==="";o&&l.pop();for(let n of l)if(N(n,s.bodyStyle)){let e=p(u,s.numberFormat,s.width);t.push(`${e}${s.separator}${n}`),u+=s.increment}else{let e=" ".repeat(s.width);t.push(`${e}${s.separator}${n}`)}return{output:t.join(`
|
|
5
|
+
`)+(o?`
|
|
6
|
+
`:""),nextNumber:u}}var w={name:"nl",execute:async(r,s)=>{if(m(r))return f(h);let i={bodyStyle:"t",numberFormat:"rn",width:6,separator:" ",startNumber:1,increment:1},l=[],t=0;for(;t<r.length;){let n=r[t];if(n==="-b"&&t+1<r.length){let e=r[t+1];if(e!=="a"&&e!=="t"&&e!=="n")return{exitCode:1,stdout:"",stderr:`nl: invalid body numbering style: '${e}'
|
|
7
|
+
`};i.bodyStyle=e,t+=2}else if(n.startsWith("-b")){let e=n.slice(2);if(e!=="a"&&e!=="t"&&e!=="n")return{exitCode:1,stdout:"",stderr:`nl: invalid body numbering style: '${e}'
|
|
8
|
+
`};i.bodyStyle=e,t++}else if(n==="-n"&&t+1<r.length){let e=r[t+1];if(e!=="ln"&&e!=="rn"&&e!=="rz")return{exitCode:1,stdout:"",stderr:`nl: invalid line numbering format: '${e}'
|
|
9
|
+
`};i.numberFormat=e,t+=2}else if(n.startsWith("-n")){let e=n.slice(2);if(e!=="ln"&&e!=="rn"&&e!=="rz")return{exitCode:1,stdout:"",stderr:`nl: invalid line numbering format: '${e}'
|
|
10
|
+
`};i.numberFormat=e,t++}else if(n==="-w"&&t+1<r.length){let e=parseInt(r[t+1],10);if(Number.isNaN(e)||e<1)return{exitCode:1,stdout:"",stderr:`nl: invalid line number field width: '${r[t+1]}'
|
|
11
|
+
`};i.width=e,t+=2}else if(n.startsWith("-w")){let e=parseInt(n.slice(2),10);if(Number.isNaN(e)||e<1)return{exitCode:1,stdout:"",stderr:`nl: invalid line number field width: '${n.slice(2)}'
|
|
12
|
+
`};i.width=e,t++}else if(n==="-s"&&t+1<r.length)i.separator=r[t+1],t+=2;else if(n.startsWith("-s"))i.separator=n.slice(2),t++;else if(n==="-v"&&t+1<r.length){let e=parseInt(r[t+1],10);if(Number.isNaN(e))return{exitCode:1,stdout:"",stderr:`nl: invalid starting line number: '${r[t+1]}'
|
|
13
|
+
`};i.startNumber=e,t+=2}else if(n.startsWith("-v")){let e=parseInt(n.slice(2),10);if(Number.isNaN(e))return{exitCode:1,stdout:"",stderr:`nl: invalid starting line number: '${n.slice(2)}'
|
|
14
|
+
`};i.startNumber=e,t++}else if(n==="-i"&&t+1<r.length){let e=parseInt(r[t+1],10);if(Number.isNaN(e))return{exitCode:1,stdout:"",stderr:`nl: invalid line number increment: '${r[t+1]}'
|
|
15
|
+
`};i.increment=e,t+=2}else if(n.startsWith("-i")){let e=parseInt(n.slice(2),10);if(Number.isNaN(e))return{exitCode:1,stdout:"",stderr:`nl: invalid line number increment: '${n.slice(2)}'
|
|
16
|
+
`};i.increment=e,t++}else if(n==="--"){l.push(...r.slice(t+1));break}else{if(n.startsWith("-")&&n!=="-")return c("nl",n);l.push(n),t++}}let u="",o=i.startNumber;if(l.length===0){let n=s.stdin??"";u=b(n,i,o).output}else for(let n of l){let e=s.fs.resolvePath(s.cwd,n),a=await s.fs.readFile(e);if(a===null)return{exitCode:1,stdout:u,stderr:`nl: ${n}: No such file or directory
|
|
17
|
+
`};let d=b(a,i,o);u+=d.output,o=d.nextNumber}return{exitCode:0,stdout:u,stderr:""}}};export{w as nl};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-KGOUQS5A.js";async function f(h,l){let u=h.includes("-c"),i=h.includes("-An")?"none":"octal",o=l.stdin,s=h.filter(t=>!t.startsWith("-")&&t!=="-");if(s.length>0){let t=s[0].startsWith("/")?s[0]:`${l.cwd}/${s[0]}`;try{o=await l.fs.readFile(t)}catch{return{stdout:"",stderr:`od: ${s[0]}: No such file or directory
|
|
3
3
|
`,exitCode:1}}}if(u){let t=[];for(let e of o){let n=e.charCodeAt(0);n===0?t.push("\\0"):n===9?t.push("\\t"):n===10?t.push("\\n"):n===13?t.push("\\r"):n===32?t.push(" "):n>=32&&n<127?t.push(` ${e}`):t.push(`\\${n.toString(8).padStart(3,"0")}`)}let r=[];for(let e=0;e<t.length;e+=16){let n=t.slice(e,e+16),a=i==="none"?"":`${e.toString(8).padStart(7,"0")} `;r.push(a+n.join(" "))}return i!=="none"&&r.push(o.length.toString(8).padStart(7,"0")),{stdout:`${r.join(`
|
|
4
4
|
`)}
|
|
5
5
|
`,stderr:"",exitCode:0}}let c=[];for(let t of o)c.push(t.charCodeAt(0).toString(8).padStart(3,"0"));let d=[];for(let t=0;t<c.length;t+=8){let r=c.slice(t,t+8),e=i==="none"?"":`${t.toString(8).padStart(7,"0")} `;d.push(e+r.join(" "))}return i!=="none"&&c.length>0&&d.push(o.length.toString(8).padStart(7,"0")),{stdout:d.length>0?`${d.join(`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as g}from"./chunk-TA7RUHGQ.js";import{a as c,b as m}from"./chunk-GTNBSMZR.js";import"./chunk-
|
|
2
|
+
import{a as g}from"./chunk-TA7RUHGQ.js";import{a as c,b as m}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var L={name:"paste",summary:"merge lines of files",usage:"paste [OPTION]... [FILE]...",description:["Write lines consisting of the sequentially corresponding lines from","each FILE, separated by TABs, to standard output.","","With no FILE, or when FILE is -, read standard input."],options:["-d, --delimiters=LIST reuse characters from LIST instead of TABs","-s, --serial paste one file at a time instead of in parallel"," --help display this help and exit"],examples:["paste file1 file2 Merge file1 and file2 side by side","paste -d, file1 file2 Use comma as delimiter","paste -s file1 Paste all lines of file1 on one line","paste - - < file Paste pairs of lines from file"]},x={delimiter:{short:"d",long:"delimiters",type:"string",default:" "},serial:{short:"s",long:"serial",type:"boolean"}},P={name:"paste",async execute(s,i){if(m(s))return c(L);let n=g("paste",s,x);if(!n.ok)return n.error;let l=n.result.flags.delimiter,d=n.result.flags.serial,p=n.result.positional;if(p.length===0)return{stdout:"",stderr:`usage: paste [-s] [-d delimiters] file ...
|
|
3
3
|
`,exitCode:1};let a=i.stdin?i.stdin.split(`
|
|
4
4
|
`):[""];a.length>0&&a[a.length-1]===""&&a.pop();let I=p.filter(e=>e==="-").length,f=[],u=0;for(let e of p)if(e==="-"){let t=[];for(let o=u;o<a.length;o+=I)t.push(a[o]);f.push(t),u++}else{let t=i.fs.resolvePath(i.cwd,e);try{let r=(await i.fs.readFile(t)).split(`
|
|
5
5
|
`);r.length>0&&r[r.length-1]===""&&r.pop(),f.push(r)}catch{return{stdout:"",stderr:`paste: ${e}: No such file or directory
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as C,c as F}from"./chunk-PM2DS2YW.js";import{a as $}from"./chunk-4VDEBYW7.js";import{a as E,b as I}from"./chunk-GTNBSMZR.js";import{
|
|
2
|
+
import{a as C,c as F}from"./chunk-PM2DS2YW.js";import{a as $}from"./chunk-4VDEBYW7.js";import{a as E,b as I}from"./chunk-GTNBSMZR.js";import{c as M,e as j}from"./chunk-KGOUQS5A.js";var A=M(S=>{(function(){"use strict";var e={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function o(l){return n(i(l),arguments)}function t(l,a){return o.apply(null,[l].concat(a||[]))}function n(l,a){var f=1,p=l.length,s,h="",d,u,c,m,v,w,y,b;for(d=0;d<p;d++)if(typeof l[d]=="string")h+=l[d];else if(typeof l[d]=="object"){if(c=l[d],c.keys)for(s=a[f],u=0;u<c.keys.length;u++){if(s==null)throw new Error(o('[sprintf] Cannot access property "%s" of undefined value "%s"',c.keys[u],c.keys[u-1]));s=s[c.keys[u]]}else c.param_no?s=a[c.param_no]:s=a[f++];if(e.not_type.test(c.type)&&e.not_primitive.test(c.type)&&s instanceof Function&&(s=s()),e.numeric_arg.test(c.type)&&typeof s!="number"&&isNaN(s))throw new TypeError(o("[sprintf] expecting number but found %T",s));switch(e.number.test(c.type)&&(y=s>=0),c.type){case"b":s=parseInt(s,10).toString(2);break;case"c":s=String.fromCharCode(parseInt(s,10));break;case"d":case"i":s=parseInt(s,10);break;case"j":s=JSON.stringify(s,null,c.width?parseInt(c.width):0);break;case"e":s=c.precision?parseFloat(s).toExponential(c.precision):parseFloat(s).toExponential();break;case"f":s=c.precision?parseFloat(s).toFixed(c.precision):parseFloat(s);break;case"g":s=c.precision?String(Number(s.toPrecision(c.precision))):parseFloat(s);break;case"o":s=(parseInt(s,10)>>>0).toString(8);break;case"s":s=String(s),s=c.precision?s.substring(0,c.precision):s;break;case"t":s=String(!!s),s=c.precision?s.substring(0,c.precision):s;break;case"T":s=Object.prototype.toString.call(s).slice(8,-1).toLowerCase(),s=c.precision?s.substring(0,c.precision):s;break;case"u":s=parseInt(s,10)>>>0;break;case"v":s=s.valueOf(),s=c.precision?s.substring(0,c.precision):s;break;case"x":s=(parseInt(s,10)>>>0).toString(16);break;case"X":s=(parseInt(s,10)>>>0).toString(16).toUpperCase();break}e.json.test(c.type)?h+=s:(e.number.test(c.type)&&(!y||c.sign)?(b=y?"+":"-",s=s.toString().replace(e.sign,"")):b="",v=c.pad_char?c.pad_char==="0"?"0":c.pad_char.charAt(1):" ",w=c.width-(b+s).length,m=c.width&&w>0?v.repeat(w):"",h+=c.align?b+s+m:v==="0"?b+m+s:m+b+s)}return h}var r=Object.create(null);function i(l){if(r[l])return r[l];for(var a=l,f,p=[],s=0;a;){if((f=e.text.exec(a))!==null)p.push(f[0]);else if((f=e.modulo.exec(a))!==null)p.push("%");else if((f=e.placeholder.exec(a))!==null){if(f[2]){s|=1;var h=[],d=f[2],u=[];if((u=e.key.exec(d))!==null)for(h.push(u[1]);(d=d.substring(u[0].length))!=="";)if((u=e.key_access.exec(d))!==null)h.push(u[1]);else if((u=e.index_access.exec(d))!==null)h.push(u[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");f[2]=h}else s|=2;if(s===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");p.push({placeholder:f[0],param_no:f[1],keys:f[2],sign:f[3],pad_char:f[4],align:f[5],width:f[6],precision:f[7],type:f[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");a=a.substring(f[0].length)}return r[l]=p}typeof S<"u"&&(S.sprintf=o,S.vsprintf=t),typeof window<"u"&&(window.sprintf=o,window.vsprintf=t,typeof define=="function"&&define.amd&&define(function(){return{sprintf:o,vsprintf:t}}))})()});var x=j(A(),1);var N={name:"printf",summary:"format and print data",usage:"printf [-v var] FORMAT [ARGUMENT...]",options:[" -v var assign the output to shell variable VAR rather than display it"," --help display this help and exit"],notes:["FORMAT controls the output like in C printf.","Escape sequences: \\n (newline), \\t (tab), \\\\ (backslash)","Format specifiers: %s (string), %d (integer), %f (float), %x (hex), %o (octal), %% (literal %)","Width and precision: %10s (width 10), %.2f (2 decimal places), %010d (zero-padded)","Flags: %- (left-justify), %+ (show sign), %0 (zero-pad)"]},J={name:"printf",async execute(e,o){if(I(e))return E(N);if(e.length===0)return{stdout:"",stderr:`printf: usage: printf format [arguments]
|
|
3
3
|
`,exitCode:2};let t=null,n=0;for(;n<e.length;){let l=e[n];if(l==="--"){n++;break}if(l==="-v"){if(n+1>=e.length)return{stdout:"",stderr:`printf: -v: option requires an argument
|
|
4
4
|
`,exitCode:1};if(t=e[n+1],!/^[a-zA-Z_][a-zA-Z0-9_]*(\[[^\]]+\])?$/.test(t))return{stdout:"",stderr:`printf: \`${t}': not a valid identifier
|
|
5
5
|
`,exitCode:2};n+=2}else{if(l.startsWith("-")&&l!=="-")break;break}}if(n>=e.length)return{stdout:"",stderr:`printf: usage: printf format [arguments]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as h,b as u}from"./chunk-GTNBSMZR.js";import"./chunk-
|
|
2
|
+
import{a as h,b as u}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var m={name:"readlink",summary:"print resolved symbolic links or canonical file names",usage:"readlink [OPTIONS] FILE...",options:["-f canonicalize by following every symlink in every component of the given name recursively"," --help display this help and exit"]},y={name:"readlink",async execute(i,r){if(u(i))return h(m);let s=!1,t=0;for(;t<i.length&&i[t].startsWith("-");){let n=i[t];if(n==="-f"||n==="--canonicalize")s=!0,t++;else if(n==="--"){t++;break}else return{stdout:"",stderr:`readlink: invalid option -- '${n.slice(1)}'
|
|
3
3
|
`,exitCode:1}}let d=i.slice(t);if(d.length===0)return{stdout:"",stderr:`readlink: missing operand
|
|
4
4
|
`,exitCode:1};let l="",c=!1;for(let n of d){let a=r.fs.resolvePath(r.cwd,n);try{if(s){let e=a,f=new Set;for(;!f.has(e);){f.add(e);try{let o=await r.fs.readlink(e);if(o.startsWith("/"))e=o;else{let k=e.substring(0,e.lastIndexOf("/"))||"/";e=r.fs.resolvePath(k,o)}}catch{break}}l+=`${e}
|
|
5
5
|
`}else{let e=await r.fs.readlink(a);l+=`${e}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as f,b as a,c}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var u={name:"rev",summary:"reverse lines characterwise",usage:"rev [file ...]",description:"Copies the specified files to standard output, reversing the order of characters in every line. If no files are specified, standard input is read.",examples:["echo 'hello' | rev # Output: olleh","rev file.txt # Reverse each line in file"]};function d(t){return Array.from(t).reverse().join("")}var v={name:"rev",execute:async(t,n)=>{if(a(t))return f(u);let o=[];for(let e of t)if(e==="--"){let r=t.indexOf(e);o.push(...t.slice(r+1));break}else{if(e.startsWith("-")&&e!=="-")return c("rev",e);o.push(e)}let s="",l=e=>{let r=e.split(`
|
|
3
|
+
`),i=e.endsWith(`
|
|
4
|
+
`)&&r[r.length-1]==="";return i&&r.pop(),r.map(d).join(`
|
|
5
|
+
`)+(i?`
|
|
6
|
+
`:"")};if(o.length===0){let e=n.stdin??"";s=l(e)}else for(let e of o)if(e==="-"){let r=n.stdin??"";s+=l(r)}else{let r=n.fs.resolvePath(n.cwd,e),i=await n.fs.readFile(r);if(i===null)return{exitCode:1,stdout:s,stderr:`rev: ${e}: No such file or directory
|
|
7
|
+
`};s+=l(i)}return{exitCode:0,stdout:s,stderr:""}}};export{v as rev};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as u}from"./chunk-TA7RUHGQ.js";import{a as m}from"./chunk-4VDEBYW7.js";import"./chunk-GTNBSMZR.js";import"./chunk-
|
|
2
|
+
import{a as u}from"./chunk-TA7RUHGQ.js";import{a as m}from"./chunk-4VDEBYW7.js";import"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var v={recursive:{short:"r",long:"recursive",type:"boolean"},recursiveUpper:{short:"R",type:"boolean"},force:{short:"f",long:"force",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"}},y={name:"rm",async execute(d,s){let e=u("rm",d,v);if(!e.ok)return e.error;let a=e.result.flags.recursive||e.result.flags.recursiveUpper,c=e.result.flags.force,p=e.result.flags.verbose,l=e.result.positional;if(l.length===0)return c?{stdout:"",stderr:"",exitCode:0}:{stdout:"",stderr:`rm: missing operand
|
|
3
3
|
`,exitCode:1};let f="",t="",i=0;for(let r of l)try{let n=s.fs.resolvePath(s.cwd,r);if((await s.fs.stat(n)).isDirectory&&!a){t+=`rm: cannot remove '${r}': Is a directory
|
|
4
4
|
`,i=1;continue}await s.fs.rm(n,{recursive:a,force:c}),p&&(f+=`removed '${r}'
|
|
5
5
|
`)}catch(n){if(!c){let o=m(n);o.includes("ENOENT")||o.includes("no such file")?t+=`rm: cannot remove '${r}': No such file or directory
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{i as g}from"./chunk-NWWB2XRE.js";import{a as D,b as W,c as y}from"./chunk-GTNBSMZR.js";import"./chunk-
|
|
2
|
+
import{i as g}from"./chunk-NWWB2XRE.js";import{a as D,b as W,c as y}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var G=1e4;function U(i,e,t){return{patternSpace:"",holdSpace:"",lineNumber:0,totalLines:i,deleted:!1,printed:!1,quit:!1,quitSilent:!1,exitCode:void 0,appendBuffer:[],substitutionMade:!1,lineNumberOutput:[],restartCycle:!1,currentFilename:e,pendingFileReads:[],pendingFileWrites:[],pendingExecute:void 0,rangeStates:t||new Map}}function j(i){return typeof i=="object"&&"first"in i&&"step"in i}function N(i,e,t,n){if(i==="$")return e===t;if(typeof i=="number")return e===i;if(j(i)){let{first:r,step:s}=i;return s===0?e===r:(e-r)%s===0&&e>=r}if(typeof i=="object"&&"pattern"in i)try{return new RegExp(i.pattern).test(n)}catch{return!1}return!1}function Q(i){let e=t=>t===void 0?"undefined":t==="$"?"$":typeof t=="number"?String(t):"pattern"in t?`/${t.pattern}/`:"first"in t?`${t.first}~${t.step}`:"unknown";return`${e(i.start)},${e(i.end)}`}function k(i,e,t,n,r){if(!i||!i.start&&!i.end)return!0;let s=i.start,l=i.end;if(s!==void 0&&l===void 0)return N(s,e,t,n);if(s!==void 0&&l!==void 0){let h=typeof s=="object"&&"pattern"in s,p=typeof l=="object"&&"pattern"in l;if(!h&&!p){let o=typeof s=="number"?s:s==="$"?t:1,a=typeof l=="number"?l:t;return e>=o&&e<=a}if(r){let o=Q(i),a=r.get(o);return a||(a={active:!1},r.set(o,a)),a.active?(N(l,e,t,n)&&(a.active=!1,r.set(o,a)),!0):N(s,e,t,n)?(a.active=!0,a.startLine=e,r.set(o,a),N(l,e,t,n)&&(a.active=!1,r.set(o,a)),!0):!1}return N(s,e,t,n)}return!0}function K(i){let e="",t=0;for(;t<i.length;){if(i[t]==="\\"&&t+1<i.length){let n=i[t+1];if(n==="+"||n==="?"||n==="|"){e+=n,t+=2;continue}if(n==="("||n===")"){e+=n,t+=2;continue}if(n==="{"||n==="}"){e+=n,t+=2;continue}e+=i[t]+n,t+=2;continue}if(i[t]==="+"||i[t]==="?"||i[t]==="|"||i[t]==="("||i[t]===")"){e+=`\\${i[t]}`,t++;continue}e+=i[t],t++}return e}function J(i){let e="";for(let t=0;t<i.length;t++){let n=i[t],r=n.charCodeAt(0);n==="\\"?e+="\\\\":n===" "?e+="\\t":n===`
|
|
3
3
|
`?e+=`$
|
|
4
4
|
`:n==="\r"?e+="\\r":n==="\x07"?e+="\\a":n==="\b"?e+="\\b":n==="\f"?e+="\\f":n==="\v"?e+="\\v":r<32||r>=127?e+=`\\${r.toString(8).padStart(3,"0")}`:e+=n}return`${e}$`}function P(i,e,t){let n="",r=0;for(;r<i.length;){if(i[r]==="\\"&&r+1<i.length){let s=i[r+1];if(s==="&"){n+="&",r+=2;continue}if(s==="n"){n+=`
|
|
5
5
|
`,r+=2;continue}if(s==="t"){n+=" ",r+=2;continue}let l=parseInt(s,10);if(l>=1&&l<=9){n+=t[l-1]||"",r+=2;continue}n+=s,r+=2;continue}if(i[r]==="&"){n+=e,r++;continue}n+=i[r],r++}return n}function V(i,e){let{lineNumber:t,totalLines:n,patternSpace:r}=e;if(i.type!=="label"&&k(i.address,t,n,r,e.rangeStates))switch(i.type){case"substitute":{let s=i,l="";s.global&&(l+="g"),s.ignoreCase&&(l+="i");let h=s.extendedRegex?s.pattern:K(s.pattern);try{let p=new RegExp(h,l),f=p.test(e.patternSpace);if(p.lastIndex=0,f){if(e.substitutionMade=!0,s.nthOccurrence&&s.nthOccurrence>0&&!s.global){let o=0,a=s.nthOccurrence;e.patternSpace=e.patternSpace.replace(new RegExp(h,`g${s.ignoreCase?"i":""}`),(u,...m)=>{if(o++,o===a){let v=m.slice(0,-2);return P(s.replacement,u,v)}return u})}else e.patternSpace=e.patternSpace.replace(p,(o,...a)=>{let u=a.slice(0,-2);return P(s.replacement,o,u)});s.printOnMatch&&(e.printed=!0)}}catch{}break}case"print":e.printed=!0;break;case"printFirstLine":{let s=e.patternSpace.indexOf(`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-KGOUQS5A.js";var F={name:"seq",async execute(r){let d=`
|
|
3
3
|
`,h=!1,i=[],e=0;for(;e<r.length;){let t=r[e];if(t==="-s"&&e+1<r.length){d=r[e+1],e+=2;continue}if(t==="-w"){h=!0,e++;continue}if(t==="--"){e++;break}if(t.startsWith("-")&&t!=="-"){if(t.startsWith("-s")&&t.length>2){d=t.slice(2),e++;continue}if((t==="-ws"||t==="-sw")&&(h=!0,e+1<r.length)){d=r[e+1],e+=2;continue}}i.push(t),e++}for(;e<r.length;)i.push(r[e]),e++;if(i.length===0)return{stdout:"",stderr:`seq: missing operand
|
|
4
4
|
`,exitCode:1};let l=1,o=1,a;if(i.length===1?a=parseFloat(i[0]):i.length===2?(l=parseFloat(i[0]),a=parseFloat(i[1])):(l=parseFloat(i[0]),o=parseFloat(i[1]),a=parseFloat(i[2])),Number.isNaN(l)||Number.isNaN(o)||Number.isNaN(a))return{stdout:"",stderr:`seq: invalid floating point argument: '${i.find(n=>Number.isNaN(parseFloat(n)))}'
|
|
5
5
|
`,exitCode:1};if(o===0)return{stdout:"",stderr:`seq: invalid Zero increment value: '0'
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as m}from"./chunk-GX4MPCG6.js";import"./chunk-GTNBSMZR.js";import"./chunk-
|
|
2
|
+
import{a as m}from"./chunk-GX4MPCG6.js";import"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var e=m("sha1sum","sha1","compute SHA1 message digest");export{e as sha1sumCommand};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as m}from"./chunk-GX4MPCG6.js";import"./chunk-GTNBSMZR.js";import"./chunk-
|
|
2
|
+
import{a as m}from"./chunk-GX4MPCG6.js";import"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var e=m("sha256sum","sha256","compute SHA256 message digest");export{e as sha256sumCommand};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a,b as o}from"./chunk-GTNBSMZR.js";import"./chunk-
|
|
2
|
+
import{a,b as o}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var i={name:"sleep",summary:"delay for a specified amount of time",usage:"sleep NUMBER[SUFFIX]",description:`Pause for NUMBER seconds. SUFFIX may be:
|
|
3
3
|
s - seconds (default)
|
|
4
4
|
m - minutes
|
|
5
5
|
h - hours
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{b as O}from"./chunk-J7MJV6WO.js";import{a as F,b as N,c as k}from"./chunk-GTNBSMZR.js";import"./chunk-
|
|
2
|
+
import{b as O}from"./chunk-J7MJV6WO.js";import{a as F,b as N,c as k}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var P={"":1,k:1024,m:1048576,g:1073741824,t:1099511627776,p:0x4000000000000,e:1152921504606847e3},V={jan:1,feb:2,mar:3,apr:4,may:5,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12};function w(u){let r=u.trim(),e=r.match(/^([+-]?\d*\.?\d+)\s*([kmgtpeKMGTPE])?[iI]?[bB]?$/);if(!e){let n=parseFloat(r);return Number.isNaN(n)?0:n}let l=parseFloat(e[1]),s=(e[2]||"").toLowerCase(),i=P[s]||1;return l*i}function L(u){let r=u.trim().toLowerCase().slice(0,3);return V[r]||0}function D(u,r){let e=u.split(/(\d+)/),l=r.split(/(\d+)/),s=Math.max(e.length,l.length);for(let i=0;i<s;i++){let n=e[i]||"",d=l[i]||"",o=/^\d+$/.test(n)?parseInt(n,10):null,c=/^\d+$/.test(d)?parseInt(d,10):null;if(o!==null&&c!==null){if(o!==c)return o-c}else if(n!==d)return n.localeCompare(d)}return 0}function x(u){return u.replace(/[^a-zA-Z0-9\s]/g,"")}function v(u,r,e){let l=e!==null?e:/\s+/,s=u.split(l),i=r.startField-1;if(i>=s.length)return"";if(r.endField===void 0){let o=s[i]||"";return r.startChar!==void 0&&(o=o.slice(r.startChar-1)),r.ignoreLeading&&(o=o.trimStart()),o}let n=Math.min(r.endField-1,s.length-1),d="";for(let o=i;o<=n&&o<s.length;o++){let c=s[o]||"";if(o===i&&r.startChar!==void 0&&(c=c.slice(r.startChar-1)),o===n&&r.endChar!==void 0){let t=o===i&&r.startChar!==void 0?r.endChar-r.startChar+1:r.endChar;c=c.slice(0,t)}o>i&&(d+=e||" "),d+=c}return r.ignoreLeading&&(d=d.trimStart()),d}function I(u,r,e){let l=u,s=r;if(e.dictionaryOrder&&(l=x(l),s=x(s)),e.ignoreCase&&(l=l.toLowerCase(),s=s.toLowerCase()),e.monthSort){let i=L(l),n=L(s);return i-n}if(e.humanNumeric){let i=w(l),n=w(s);return i-n}if(e.versionSort)return D(l,s);if(e.numeric){let i=parseFloat(l)||0,n=parseFloat(s)||0;return i-n}return l.localeCompare(s)}function M(u){let{keys:r,fieldDelimiter:e,numeric:l,ignoreCase:s,reverse:i,humanNumeric:n,versionSort:d,dictionaryOrder:o,monthSort:c,ignoreLeadingBlanks:t,stable:a}=u;return(f,S)=>{let g=f,b=S;if(t&&(g=g.trimStart(),b=b.trimStart()),r.length===0){let h=I(g,b,{numeric:l,ignoreCase:s,humanNumeric:n,versionSort:d,dictionaryOrder:o,monthSort:c});if(h!==0)return i?-h:h;if(!a){let p=f.localeCompare(S);return i?-p:p}return 0}for(let m of r){let h=v(g,m,e),p=v(b,m,e);m.ignoreLeading&&(h=h.trimStart(),p=p.trimStart());let B={numeric:m.numeric??l,ignoreCase:m.ignoreCase??s,humanNumeric:m.humanNumeric??n,versionSort:m.versionSort??d,dictionaryOrder:m.dictionaryOrder??o,monthSort:m.monthSort??c},A=m.reverse??i,y=I(h,p,B);if(y!==0)return A?-y:y}if(!a){let m=f.localeCompare(S);return i?-m:m}return 0}}function E(u,r){if(r.keys.length===0){if(r.ignoreCase){let s=new Set;return u.filter(i=>{let n=i.toLowerCase();return s.has(n)?!1:(s.add(n),!0)})}return[...new Set(u)]}let e=r.keys[0],l=new Set;return u.filter(s=>{let i=v(s,e,r.fieldDelimiter);return(e.ignoreCase??r.ignoreCase)&&(i=i.toLowerCase()),l.has(i)?!1:(l.add(i),!0)})}function C(u){let r={startField:1},e="",l=u,s=l.match(/([bdfhMnrV]+)$/);s&&(e=s[1],l=l.slice(0,-e.length)),e.includes("n")&&(r.numeric=!0),e.includes("r")&&(r.reverse=!0),e.includes("f")&&(r.ignoreCase=!0),e.includes("b")&&(r.ignoreLeading=!0),e.includes("h")&&(r.humanNumeric=!0),e.includes("V")&&(r.versionSort=!0),e.includes("d")&&(r.dictionaryOrder=!0),e.includes("M")&&(r.monthSort=!0);let i=l.split(",");if(i.length===0||i[0]==="")return null;let n=i[0].split("."),d=parseInt(n[0],10);if(Number.isNaN(d)||d<1)return null;if(r.startField=d,n.length>1&&n[1]){let o=parseInt(n[1],10);!Number.isNaN(o)&&o>=1&&(r.startChar=o)}if(i.length>1&&i[1]){let o=i[1],c=o.match(/([bdfhMnrV]+)$/);if(c){let a=c[1];a.includes("n")&&(r.numeric=!0),a.includes("r")&&(r.reverse=!0),a.includes("f")&&(r.ignoreCase=!0),a.includes("b")&&(r.ignoreLeading=!0),a.includes("h")&&(r.humanNumeric=!0),a.includes("V")&&(r.versionSort=!0),a.includes("d")&&(r.dictionaryOrder=!0),a.includes("M")&&(r.monthSort=!0),o=o.slice(0,-a.length)}let t=o.split(".");if(t[0]){let a=parseInt(t[0],10);if(!Number.isNaN(a)&&a>=1&&(r.endField=a),t.length>1&&t[1]){let f=parseInt(t[1],10);!Number.isNaN(f)&&f>=1&&(r.endChar=f)}}}return r}var q={name:"sort",summary:"sort lines of text files",usage:"sort [OPTION]... [FILE]...",options:["-b, --ignore-leading-blanks ignore leading blanks","-d, --dictionary-order consider only blanks and alphanumeric characters","-f, --ignore-case fold lower case to upper case characters","-h, --human-numeric-sort compare human readable numbers (e.g., 2K 1G)","-M, --month-sort compare (unknown) < 'JAN' < ... < 'DEC'","-n, --numeric-sort compare according to string numerical value","-r, --reverse reverse the result of comparisons","-V, --version-sort natural sort of (version) numbers within text","-c, --check check for sorted input; do not sort","-o, --output=FILE write result to FILE instead of stdout","-s, --stable stabilize sort by disabling last-resort comparison","-u, --unique output only unique lines","-k, --key=KEYDEF sort via a key; KEYDEF gives location and type","-t, --field-separator=SEP use SEP as field separator"," --help display this help and exit"],description:`KEYDEF is F[.C][OPTS][,F[.C][OPTS]]
|
|
3
3
|
F is a field number (1-indexed)
|
|
4
4
|
C is a character position within the field (1-indexed)
|
|
5
5
|
OPTS can be: b d f h M n r V (per-key modifiers)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as d,b as a,c as h}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var N={name:"split",summary:"split a file into pieces",usage:"split [OPTION]... [FILE [PREFIX]]",description:"Output pieces of FILE to PREFIXaa, PREFIXab, ...; default size is 1000 lines, and default PREFIX is 'x'.",options:["-l N Put N lines per output file","-b SIZE Put SIZE bytes per output file (K, M, G suffixes)","-n CHUNKS Split into CHUNKS equal-sized files","-d Use numeric suffixes (00, 01, ...) instead of alphabetic","-a LENGTH Use suffixes of length LENGTH (default: 2)","--additional-suffix=SUFFIX Append SUFFIX to file names"],examples:["split -l 100 file.txt # Split into 100-line chunks","split -b 1M file.bin # Split into 1MB chunks","split -n 5 file.txt # Split into 5 equal parts","split -d file.txt part_ # part_00, part_01, ...","split -a 3 -d file.txt x # x000, x001, ..."]};function p(s){let l=s.match(/^(\d+)([KMGTPEZY]?)([B]?)$/i);if(!l)return null;let e=Number.parseInt(l[1],10);if(Number.isNaN(e)||e<1)return null;let u=(l[2]||"").toUpperCase(),o={"":1,K:1024,M:1024*1024,G:1024*1024*1024,T:1024*1024*1024*1024,P:1024*1024*1024*1024*1024}[u];return o===void 0?null:e*o}function k(s,l,e){if(l)return s.toString().padStart(e,"0");let u="abcdefghijklmnopqrstuvwxyz",t="",o=s;for(let r=0;r<e;r++)t=u[o%26]+t,o=Math.floor(o/26);return t}function y(s,l){let e=s.split(`
|
|
3
|
+
`),u=s.endsWith(`
|
|
4
|
+
`)&&e[e.length-1]==="";u&&e.pop();let t=[];for(let o=0;o<e.length;o+=l){let r=e.slice(o,o+l),c=o+l>=e.length&&!u?r.join(`
|
|
5
|
+
`):`${r.join(`
|
|
6
|
+
`)}
|
|
7
|
+
`;t.push({content:c,hasContent:!0})}return t}function C(s,l){let u=new TextEncoder().encode(s),t=new TextDecoder,o=[];for(let r=0;r<u.length;r+=l){let f=u.slice(r,r+l);o.push({content:t.decode(f),hasContent:f.length>0})}return o}function S(s,l){let u=new TextEncoder().encode(s),t=new TextDecoder,o=[],r=Math.ceil(u.length/l);for(let f=0;f<l;f++){let c=f*r,i=Math.min(c+r,u.length),n=u.slice(c,i);o.push({content:t.decode(n),hasContent:n.length>0})}return o}var $={name:"split",execute:async(s,l)=>{if(a(s))return d(N);let e={mode:"lines",lines:1e3,bytes:0,chunks:0,useNumericSuffix:!1,suffixLength:2,additionalSuffix:""},u=[],t=0;for(;t<s.length;){let i=s[t];if(i==="-l"&&t+1<s.length){let n=Number.parseInt(s[t+1],10);if(Number.isNaN(n)||n<1)return{exitCode:1,stdout:"",stderr:`split: invalid number of lines: '${s[t+1]}'
|
|
8
|
+
`};e.mode="lines",e.lines=n,t+=2}else if(i.match(/^-l\d+$/)){let n=Number.parseInt(i.slice(2),10);if(Number.isNaN(n)||n<1)return{exitCode:1,stdout:"",stderr:`split: invalid number of lines: '${i.slice(2)}'
|
|
9
|
+
`};e.mode="lines",e.lines=n,t++}else if(i==="-b"&&t+1<s.length){let n=p(s[t+1]);if(n===null)return{exitCode:1,stdout:"",stderr:`split: invalid number of bytes: '${s[t+1]}'
|
|
10
|
+
`};e.mode="bytes",e.bytes=n,t+=2}else if(i.match(/^-b.+$/)){let n=p(i.slice(2));if(n===null)return{exitCode:1,stdout:"",stderr:`split: invalid number of bytes: '${i.slice(2)}'
|
|
11
|
+
`};e.mode="bytes",e.bytes=n,t++}else if(i==="-n"&&t+1<s.length){let n=Number.parseInt(s[t+1],10);if(Number.isNaN(n)||n<1)return{exitCode:1,stdout:"",stderr:`split: invalid number of chunks: '${s[t+1]}'
|
|
12
|
+
`};e.mode="chunks",e.chunks=n,t+=2}else if(i.match(/^-n\d+$/)){let n=Number.parseInt(i.slice(2),10);if(Number.isNaN(n)||n<1)return{exitCode:1,stdout:"",stderr:`split: invalid number of chunks: '${i.slice(2)}'
|
|
13
|
+
`};e.mode="chunks",e.chunks=n,t++}else if(i==="-a"&&t+1<s.length){let n=Number.parseInt(s[t+1],10);if(Number.isNaN(n)||n<1)return{exitCode:1,stdout:"",stderr:`split: invalid suffix length: '${s[t+1]}'
|
|
14
|
+
`};e.suffixLength=n,t+=2}else if(i.match(/^-a\d+$/)){let n=Number.parseInt(i.slice(2),10);if(Number.isNaN(n)||n<1)return{exitCode:1,stdout:"",stderr:`split: invalid suffix length: '${i.slice(2)}'
|
|
15
|
+
`};e.suffixLength=n,t++}else if(i==="-d"||i==="--numeric-suffixes")e.useNumericSuffix=!0,t++;else if(i.startsWith("--additional-suffix="))e.additionalSuffix=i.slice(20),t++;else if(i==="--additional-suffix"&&t+1<s.length)e.additionalSuffix=s[t+1],t+=2;else if(i==="--"){u.push(...s.slice(t+1));break}else{if(i.startsWith("-")&&i!=="-")return h("split",i);u.push(i),t++}}let o="-",r="x";u.length>=1&&(o=u[0]),u.length>=2&&(r=u[1]);let f;if(o==="-")f=l.stdin??"";else{let i=l.fs.resolvePath(l.cwd,o),n=await l.fs.readFile(i);if(n===null)return{exitCode:1,stdout:"",stderr:`split: ${o}: No such file or directory
|
|
16
|
+
`};f=n}if(f==="")return{exitCode:0,stdout:"",stderr:""};let c;switch(e.mode){case"lines":c=y(f,e.lines);break;case"bytes":c=C(f,e.bytes);break;case"chunks":c=S(f,e.chunks);break;default:return e.mode}for(let i=0;i<c.length;i++){let n=c[i];if(!n.hasContent)continue;let m=k(i,e.useNumericSuffix,e.suffixLength),x=`${r}${m}${e.additionalSuffix}`,b=l.fs.resolvePath(l.cwd,x);await l.fs.writeFile(b,n.content)}return{exitCode:0,stdout:"",stderr:""}}};export{$ as split};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as d}from"./chunk-TA7RUHGQ.js";import{a as u,b as g}from"./chunk-GTNBSMZR.js";import"./chunk-
|
|
2
|
+
import{a as d}from"./chunk-TA7RUHGQ.js";import{a as u,b as g}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var S={name:"stat",summary:"display file or file system status",usage:"stat [OPTION]... FILE...",options:["-c FORMAT use the specified FORMAT instead of the default"," --help display this help and exit"]},$={format:{short:"c",type:"string"}},x={name:"stat",async execute(e,a){if(g(e))return u(S);let s=d("stat",e,$);if(!s.ok)return s.error;let n=s.result.flags.format??null,c=s.result.positional;if(c.length===0)return{stdout:"",stderr:`stat: missing operand
|
|
3
3
|
`,exitCode:1};let o="",p="",f=!1;for(let i of c){let h=a.fs.resolvePath(a.cwd,i);try{let r=await a.fs.stat(h);if(n){let t=n,l=r.mode.toString(8),y=m(r.mode,r.isDirectory);t=t.replace(/%n/g,i),t=t.replace(/%N/g,`'${i}'`),t=t.replace(/%s/g,String(r.size)),t=t.replace(/%F/g,r.isDirectory?"directory":"regular file"),t=t.replace(/%a/g,l),t=t.replace(/%A/g,y),t=t.replace(/%u/g,"1000"),t=t.replace(/%U/g,"user"),t=t.replace(/%g/g,"1000"),t=t.replace(/%G/g,"group"),o+=`${t}
|
|
4
4
|
`}else{let t=r.mode.toString(8).padStart(4,"0"),l=m(r.mode,r.isDirectory);o+=` File: ${i}
|
|
5
5
|
`,o+=` Size: ${r.size} Blocks: ${Math.ceil(r.size/512)}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as c,b as f,c as d}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var m={name:"strings",summary:"print the sequences of printable characters in files",usage:"strings [OPTION]... [FILE]...",description:"For each FILE, print the printable character sequences that are at least MIN characters long. If no FILE is specified, standard input is read.",options:["-n MIN Print sequences of at least MIN characters (default: 4)","-t FORMAT Print offset before each string (o=octal, x=hex, d=decimal)","-a Scan the entire file (default behavior)","-e ENCODING Select character encoding (s=7-bit, S=8-bit)"],examples:["strings file.bin # Extract strings (min 4 chars)","strings -n 8 file.bin # Extract strings (min 8 chars)","strings -t x file.bin # Show hex offset","echo 'hello' | strings # Read from stdin"]};function p(n){return n>=32&&n<=126||n===9}function u(n,s){if(s===null)return"";switch(s){case"o":return`${n.toString(8).padStart(7," ")} `;case"x":return`${n.toString(16).padStart(7," ")} `;case"d":return`${n.toString(10).padStart(7," ")} `;default:return s}}function h(n,s){let o=[],r="",i=0,l=typeof n=="string"?new TextEncoder().encode(n):n;for(let e=0;e<l.length;e++){let t=l[e];if(p(t))r.length===0&&(i=e),r+=String.fromCharCode(t);else{if(r.length>=s.minLength){let a=u(i,s.offsetFormat);o.push(`${a}${r}`)}r=""}}if(r.length>=s.minLength){let e=u(i,s.offsetFormat);o.push(`${e}${r}`)}return o}var N={name:"strings",execute:async(n,s)=>{if(f(n))return c(m);let o={minLength:4,offsetFormat:null},r=[],i=0;for(;i<n.length;){let e=n[i];if(e==="-n"&&i+1<n.length){let t=Number.parseInt(n[i+1],10);if(Number.isNaN(t)||t<1)return{exitCode:1,stdout:"",stderr:`strings: invalid minimum string length: '${n[i+1]}'
|
|
3
|
+
`};o.minLength=t,i+=2}else if(e.match(/^-n\d+$/)){let t=Number.parseInt(e.slice(2),10);if(Number.isNaN(t)||t<1)return{exitCode:1,stdout:"",stderr:`strings: invalid minimum string length: '${e.slice(2)}'
|
|
4
|
+
`};o.minLength=t,i++}else if(e.match(/^-\d+$/)){let t=Number.parseInt(e.slice(1),10);if(Number.isNaN(t)||t<1)return{exitCode:1,stdout:"",stderr:`strings: invalid minimum string length: '${e.slice(1)}'
|
|
5
|
+
`};o.minLength=t,i++}else if(e==="-t"&&i+1<n.length){let t=n[i+1];if(t!=="o"&&t!=="x"&&t!=="d")return{exitCode:1,stdout:"",stderr:`strings: invalid radix: '${t}'
|
|
6
|
+
`};o.offsetFormat=t,i+=2}else if(e.startsWith("-t")&&e.length===3){let t=e[2];if(t!=="o"&&t!=="x"&&t!=="d")return{exitCode:1,stdout:"",stderr:`strings: invalid radix: '${t}'
|
|
7
|
+
`};o.offsetFormat=t,i++}else if(e==="-a"||e==="--all"||e==="-")e==="-"&&r.push(e),i++;else if(e==="-e"&&i+1<n.length){let t=n[i+1];if(t!=="s"&&t!=="S")return{exitCode:1,stdout:"",stderr:`strings: invalid encoding: '${t}'
|
|
8
|
+
`};i+=2}else if(e.startsWith("-e")&&e.length===3){let t=e[2];if(t!=="s"&&t!=="S")return{exitCode:1,stdout:"",stderr:`strings: invalid encoding: '${t}'
|
|
9
|
+
`};i++}else if(e==="--"){r.push(...n.slice(i+1));break}else{if(e.startsWith("-")&&e!=="-")return d("strings",e);r.push(e),i++}}let l="";if(r.length===0){let e=s.stdin??"",t=h(e,o);l=t.length>0?`${t.join(`
|
|
10
|
+
`)}
|
|
11
|
+
`:""}else for(let e of r){let t;if(e==="-")t=s.stdin??"";else{let g=s.fs.resolvePath(s.cwd,e);if(t=await s.fs.readFile(g),t===null)return{exitCode:1,stdout:l,stderr:`strings: ${e}: No such file or directory
|
|
12
|
+
`}}let a=h(t,o);a.length>0&&(l+=`${a.join(`
|
|
13
|
+
`)}
|
|
14
|
+
`)}return{exitCode:0,stdout:l,stderr:""}}};export{N as strings};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-KGOUQS5A.js";async function i(t,o){if(t.length>0&&t[0]!=="-"){let c=t[0].startsWith("/")?t[0]:`${o.cwd}/${t[0]}`;try{let n=(await o.fs.readFile(c)).split(`
|
|
3
3
|
`);n[n.length-1]===""&&n.pop();let s=n.reverse();return{stdout:s.length>0?`${s.join(`
|
|
4
4
|
`)}
|
|
5
5
|
`:"",stderr:"",exitCode:0}}catch{return{stdout:"",stderr:`tac: ${t[0]}: No such file or directory
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a,b as n,d as l}from"./chunk-J7BCMQDI.js";import{a as i,b as s}from"./chunk-GTNBSMZR.js";import"./chunk-
|
|
2
|
+
import{a,b as n,d as l}from"./chunk-J7BCMQDI.js";import{a as i,b as s}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var h={name:"tail",summary:"output the last part of files",usage:"tail [OPTION]... [FILE]...",options:["-c, --bytes=NUM print the last NUM bytes","-n, --lines=NUM print the last NUM lines (default 10)","-n +NUM print starting from line NUM","-q, --quiet never print headers giving file names","-v, --verbose always print headers giving file names"," --help display this help and exit"]},c={name:"tail",async execute(t,r){if(s(t))return i(h);let e=a(t,"tail");if(!e.ok)return e.error;let{lines:o,bytes:p,fromLine:m}=e.options;return n(r,e.options,"tail",f=>l(f,o,p,m??!1))}};export{c as tailCommand};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as d}from"./chunk-TA7RUHGQ.js";import{a as p,b as l}from"./chunk-GTNBSMZR.js";import"./chunk-
|
|
2
|
+
import{a as d}from"./chunk-TA7RUHGQ.js";import{a as p,b as l}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var h={name:"tee",summary:"read from stdin and write to stdout and files",usage:"tee [OPTION]... [FILE]...",options:["-a, --append append to the given FILEs, do not overwrite"," --help display this help and exit"]},m={append:{short:"a",long:"append",type:"boolean"}},g={name:"tee",async execute(r,e){if(l(r))return p(h);let t=d("tee",r,m);if(!t.ok)return t.error;let{append:f}=t.result.flags,c=t.result.positional,o=e.stdin,n="",a=0;for(let i of c)try{let s=e.fs.resolvePath(e.cwd,i);f?await e.fs.appendFile(s,o):await e.fs.writeFile(s,o)}catch{n+=`tee: ${i}: No such file or directory
|
|
3
3
|
`,a=1}return{stdout:o,stderr:n,exitCode:a}}};export{g as teeCommand};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as c,b as f,c as u}from"./chunk-GTNBSMZR.js";import"./chunk-
|
|
2
|
+
import{a as c,b as f,c as u}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var x={name:"timeout",summary:"run a command with a time limit",usage:"timeout [OPTION] DURATION COMMAND [ARG]...",description:`Start COMMAND, and kill it if still running after DURATION.
|
|
3
3
|
|
|
4
4
|
DURATION is a number with optional suffix:
|
|
5
5
|
s - seconds (default)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as f}from"./chunk-4VDEBYW7.js";import{c as r}from"./chunk-GTNBSMZR.js";import"./chunk-
|
|
2
|
+
import{a as f}from"./chunk-4VDEBYW7.js";import{c as r}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var l={name:"touch",async execute(u,e){let s=[];for(let t of u){if(t.startsWith("--"))return r("touch",t);if(t.startsWith("-")&&t.length>1)return r("touch",t);s.push(t)}if(s.length===0)return{stdout:"",stderr:`touch: missing file operand
|
|
3
3
|
`,exitCode:1};let n="",i=0;for(let t of s)try{let o=e.fs.resolvePath(e.cwd,t);await e.fs.exists(o)||await e.fs.writeFile(o,"")}catch(o){n+=`touch: cannot touch '${t}': ${f(o)}
|
|
4
4
|
`,i=1}return{stdout:"",stderr:n,exitCode:i}}};export{l as touchCommand};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as C}from"./chunk-TA7RUHGQ.js";import{a as g,b as m}from"./chunk-GTNBSMZR.js";import"./chunk-
|
|
2
|
+
import{a as C}from"./chunk-TA7RUHGQ.js";import{a as g,b as m}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var x={name:"tr",summary:"translate or delete characters",usage:"tr [OPTION]... SET1 [SET2]",options:["-c, -C, --complement use the complement of SET1","-d, --delete delete characters in SET1","-s, --squeeze-repeats squeeze repeated characters"," --help display this help and exit"],description:`SET syntax:
|
|
3
3
|
a-z character range
|
|
4
4
|
[:alnum:] all letters and digits
|
|
5
5
|
[:alpha:] all letters
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as P}from"./chunk-TA7RUHGQ.js";import{a as $,b as w}from"./chunk-GTNBSMZR.js";import"./chunk-
|
|
2
|
+
import{a as P}from"./chunk-TA7RUHGQ.js";import{a as $,b as w}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var g={name:"tree",summary:"list contents of directories in a tree-like format",usage:"tree [OPTION]... [DIRECTORY]...",options:["-a include hidden files","-d list directories only","-L LEVEL limit depth of directory tree","-f print full path prefix for each file"," --help display this help and exit"]},O={showHidden:{short:"a",type:"boolean"},directoriesOnly:{short:"d",type:"boolean"},fullPath:{short:"f",type:"boolean"},maxDepth:{short:"L",type:"number"}},N={name:"tree",async execute(s,o){if(w(s))return $(g);let e=P("tree",s,O);if(!e.ok)return e.error;let u={showHidden:e.result.flags.showHidden,directoriesOnly:e.result.flags.directoriesOnly,maxDepth:e.result.flags.maxDepth??null,fullPath:e.result.flags.fullPath},a=e.result.positional;a.length===0&&a.push(".");let t="",c="",l=0,r=0;for(let i of a){let n=await b(o,i,u,"",0);t+=n.output,c+=n.stderr,l+=n.dirCount,r+=n.fileCount}return t+=`
|
|
3
3
|
${l} director${l===1?"y":"ies"}`,u.directoriesOnly||(t+=`, ${r} file${r===1?"":"s"}`),t+=`
|
|
4
4
|
`,{stdout:t,stderr:c,exitCode:c?1:0}}};async function b(s,o,e,u,a){let t={output:"",stderr:"",dirCount:0,fileCount:0},c=s.fs.resolvePath(s.cwd,o);try{if(!(await s.fs.stat(c)).isDirectory)return t.output=`${o}
|
|
5
5
|
`,t.fileCount=1,t}catch{return t.stderr=`tree: ${o}: No such file or directory
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-KGOUQS5A.js";var e={name:"true",async execute(){return{stdout:"",stderr:"",exitCode:0}}},t={name:"false",async execute(){return{stdout:"",stderr:"",exitCode:1}}};export{t as falseCommand,e as trueCommand};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as b,b as g,c as m}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var k={name:"unexpand",summary:"convert spaces to tabs",usage:"unexpand [OPTION]... [FILE]...",description:"Convert blanks in each FILE to TABs, writing to standard output. If no FILE is specified, standard input is read.",options:["-t N Use N spaces per tab (default: 8)","-t LIST Use comma-separated list of tab stops","-a Convert all sequences of blanks (not just leading)"],examples:["unexpand file.txt # Convert leading spaces to tabs","unexpand -a file.txt # Convert all space sequences","unexpand -t 4 file.txt # Use 4-space tabs"]};function d(s){let i=s.split(",").map(o=>o.trim()),e=[];for(let o of i){let n=parseInt(o,10);if(Number.isNaN(n)||n<1)return null;e.push(n)}for(let o=1;o<e.length;o++)if(e[o]<=e[o-1])return null;return e}function v(s,i){if(i.length===1){let e=i[0];return s+(e-s%e)}for(let e of i)if(e>s)return e;if(i.length>=2){let e=i[i.length-1]-i[i.length-2],o=i[i.length-1],n=Math.floor((s-o)/e)+1;return o+n*e}return-1}function L(s,i){let{tabStops:e,allBlanks:o}=i,n="",a=0,t="",l=0,u=!0,f=()=>{if(t.length===0)return;let r=l+t.length;if(!o&&!u){n+=t,t="";return}let p=l,c="";for(;p<r;){let h=v(p,e);if(h<=r&&h>p)c+=" ",p=h;else break}let x=r-p;x>0&&(c+=" ".repeat(x)),n+=c,t=""};for(let r of s)r===" "?(t.length===0&&(l=a),t+=r,a++):r===" "?(f(),n+=r,a=v(a,e)):(f(),n+=r,a++,u=!1);return f(),n}function C(s,i){if(s==="")return"";let e=s.split(`
|
|
3
|
+
`),o=s.endsWith(`
|
|
4
|
+
`)&&e[e.length-1]==="";return o&&e.pop(),e.map(a=>L(a,i)).join(`
|
|
5
|
+
`)+(o?`
|
|
6
|
+
`:"")}var w={name:"unexpand",execute:async(s,i)=>{if(g(s))return b(k);let e={tabStops:[8],allBlanks:!1},o=[],n=0;for(;n<s.length;){let t=s[n];if(t==="-t"&&n+1<s.length){let l=d(s[n+1]);if(!l)return{exitCode:1,stdout:"",stderr:`unexpand: invalid tab size: '${s[n+1]}'
|
|
7
|
+
`};e.tabStops=l,n+=2}else if(t.startsWith("-t")&&t.length>2){let l=d(t.slice(2));if(!l)return{exitCode:1,stdout:"",stderr:`unexpand: invalid tab size: '${t.slice(2)}'
|
|
8
|
+
`};e.tabStops=l,n++}else if(t==="--tabs"&&n+1<s.length){let l=d(s[n+1]);if(!l)return{exitCode:1,stdout:"",stderr:`unexpand: invalid tab size: '${s[n+1]}'
|
|
9
|
+
`};e.tabStops=l,n+=2}else if(t.startsWith("--tabs=")){let l=d(t.slice(7));if(!l)return{exitCode:1,stdout:"",stderr:`unexpand: invalid tab size: '${t.slice(7)}'
|
|
10
|
+
`};e.tabStops=l,n++}else if(t==="-a"||t==="--all")e.allBlanks=!0,n++;else if(t==="--"){o.push(...s.slice(n+1));break}else{if(t.startsWith("-")&&t!=="-")return m("unexpand",t);o.push(t),n++}}let a="";if(o.length===0){let t=i.stdin??"";a=C(t,e)}else for(let t of o){let l=i.fs.resolvePath(i.cwd,t),u=await i.fs.readFile(l);if(u===null)return{exitCode:1,stdout:a,stderr:`unexpand: ${t}: No such file or directory
|
|
11
|
+
`};a+=C(u,e)}return{exitCode:0,stdout:a,stderr:""}}};export{w as unexpand};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{b as g}from"./chunk-J7MJV6WO.js";import{a as f}from"./chunk-TA7RUHGQ.js";import{a as p,b as d}from"./chunk-GTNBSMZR.js";import"./chunk-
|
|
2
|
+
import{b as g}from"./chunk-J7MJV6WO.js";import{a as f}from"./chunk-TA7RUHGQ.js";import{a as p,b as d}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var b={name:"uniq",summary:"report or omit repeated lines",usage:"uniq [OPTION]... [INPUT [OUTPUT]]",options:["-c, --count prefix lines by the number of occurrences","-d, --repeated only print duplicate lines","-i, --ignore-case ignore case when comparing","-u, --unique only print unique lines"," --help display this help and exit"]},w={count:{short:"c",long:"count",type:"boolean"},duplicatesOnly:{short:"d",long:"repeated",type:"boolean"},uniqueOnly:{short:"u",long:"unique",type:"boolean"},ignoreCase:{short:"i",long:"ignore-case",type:"boolean"}},P={name:"uniq",async execute(a,m){if(d(a))return p(b);let o=f("uniq",a,w);if(!o.ok)return o.error;let{count:h,duplicatesOnly:y,uniqueOnly:q,ignoreCase:C}=o.result.flags,O=o.result.positional,u=await g(m,O,{cmdName:"uniq"});if(!u.ok)return u.error;let n=u.content.split(`
|
|
3
3
|
`);if(n.length>0&&n[n.length-1]===""&&n.pop(),n.length===0)return{stdout:"",stderr:"",exitCode:0};let t=[],r=n[0],i=1,x=(e,s)=>C?e.toLowerCase()===s.toLowerCase():e===s;for(let e=1;e<n.length;e++)x(n[e],r)?i++:(t.push({line:r,count:i}),r=n[e],i=1);t.push({line:r,count:i});let l=t;y?l=t.filter(e=>e.count>1):q&&(l=t.filter(e=>e.count===1));let c="";for(let{line:e,count:s}of l)h?c+=`${String(s).padStart(4)} ${e}
|
|
4
4
|
`:c+=`${e}
|
|
5
5
|
`;return{stdout:c,stderr:"",exitCode:0}}};export{P as uniqCommand};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as y}from"./chunk-J7MJV6WO.js";import{a as g}from"./chunk-TA7RUHGQ.js";import{a as w,b as m}from"./chunk-GTNBSMZR.js";import"./chunk-
|
|
2
|
+
import{a as y}from"./chunk-J7MJV6WO.js";import{a as g}from"./chunk-TA7RUHGQ.js";import{a as w,b as m}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var C={name:"wc",summary:"print newline, word, and byte counts for each file",usage:"wc [OPTION]... [FILE]...",options:["-c, --bytes print the byte counts","-m, --chars print the character counts","-l, --lines print the newline counts","-w, --words print the word counts"," --help display this help and exit"]},S={lines:{short:"l",long:"lines",type:"boolean"},words:{short:"w",long:"words",type:"boolean"},bytes:{short:"c",long:"bytes",type:"boolean"},chars:{short:"m",long:"chars",type:"boolean"}},L={name:"wc",async execute(n,l){if(m(n))return w(C);let r=g("wc",n,S);if(!r.ok)return r.error;let{lines:s,words:t}=r.result.flags,e=r.result.flags.bytes||r.result.flags.chars,o=r.result.positional;!s&&!t&&!e&&(s=t=e=!0);let i=await y(l,o,{cmdName:"wc",stopOnError:!1});if(o.length===0){let f=b(i.files[0].content);return{stdout:`${h(f,s,t,e,"")}
|
|
3
3
|
`,stderr:"",exitCode:0}}let c="",u=0,d=0,p=0;for(let{filename:f,content:x}of i.files){let a=b(x);u+=a.lines,d+=a.words,p+=a.chars,c+=`${h(a,s,t,e,f)}
|
|
4
4
|
`}return o.length>1&&(c+=`${h({lines:u,words:d,chars:p},s,t,e,"total")}
|
|
5
5
|
`),{stdout:c,stderr:i.stderr,exitCode:i.exitCode}}};function b(n){let l=n.length,r=0,s=0,t=!1;for(let e=0;e<l;e++){let o=n[e];o===`
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as u}from"./chunk-TA7RUHGQ.js";import{a as f,b as h}from"./chunk-GTNBSMZR.js";import"./chunk-
|
|
2
|
+
import{a as u}from"./chunk-TA7RUHGQ.js";import{a as f,b as h}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var w={name:"which",summary:"locate a command",usage:"which [-as] program ...",options:["-a List all instances of executables found","-s No output, just return 0 if found, 1 if not","--help display this help and exit"]},g={showAll:{short:"a",type:"boolean"},silent:{short:"s",type:"boolean"}},A={name:"which",async execute(s,e){if(h(s))return f(w);let t=u("which",s,g);if(!t.ok)return t.error;let c=t.result.flags.showAll,p=t.result.flags.silent,o=t.result.positional;if(o.length===0)return{stdout:"",stderr:"",exitCode:1};let d=(e.env.PATH||"/bin:/usr/bin").split(":"),n="",r=!0;for(let m of o){let a=!1;for(let i of d){if(!i)continue;let l=`${i}/${m}`;if(await e.fs.exists(l)&&(a=!0,p||(n+=`${l}
|
|
3
3
|
`),!c))break}a||(r=!1)}return{stdout:n,stderr:"",exitCode:r?0:1}}};export{A as whichCommand};
|