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,4 +1,4 @@
|
|
|
1
|
-
import{a as N}from"./chunk-UJMN5NLH.js";import{a as L,b as B,c as H}from"./chunk-NWEGHOXL.js";import{a as I,b as O}from"./chunk-74CEPOFO.js";import"./chunk-
|
|
1
|
+
import{a as N}from"./chunk-UJMN5NLH.js";import{a as L,b as B,c as H}from"./chunk-NWEGHOXL.js";import{a as I,b as O}from"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";function w(e,s){switch(e.type){case"name":return{matches:N(s.name,e.pattern,e.ignoreCase),pruned:!1,printed:!1};case"path":return{matches:N(s.relativePath,e.pattern,e.ignoreCase),pruned:!1,printed:!1};case"regex":try{let n=e.ignoreCase?"i":"";return{matches:new RegExp(e.pattern,n).test(s.relativePath),pruned:!1,printed:!1}}catch{return{matches:!1,pruned:!1,printed:!1}}case"type":return e.fileType==="f"?{matches:s.isFile,pruned:!1,printed:!1}:e.fileType==="d"?{matches:s.isDirectory,pruned:!1,printed:!1}:{matches:!1,pruned:!1,printed:!1};case"empty":return{matches:s.isEmpty,pruned:!1,printed:!1};case"mtime":{let i=(Date.now()-s.mtime)/(1e3*60*60*24),t;return e.comparison==="more"?t=i>e.days:e.comparison==="less"?t=i<e.days:t=Math.floor(i)===e.days,{matches:t,pruned:!1,printed:!1}}case"newer":{let n=s.newerRefTimes.get(e.refPath);return n===void 0?{matches:!1,pruned:!1,printed:!1}:{matches:s.mtime>n,pruned:!1,printed:!1}}case"size":{let n=e.value;switch(e.unit){case"c":n=e.value;break;case"k":n=e.value*1024;break;case"M":n=e.value*1024*1024;break;case"G":n=e.value*1024*1024*1024;break;case"b":n=e.value*512;break}let i;return e.comparison==="more"?i=s.size>n:e.comparison==="less"?i=s.size<n:e.unit==="b"?i=Math.ceil(s.size/512)===e.value:i=s.size===n,{matches:i,pruned:!1,printed:!1}}case"perm":{let n=s.mode&511,i=e.mode&511,t;return e.matchType==="exact"?t=n===i:e.matchType==="all"?t=(n&i)===i:t=(n&i)!==0,{matches:t,pruned:!1,printed:!1}}case"prune":return{matches:!0,pruned:!0,printed:!1};case"print":return{matches:!0,pruned:!1,printed:!0};case"not":{let n=w(e.expr,s);return{matches:!n.matches,pruned:n.pruned,printed:!1}}case"and":{let n=w(e.left,s);if(!n.matches)return{matches:!1,pruned:n.pruned,printed:!1};let i=w(e.right,s);return{matches:i.matches,pruned:n.pruned||i.pruned,printed:n.printed||i.printed}}case"or":{let n=w(e.left,s);if(n.matches)return n;let i=w(e.right,s);return{matches:i.matches,pruned:n.pruned||i.pruned,printed:i.printed}}}}function G(e){let s=[],n=i=>{i&&(i.type==="newer"?s.push(i.refPath):i.type==="not"?n(i.expr):(i.type==="and"||i.type==="or")&&(n(i.left),n(i.right)))};return n(e),s}function j(e,s){let n=[],i=[],t=s;for(;t<e.length;){let a=e[t];if(a==="("||a==="\\("){n.push({type:"lparen"}),t++;continue}if(a===")"||a==="\\)"){n.push({type:"rparen"}),t++;continue}if(a==="-name"&&t+1<e.length)n.push({type:"expr",expr:{type:"name",pattern:e[++t]}});else if(a==="-iname"&&t+1<e.length)n.push({type:"expr",expr:{type:"name",pattern:e[++t],ignoreCase:!0}});else if(a==="-path"&&t+1<e.length)n.push({type:"expr",expr:{type:"path",pattern:e[++t]}});else if(a==="-ipath"&&t+1<e.length)n.push({type:"expr",expr:{type:"path",pattern:e[++t],ignoreCase:!0}});else if(a==="-regex"&&t+1<e.length)n.push({type:"expr",expr:{type:"regex",pattern:e[++t]}});else if(a==="-iregex"&&t+1<e.length)n.push({type:"expr",expr:{type:"regex",pattern:e[++t],ignoreCase:!0}});else if(a==="-type"&&t+1<e.length){let r=e[++t];if(r==="f"||r==="d")n.push({type:"expr",expr:{type:"type",fileType:r}});else return{expr:null,pathIndex:t,error:`find: Unknown argument to -type: ${r}
|
|
2
2
|
`,actions:[]}}else if(a==="-empty")n.push({type:"expr",expr:{type:"empty"}});else if(a==="-mtime"&&t+1<e.length){let r=e[++t],c="exact",o=r;r.startsWith("+")?(c="more",o=r.slice(1)):r.startsWith("-")&&(c="less",o=r.slice(1));let h=parseInt(o,10);Number.isNaN(h)||n.push({type:"expr",expr:{type:"mtime",days:h,comparison:c}})}else if(a==="-newer"&&t+1<e.length){let r=e[++t];n.push({type:"expr",expr:{type:"newer",refPath:r}})}else if(a==="-size"&&t+1<e.length){let r=e[++t],c="exact",o=r;r.startsWith("+")?(c="more",o=r.slice(1)):r.startsWith("-")&&(c="less",o=r.slice(1));let h=o.match(/^(\d+)([ckMGb])?$/);if(h){let b=parseInt(h[1],10),y=h[2]||"b";n.push({type:"expr",expr:{type:"size",value:b,unit:y,comparison:c}})}}else if(a==="-perm"&&t+1<e.length){let r=e[++t],c="exact",o=r;r.startsWith("-")?(c="all",o=r.slice(1)):r.startsWith("/")&&(c="any",o=r.slice(1));let h=parseInt(o,8);Number.isNaN(h)||n.push({type:"expr",expr:{type:"perm",mode:h,matchType:c}})}else if(a==="-prune")n.push({type:"expr",expr:{type:"prune"}});else if(a==="-not"||a==="!")n.push({type:"not"});else if(a==="-o"||a==="-or")n.push({type:"op",op:"or"});else if(a==="-a"||a==="-and")n.push({type:"op",op:"and"});else if(a==="-maxdepth"||a==="-mindepth")t++;else if(a!=="-depth")if(a==="-exec"){let r=[];for(t++;t<e.length&&e[t]!==";"&&e[t]!=="+";)r.push(e[t]),t++;if(t>=e.length)return{expr:null,pathIndex:t,error:"find: missing argument to `-exec'\n",actions:[]};let c=e[t]==="+";i.push({type:"exec",command:r,batchMode:c})}else if(a==="-print")n.push({type:"expr",expr:{type:"print"}}),i.push({type:"print"});else if(a==="-print0")i.push({type:"print0"});else if(a==="-printf"&&t+1<e.length){let r=e[++t];i.push({type:"printf",format:r})}else if(a==="-delete")i.push({type:"delete"});else{if(a.startsWith("-"))return{expr:null,pathIndex:t,error:`find: unknown predicate '${a}'
|
|
3
3
|
`,actions:[]};if(n.length===0){t++;continue}break}t++}if(n.length===0)return{expr:null,pathIndex:t,actions:i};let m=_(n);return m.error?{expr:null,pathIndex:t,error:m.error,actions:i}:{expr:m.expr,pathIndex:t,actions:i}}function _(e){let s=0;function n(){let r=i();if(!r)return null;for(;s<e.length;){let c=e[s];if(c.type==="op"&&c.op==="or"){s++;let o=i();if(!o)return r;r={type:"or",left:r,right:o}}else break}return r}function i(){let r=t();if(!r)return null;for(;s<e.length;){let c=e[s];if(c.type==="op"&&c.op==="and"){s++;let o=t();if(!o)return r;r={type:"and",left:r,right:o}}else if(c.type==="expr"||c.type==="not"||c.type==="lparen"){let o=t();if(!o)return r;r={type:"and",left:r,right:o}}else break}return r}function t(){if(s<e.length&&e[s].type==="not"){s++;let r=t();return r?{type:"not",expr:r}:null}return m()}function m(){if(s>=e.length)return null;let r=e[s];if(r.type==="lparen"){s++;let c=n();return s<e.length&&e[s].type==="rparen"&&s++,c}return r.type==="expr"?(s++,r.expr):(r.type==="rparen",null)}return{expr:n()}}var K={name:"find",summary:"search for files in a directory hierarchy",usage:"find [path...] [expression]",options:["-name PATTERN file name matches shell pattern PATTERN","-iname PATTERN like -name but case insensitive","-path PATTERN file path matches shell pattern PATTERN","-ipath PATTERN like -path but case insensitive","-regex PATTERN file path matches regular expression PATTERN","-iregex PATTERN like -regex but case insensitive","-type TYPE file is of type: f (regular file), d (directory)","-empty file is empty or directory is empty","-mtime N file's data was modified N*24 hours ago","-newer FILE file was modified more recently than FILE","-size N[ckMGb] file uses N units of space (c=bytes, k=KB, M=MB, G=GB, b=512B blocks)","-perm MODE file's permission bits are exactly MODE (octal)","-perm -MODE all permission bits MODE are set","-perm /MODE any permission bits MODE are set","-maxdepth LEVELS descend at most LEVELS directories","-mindepth LEVELS do not apply tests at levels less than LEVELS","-depth process directory contents before directory itself","-prune do not descend into this directory","-not, ! negate the following expression","-a, -and logical AND (default)","-o, -or logical OR","-exec CMD {} ; execute CMD on each file ({} is replaced by filename)","-exec CMD {} + execute CMD with multiple files at once","-print print the full file name (default action)","-print0 print the full file name followed by a null character","-printf FORMAT print FORMAT with directives: %f %h %p %P %s %d %m %M %t","-delete delete found files/directories"," --help display this help and exit"]},U=new Set(["-name","-iname","-path","-ipath","-regex","-iregex","-type","-maxdepth","-mindepth","-mtime","-newer","-size","-perm"]),oe={name:"find",async execute(e,s){if(O(e))return I(K);let n=[],i=null,t=null,m=!1,a=!1;for(let l=0;l<e.length;l++){let p=e[l];if(p==="-maxdepth"&&l+1<e.length)a=!0,i=parseInt(e[++l],10);else if(p==="-mindepth"&&l+1<e.length)a=!0,t=parseInt(e[++l],10);else if(p==="-depth")a=!0,m=!0;else if(p==="-exec")for(a=!0,l++;l<e.length&&e[l]!==";"&&e[l]!=="+";)l++;else!p.startsWith("-")&&p!==";"&&p!=="+"&&p!=="("&&p!==")"&&p!=="\\("&&p!=="\\)"&&p!=="!"?a||n.push(p):U.has(p)?(a=!0,l++):(p.startsWith("-")||p==="("||p==="\\("||p==="!")&&(a=!0)}n.length===0&&n.push(".");let{expr:r,error:c,actions:o}=j(e,0);if(c)return{stdout:"",stderr:c,exitCode:1};let h=o.some(l=>l.type==="print"),b=o.length===0,y=[],Y=o.some(l=>l.type==="printf"),F=[],T="",D=0,V=G(r),k=new Map;for(let l of V){let p=s.fs.resolvePath(s.cwd,l);try{let g=await s.fs.stat(p);k.set(l,g.mtime?.getTime()??Date.now())}catch{}}for(let l of n){l.length>1&&l.endsWith("/")&&(l=l.slice(0,-1));let p=s.fs.resolvePath(s.cwd,l);try{await s.fs.stat(p)}catch{T+=`find: ${l}: No such file or directory
|
|
4
4
|
`,D=1;continue}async function g(u,d){if(i!==null&&d>i)return;let f;try{f=await s.fs.stat(u)}catch{return}if(!f)return;let E;u===p?E=l.split("/").pop()||l:E=u.split("/").pop()||"";let $=u===p?l:l==="."?`./${u.slice(p==="/"?p.length:p.length+1)}`:l+u.slice(p.length),M=null;f.isDirectory&&(M=await s.fs.readdir(u));let R=f.isFile?f.size===0:M!==null&&M.length===0,C=()=>{let x=t===null||d>=t,v=!1;if(x&&r!==null){let J={name:E,relativePath:$,isFile:f.isFile,isDirectory:f.isDirectory,isEmpty:R,mtime:f.mtime?.getTime()??Date.now(),size:f.size??0,mode:f.mode??420,newerRefTimes:k},z=w(r,J);x=z.matches,h?v=z.printed:v=x}else x&&(v=!0);v&&(y.push($),Y&&F.push({path:$,name:E,size:f.size??0,mtime:f.mtime?.getTime()??Date.now(),mode:f.mode??420,isDirectory:f.isDirectory,depth:d,startingPoint:l}))},A=async()=>{if(M!==null)for(let P of M){let x=u==="/"?`/${P}`:`${u}/${P}`;await g(x,d+1)}},W=!1;if(!m&&r!==null){let P={name:E,relativePath:$,isFile:f.isFile,isDirectory:f.isDirectory,isEmpty:R,mtime:f.mtime?.getTime()??Date.now(),size:f.size??0,mode:f.mode??420,newerRefTimes:k};W=w(r,P).pruned}m?(await A(),C()):(C(),W||await A())}await g(p,0)}let S="";if(o.length>0)for(let l of o)switch(l.type){case"print":S+=y.length>0?`${y.join(`
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{a as h,b as p,c as w}from"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";var m={name:"fold",summary:"wrap each input line to fit in specified width",usage:"fold [OPTION]... [FILE]...",description:"Wrap input lines in each FILE, writing to standard output. If no FILE is specified, standard input is read.",options:["-w WIDTH Use WIDTH columns instead of 80","-s Break at spaces","-b Count bytes rather than columns"],examples:["fold -w 40 file.txt # Wrap at 40 columns","fold -sw 40 file.txt # Word wrap at 40 columns","echo 'long line' | fold -w 5 # Force wrap at 5"]};function N(s,l,n){return n?new TextEncoder().encode(s).length:s===" "?8-l%8:s==="\b"?-1:1}function g(s,l){if(s.length===0)return s;let{width:n,breakAtSpaces:u,countBytes:i}=l,r=[],e="",t=0,o=-1,f=0;for(let a=0;a<s.length;a++){let d=s[a],c=N(d,t,i);t+c>n&&e.length>0?u&&o>=0?(r.push(e.slice(0,o+1)),e=e.slice(o+1)+d,t=t-f-1+c,o=-1,f=0):(r.push(e),e=d,t=c,o=-1,f=0):(e+=d,t+=c,(d===" "||d===" ")&&(o=e.length-1,f=t-c))}return e.length>0&&r.push(e),r.join(`
|
|
2
|
+
`)}function b(s,l){if(s==="")return"";let n=s.split(`
|
|
3
|
+
`),u=s.endsWith(`
|
|
4
|
+
`)&&n[n.length-1]==="";return u&&n.pop(),n.map(r=>g(r,l)).join(`
|
|
5
|
+
`)+(u?`
|
|
6
|
+
`:"")}var I={name:"fold",execute:async(s,l)=>{if(p(s))return h(m);let n={width:80,breakAtSpaces:!1,countBytes:!1},u=[],i=0;for(;i<s.length;){let e=s[i];if(e==="-w"&&i+1<s.length){let t=parseInt(s[i+1],10);if(Number.isNaN(t)||t<1)return{exitCode:1,stdout:"",stderr:`fold: invalid number of columns: '${s[i+1]}'
|
|
7
|
+
`};n.width=t,i+=2}else if(e.startsWith("-w")&&e.length>2){let t=parseInt(e.slice(2),10);if(Number.isNaN(t)||t<1)return{exitCode:1,stdout:"",stderr:`fold: invalid number of columns: '${e.slice(2)}'
|
|
8
|
+
`};n.width=t,i++}else if(e==="-s")n.breakAtSpaces=!0,i++;else if(e==="-b")n.countBytes=!0,i++;else if(e==="-bs"||e==="-sb")n.breakAtSpaces=!0,n.countBytes=!0,i++;else if(e.match(/^-[sb]+w\d+$/)){e.includes("s")&&(n.breakAtSpaces=!0),e.includes("b")&&(n.countBytes=!0);let t=e.replace(/^-[sb]+w/,""),o=parseInt(t,10);if(Number.isNaN(o)||o<1)return{exitCode:1,stdout:"",stderr:`fold: invalid number of columns: '${t}'
|
|
9
|
+
`};n.width=o,i++}else if(e.match(/^-[sb]+w$/)&&i+1<s.length){e.includes("s")&&(n.breakAtSpaces=!0),e.includes("b")&&(n.countBytes=!0);let t=parseInt(s[i+1],10);if(Number.isNaN(t)||t<1)return{exitCode:1,stdout:"",stderr:`fold: invalid number of columns: '${s[i+1]}'
|
|
10
|
+
`};n.width=t,i+=2}else if(e==="--"){u.push(...s.slice(i+1));break}else if(e.startsWith("-")&&e!=="-"){let t=e.slice(1),o=!1;for(let f of t)if(f==="s")n.breakAtSpaces=!0;else if(f==="b")n.countBytes=!0;else{o=!0;break}if(o)return w("fold",e);i++}else u.push(e),i++}let r="";if(u.length===0){let e=l.stdin??"";r=b(e,n)}else for(let e of u){let t=l.fs.resolvePath(l.cwd,e),o=await l.fs.readFile(t);if(o===null)return{exitCode:1,stdout:r,stderr:`fold: ${e}: No such file or directory
|
|
11
|
+
`};r+=b(o,n)}return{exitCode:0,stdout:r,stderr:""}}};export{I as fold};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as M}from"./chunk-UJMN5NLH.js";import{a as G,b as D,c as Q}from"./chunk-74CEPOFO.js";import"./chunk-
|
|
1
|
+
import{a as M}from"./chunk-UJMN5NLH.js";import{a as G,b as D,c as Q}from"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";var K={name:"grep",summary:"print lines that match patterns",usage:"grep [OPTION]... PATTERN [FILE]...",options:["-E, --extended-regexp PATTERN is an extended regular expression","-P, --perl-regexp PATTERN is a Perl regular expression","-F, --fixed-strings PATTERN is a set of newline-separated strings","-i, --ignore-case ignore case distinctions","-v, --invert-match select non-matching lines","-w, --word-regexp match only whole words","-x, --line-regexp match only whole lines","-c, --count print only a count of matching lines","-l, --files-with-matches print only names of files with matches","-L, --files-without-match print names of files with no matches","-m NUM, --max-count=NUM stop after NUM matches","-n, --line-number print line number with output lines","-h, --no-filename suppress the file name prefix on output","-o, --only-matching show only nonempty parts of lines that match","-q, --quiet, --silent suppress all normal output","-r, -R, --recursive search directories recursively","-A NUM print NUM lines of trailing context","-B NUM print NUM lines of leading context","-C NUM print NUM lines of context","-e PATTERN use PATTERN for matching"," --include=GLOB search only files matching GLOB"," --exclude=GLOB skip files matching GLOB"," --exclude-dir=DIR skip directories matching DIR"," --help display this help and exit"]},j={name:"grep",async execute(s,e){if(D(s))return G(K);let i=!1,r=!1,f=!1,c=!1,w=!1,d=!1,h=!1,m=!1,p=!1,g=!1,C=!1,I=!1,E=!1,N=!1,T=!1,a=0,y=0,o=0,n=[],x=[],W=[],$=null,F=[];for(let u=0;u<s.length;u++){let l=s[u];if(l.startsWith("-")&&l!=="-"){if(l==="-e"&&u+1<s.length){$=s[++u];continue}if(l.startsWith("--include=")){n.push(l.slice(10));continue}if(l.startsWith("--exclude=")){x.push(l.slice(10));continue}if(l.startsWith("--exclude-dir=")){W.push(l.slice(14));continue}if(l.startsWith("--max-count=")){a=parseInt(l.slice(12),10);continue}let P=l.match(/^-m(\d+)$/);if(P){a=parseInt(P[1],10);continue}if(l==="-m"&&u+1<s.length){a=parseInt(s[++u],10);continue}let v=l.match(/^-([ABC])(\d+)$/);if(v){let t=parseInt(v[2],10);v[1]==="A"?o=t:v[1]==="B"?y=t:v[1]==="C"&&(y=t,o=t);continue}if((l==="-A"||l==="-B"||l==="-C")&&u+1<s.length){let t=parseInt(s[++u],10);l==="-A"?o=t:l==="-B"?y=t:(y=t,o=t);continue}let U=l.startsWith("--")?[l]:l.slice(1).split("");for(let t of U)if(t==="i"||t==="--ignore-case")i=!0;else if(t==="n"||t==="--line-number")r=!0;else if(t==="v"||t==="--invert-match")f=!0;else if(t==="c"||t==="--count")c=!0;else if(t==="l"||t==="--files-with-matches")w=!0;else if(t==="L"||t==="--files-without-match")d=!0;else if(t==="r"||t==="R"||t==="--recursive")h=!0;else if(t==="w"||t==="--word-regexp")m=!0;else if(t==="x"||t==="--line-regexp")p=!0;else if(t==="E"||t==="--extended-regexp")g=!0;else if(t==="P"||t==="--perl-regexp")C=!0;else if(t==="F"||t==="--fixed-strings")I=!0;else if(t==="o"||t==="--only-matching")E=!0;else if(t==="h"||t==="--no-filename")N=!0;else if(t==="q"||t==="--quiet"||t==="--silent")T=!0;else{if(t.startsWith("--"))return Q("grep",t);if(t.length===1)return Q("grep",`-${t}`)}}else $===null?$=l:F.push(l)}if($===null)return{stdout:"",stderr:`grep: missing pattern
|
|
2
2
|
`,exitCode:2};let R;I?R=$.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"):g||C?R=$:R=V($),m&&(R=`\\b${R}\\b`),p&&(R=`^${R}$`);let O;try{O=new RegExp(R,i?"gi":"g")}catch{return{stdout:"",stderr:`grep: invalid regular expression: ${$}
|
|
3
3
|
`,exitCode:2}}if(F.length===0&&e.stdin){let u=H(e.stdin,O,f,r,c,"",E,y,o,a);return T?{stdout:"",stderr:"",exitCode:u.matched?0:1}:{stdout:u.output,stderr:"",exitCode:u.matched?0:1}}if(F.length===0)return{stdout:"",stderr:`grep: no input files
|
|
4
4
|
`,exitCode:2};let A="",S="",k=!1,q=!1,L=[];for(let u of F)if(u.includes("*")||u.includes("?")||u.includes("[")){let l=await X(u,e);if(h)for(let P of l){let v=await b(P,e,n,x,W);L.push(...v)}else L.push(...l)}else if(h){let l=await b(u,e,n,x,W);L.push(...l)}else L.push(u);let J=(L.length>1||h)&&!N;for(let u of L){let l=u.split("/").pop()||u;if(!(x.length>0&&!h&&x.some(P=>M(l,P,{stripQuotes:!0})))&&!(n.length>0&&!h&&!n.some(P=>M(l,P,{stripQuotes:!0}))))try{let P=e.fs.resolvePath(e.cwd,u);if((await e.fs.stat(P)).isDirectory){h||(S+=`grep: ${u}: Is a directory
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as z}from"./chunk-ZVV5VXYZ.js";import{a as w,b as $}from"./chunk-74CEPOFO.js";import"./chunk-
|
|
1
|
+
import{a as z}from"./chunk-ZVV5VXYZ.js";import{a as w,b as $}from"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";import{constants as x,gunzipSync as C,gzipSync as b}from"node:zlib";var I={name:"gzip",summary:"compress or expand files",usage:"gzip [OPTION]... [FILE]...",description:`Compress FILEs (by default, in-place).
|
|
2
2
|
|
|
3
3
|
When no FILE is given, or when FILE is -, read from standard input.
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as i,b as r,c as n}from"./chunk-W2EKKAIL.js";import{a as t,b as a}from"./chunk-74CEPOFO.js";import"./chunk-
|
|
1
|
+
import{a as i,b as r,c as n}from"./chunk-W2EKKAIL.js";import{a as t,b as a}from"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";var h={name:"head",summary:"output the first part of files",usage:"head [OPTION]... [FILE]...",options:["-c, --bytes=NUM print the first NUM bytes","-n, --lines=NUM print the first NUM lines (default 10)","-q, --quiet never print headers giving file names","-v, --verbose always print headers giving file names"," --help display this help and exit"]},u={name:"head",async execute(s,o){if(a(s))return t(h);let e=i(s,"head");if(!e.ok)return e.error;let{lines:p,bytes:l}=e.options;return r(o,e.options,"head",d=>n(d,p,l))}};export{u as headCommand};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-DXB73IDG.js";var r={"File operations":["ls","cat","head","tail","wc","touch","mkdir","rm","cp","mv","ln","chmod","stat","readlink"],"Text processing":["grep","sed","awk","sort","uniq","cut","tr","tee","diff"],Search:["find"],"Navigation & paths":["pwd","basename","dirname","tree","du"],"Environment & shell":["echo","printf","env","printenv","export","alias","unalias","history","clear","true","false","bash","sh"],"Data processing":["xargs","jq","base64","date"],Network:["curl","html-to-markdown"]};function l(t){let e=[],n=new Set(t);e.push(`Available commands:
|
|
2
2
|
`);let s=[];for(let[o,c]of Object.entries(r)){let a=c.filter(i=>n.has(i));if(a.length>0){e.push(` ${o}:`),e.push(` ${a.join(", ")}
|
|
3
3
|
`);for(let i of a)n.delete(i)}}for(let o of n)s.push(o);return s.length>0&&(e.push(" Other:"),e.push(` ${s.sort().join(", ")}
|
|
4
4
|
`)),e.push("Use '<command> --help' for details on a specific command."),`${e.join(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i,b as h}from"./chunk-74CEPOFO.js";import"./chunk-
|
|
1
|
+
import{a as i,b as h}from"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";var d={name:"history",summary:"display command history",usage:"history [n]",options:["-c clear the history list"," --help display this help and exit"]},l="BASH_HISTORY",m={name:"history",async execute(e,n){if(h(e))return i(d);let a=n.env[l]||"[]",t;try{t=JSON.parse(a)}catch{t=[]}if(e[0]==="-c")return n.env[l]="[]",{stdout:"",stderr:"",exitCode:0};let s=t.length;e[0]&&/^\d+$/.test(e[0])&&(s=Math.min(parseInt(e[0],10),t.length));let c=t.length-s,r="";for(let o=c;o<t.length;o++){let y=(o+1).toString().padStart(5," ");r+=`${y} ${t[o]}
|
|
2
2
|
`}return{stdout:r,stderr:"",exitCode:0}}};export{m as historyCommand};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-DXB73IDG.js";async function t(e,n){return{stdout:`localhost
|
|
2
2
|
`,stderr:"",exitCode:0}}var o={name:"hostname",execute:t};export{o as hostname};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as c,b as u,c as h}from"./chunk-74CEPOFO.js";import"./chunk-
|
|
1
|
+
import{a as c,b as u,c as h}from"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";import f from"turndown";var p={name:"html-to-markdown",summary:"convert HTML to Markdown (BashEnv extension)",usage:"html-to-markdown [OPTION]... [FILE]",description:["Convert HTML content to Markdown format using the turndown library.","This is a non-standard BashEnv extension command, not available in regular bash.","","Read HTML from FILE or standard input and output Markdown to standard output.","Commonly used with curl to convert web pages:"," curl -s https://example.com | html-to-markdown","","Supported HTML elements:"," - Headings (h1-h6) \u2192 # Markdown headings"," - Paragraphs (p) \u2192 Plain text with blank lines"," - Links (a) \u2192 [text](url)"," - Images (img) \u2192 "," - Bold/Strong \u2192 **text**"," - Italic/Em \u2192 _text_"," - Code (code, pre) \u2192 `inline` or fenced blocks"," - Lists (ul, ol, li) \u2192 - or 1. items"," - Blockquotes \u2192 > quoted text"," - Horizontal rules (hr) \u2192 ---"],options:["-b, --bullet=CHAR bullet character for unordered lists (-, +, or *)","-c, --code=FENCE fence style for code blocks (``` or ~~~)","-r, --hr=STRING string for horizontal rules (default: ---)"," --heading-style=STYLE"," heading style: 'atx' for # headings (default),"," 'setext' for underlined headings (h1/h2 only)"," --help display this help and exit"],examples:["echo '<h1>Hello</h1><p>World</p>' | html-to-markdown","html-to-markdown page.html","curl -s https://example.com | html-to-markdown > page.md"]},g={name:"html-to-markdown",async execute(r,n){if(u(r))return c(p);let s="-",a="```",i="---",m="atx",o=[];for(let t=0;t<r.length;t++){let e=r[t];if(e==="-b"||e==="--bullet")s=r[++t]??"-";else if(e.startsWith("--bullet="))s=e.slice(9);else if(e==="-c"||e==="--code")a=r[++t]??"```";else if(e.startsWith("--code="))a=e.slice(7);else if(e==="-r"||e==="--hr")i=r[++t]??"---";else if(e.startsWith("--hr="))i=e.slice(5);else if(e.startsWith("--heading-style=")){let d=e.slice(16);(d==="setext"||d==="atx")&&(m=d)}else if(e==="-")o.push("-");else{if(e.startsWith("--"))return h("html-to-markdown",e);if(e.startsWith("-"))return h("html-to-markdown",e);o.push(e)}}let l;if(o.length===0||o.length===1&&o[0]==="-")l=n.stdin;else try{let t=n.fs.resolvePath(n.cwd,o[0]);l=await n.fs.readFile(t)}catch{return{stdout:"",stderr:`html-to-markdown: ${o[0]}: No such file or directory
|
|
2
2
|
`,exitCode:1}}if(!l.trim())return{stdout:"",stderr:"",exitCode:0};try{let t=new f({bulletListMarker:s,codeBlockStyle:"fenced",fence:a,hr:i,headingStyle:m});return t.remove(["script","style","footer"]),{stdout:`${t.turndown(l).trim()}
|
|
3
3
|
`,stderr:"",exitCode:0}}catch(t){return{stdout:"",stderr:`html-to-markdown: conversion error: ${t.message}
|
|
4
4
|
`,exitCode:1}}}};export{g as htmlToMarkdownCommand};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import{a as b,b as y,c as N}from"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";var I={name:"join",summary:"join lines of two files on a common field",usage:"join [OPTION]... FILE1 FILE2",description:"For each pair of input lines with identical join fields, write a line to standard output. The default join field is the first, delimited by blanks.",options:["-1 FIELD Join on this FIELD of file 1 (default: 1)","-2 FIELD Join on this FIELD of file 2 (default: 1)","-t CHAR Use CHAR as input and output field separator","-a FILENUM Also print unpairable lines from file FILENUM (1 or 2)","-v FILENUM Like -a but only output unpairable lines","-e STRING Replace missing fields with STRING","-o FORMAT Output format (comma-separated list of FILENUM.FIELD)","-i Ignore case when comparing fields"],examples:["join file1 file2 # Join on first field","join -1 2 -2 1 file1 file2 # Join file1 col 2 with file2 col 1","join -t ',' file1.csv file2.csv # Join CSV files","join -a 1 file1 file2 # Left outer join"]};function F(t,s){return s?t.split(s):t.split(/[ \t]+/).filter(n=>n.length>0)}function L(t,s,n,f){let e=F(t,s),r=e[n-1]??"";return f&&(r=r.toLowerCase()),{fields:e,joinKey:r,original:t}}function m(t,s,n){let f=n.separator??" ";if(n.outputFormat){let l=[];for(let{file:c,field:d}of n.outputFormat){let a=c===1?t:s;a&&d===0?l.push(a.joinKey):a&&a.fields[d-1]!==void 0?l.push(a.fields[d-1]):l.push(n.emptyString)}return l.join(f)}let e=[],r=t?.joinKey??s?.joinKey??"";if(e.push(r),t)for(let l=0;l<t.fields.length;l++)l!==n.field1-1&&e.push(t.fields[l]);if(s)for(let l=0;l<s.fields.length;l++)l!==n.field2-1&&e.push(s.fields[l]);return e.join(f)}function w(t){let s=t.split(","),n=[];for(let f of s){let e=f.trim().match(/^(\d+)\.(\d+)$/);if(!e)return null;let r=Number.parseInt(e[1],10),l=Number.parseInt(e[2],10);if(r!==1&&r!==2)return null;n.push({file:r,field:l})}return n}var C={name:"join",execute:async(t,s)=>{if(y(t))return b(I);let n={field1:1,field2:1,separator:null,printUnpairable:new Set,onlyUnpairable:new Set,emptyString:"",outputFormat:null,ignoreCase:!1},f=[],e=0;for(;e<t.length;){let i=t[e];if(i==="-1"&&e+1<t.length){let o=Number.parseInt(t[e+1],10);if(Number.isNaN(o)||o<1)return{exitCode:1,stdout:"",stderr:`join: invalid field number: '${t[e+1]}'
|
|
2
|
+
`};n.field1=o,e+=2}else if(i==="-2"&&e+1<t.length){let o=Number.parseInt(t[e+1],10);if(Number.isNaN(o)||o<1)return{exitCode:1,stdout:"",stderr:`join: invalid field number: '${t[e+1]}'
|
|
3
|
+
`};n.field2=o,e+=2}else if((i==="-t"||i==="--field-separator")&&e+1<t.length)n.separator=t[e+1],e+=2;else if(i.startsWith("-t")&&i.length>2)n.separator=i.slice(2),e++;else if(i==="-a"&&e+1<t.length){let o=Number.parseInt(t[e+1],10);if(o!==1&&o!==2)return{exitCode:1,stdout:"",stderr:`join: invalid file number: '${t[e+1]}'
|
|
4
|
+
`};n.printUnpairable.add(o),e+=2}else if(i.match(/^-a[12]$/))n.printUnpairable.add(Number.parseInt(i[2],10)),e++;else if(i==="-v"&&e+1<t.length){let o=Number.parseInt(t[e+1],10);if(o!==1&&o!==2)return{exitCode:1,stdout:"",stderr:`join: invalid file number: '${t[e+1]}'
|
|
5
|
+
`};n.onlyUnpairable.add(o),e+=2}else if(i.match(/^-v[12]$/))n.onlyUnpairable.add(Number.parseInt(i[2],10)),e++;else if(i==="-e"&&e+1<t.length)n.emptyString=t[e+1],e+=2;else if(i==="-o"&&e+1<t.length){let o=w(t[e+1]);if(!o)return{exitCode:1,stdout:"",stderr:`join: invalid field spec: '${t[e+1]}'
|
|
6
|
+
`};n.outputFormat=o,e+=2}else if(i==="-i"||i==="--ignore-case")n.ignoreCase=!0,e++;else if(i==="--"){f.push(...t.slice(e+1));break}else{if(i.startsWith("-")&&i!=="-")return N("join",i);f.push(i),e++}}if(f.length!==2)return{exitCode:1,stdout:"",stderr:f.length<2?`join: missing file operand
|
|
7
|
+
`:`join: extra operand
|
|
8
|
+
`};let r=[];for(let i of f)if(i==="-")r.push(s.stdin??"");else{let o=s.fs.resolvePath(s.cwd,i),u=await s.fs.readFile(o);if(u===null)return{exitCode:1,stdout:"",stderr:`join: ${i}: No such file or directory
|
|
9
|
+
`};r.push(u)}let l=(i,o)=>{let u=i.split(`
|
|
10
|
+
`);return i.endsWith(`
|
|
11
|
+
`)&&u[u.length-1]===""&&u.pop(),u.filter(h=>h.length>0).map(h=>L(h,n.separator,o,n.ignoreCase))},c=l(r[0],n.field1),d=l(r[1],n.field2),a=new Map;for(let i of d){let o=a.get(i.joinKey);o?o.push(i):a.set(i.joinKey,[i])}let p=[],j=new Set;for(let i of c){let o=a.get(i.joinKey);if(o&&o.length>0){if(j.add(i.joinKey),n.onlyUnpairable.size===0)for(let u of o)p.push(m(i,u,n))}else(n.printUnpairable.has(1)||n.onlyUnpairable.has(1))&&p.push(m(i,null,n))}if(n.printUnpairable.has(2)||n.onlyUnpairable.has(2))for(let i of d)j.has(i.joinKey)||p.push(m(null,i,n));return{exitCode:0,stdout:p.length>0?`${p.join(`
|
|
12
|
+
`)}
|
|
13
|
+
`:"",stderr:""}}};export{C as join};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import{a as y,b as x}from"./chunk-4JO5BKO4.js";import{i as q}from"./chunk-CG2HXOFG.js";import{a as w,b as N,c as O}from"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";var E={name:"jq",summary:"command-line JSON processor",usage:"jq [OPTIONS] FILTER [FILE]",options:["-r, --raw-output output strings without quotes","-c, --compact compact output (no pretty printing)","-e, --exit-status set exit status based on output","-s, --slurp read entire input into array","-n, --null-input don't read any input","-j, --join-output don't print newlines after each output","-a, --ascii force ASCII output","-S, --sort-keys sort object keys","-C, --color colorize output (ignored)","-M, --monochrome monochrome output (ignored)"," --tab use tabs for indentation"," --help display this help and exit"]};function g(t,o,d,u,f,l=0){if(t===null||t===void 0)return"null";if(typeof t=="boolean")return String(t);if(typeof t=="number")return Number.isFinite(t)?String(t):"null";if(typeof t=="string")return d?t:JSON.stringify(t);let a=f?" ":" ";if(Array.isArray(t))return t.length===0?"[]":o?`[${t.map(p=>g(p,!0,!1,u,f)).join(",")}]`:`[
|
|
2
|
+
${t.map(p=>a.repeat(l+1)+g(p,!1,!1,u,f,l+1)).join(`,
|
|
3
|
+
`)}
|
|
4
|
+
${a.repeat(l)}]`;if(typeof t=="object"){let n=Object.keys(t);return u&&(n=n.sort()),n.length===0?"{}":o?`{${n.map(c=>`${JSON.stringify(c)}:${g(t[c],!0,!1,u,f)}`).join(",")}}`:`{
|
|
5
|
+
${n.map(c=>{let S=g(t[c],!1,!1,u,f,l+1);return`${a.repeat(l+1)}${JSON.stringify(c)}: ${S}`}).join(`,
|
|
6
|
+
`)}
|
|
7
|
+
${a.repeat(l)}}`}return String(t)}var A={name:"jq",async execute(t,o){if(N(t))return w(E);let d=!1,u=!1,f=!1,l=!1,a=!1,n=!1,p=!1,c=!1,S=".",C=!1,m=[];for(let s=0;s<t.length;s++){let e=t[s];if(e==="-r"||e==="--raw-output")d=!0;else if(e==="-c"||e==="--compact-output")u=!0;else if(e==="-e"||e==="--exit-status")f=!0;else if(e==="-s"||e==="--slurp")l=!0;else if(e==="-n"||e==="--null-input")a=!0;else if(e==="-j"||e==="--join-output")n=!0;else if(!(e==="-a"||e==="--ascii")){if(e==="-S"||e==="--sort-keys")p=!0;else if(!(e==="-C"||e==="--color")){if(!(e==="-M"||e==="--monochrome"))if(e==="--tab")c=!0;else if(e==="-")m.push("-");else{if(e.startsWith("--"))return O("jq",e);if(e.startsWith("-")){for(let r of e.slice(1))if(r==="r")d=!0;else if(r==="c")u=!0;else if(r==="e")f=!0;else if(r==="s")l=!0;else if(r==="n")a=!0;else if(r==="j")n=!0;else if(r!=="a"){if(r==="S")p=!0;else if(r!=="C"){if(r!=="M")return O("jq",`-${r}`)}}}else C?m.push(e):(S=e,C=!0)}}}}let h;if(a)h="";else if(m.length===0||m.length===1&&m[0]==="-")h=o.stdin;else try{let s=o.fs.resolvePath(o.cwd,m[0]);h=await o.fs.readFile(s)}catch{return{stdout:"",stderr:`jq: ${m[0]}: No such file or directory
|
|
8
|
+
`,exitCode:2}}try{let s=x(S),e,r={limits:o.limits?{maxIterations:o.limits.maxJqIterations}:void 0,env:o.env};if(a)e=y(null,s,r);else if(l){let i=[];for(let j of h.trim().split(`
|
|
9
|
+
`))j.trim()&&i.push(JSON.parse(j));e=y(i,s,r)}else{let i=h.trim();if(i.startsWith("{")||i.startsWith("["))e=y(JSON.parse(i),s,r);else{e=[];for(let j of i.split(`
|
|
10
|
+
`))j.trim()&&e.push(...y(JSON.parse(j),s,r))}}let I=e.map(i=>g(i,u,d,p,c)),J=n?"":`
|
|
11
|
+
`,$=I.join(J),b=f&&(e.length===0||e.every(i=>i==null||i===!1))?1:0;return{stdout:$?n?$:`${$}
|
|
12
|
+
`:"",stderr:"",exitCode:b}}catch(s){if(s instanceof q)return{stdout:"",stderr:`jq: ${s.message}
|
|
13
|
+
`,exitCode:q.EXIT_CODE};let e=s.message;return e.includes("Unknown function")?{stdout:"",stderr:`jq: error: ${e}
|
|
14
|
+
`,exitCode:3}:{stdout:"",stderr:`jq: parse error: ${e}
|
|
15
|
+
`,exitCode:5}}}};export{A as jqCommand};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as m,b as h}from"./chunk-74CEPOFO.js";import"./chunk-
|
|
1
|
+
import{a as m,b as h}from"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";var y={name:"ln",summary:"make links between files",usage:"ln [OPTIONS] TARGET LINK_NAME",options:["-s create a symbolic link instead of a hard link","-f remove existing destination files","-n treat LINK_NAME as a normal file if it is a symbolic link to a directory","-v print name of each linked file"," --help display this help and exit"]},p={name:"ln",async execute(i,s){if(h(i))return m(y);let r=!1,a=!1,d=!1,t=0;for(;t<i.length&&i[t].startsWith("-");){let e=i[t];if(e==="-s"||e==="--symbolic")r=!0,t++;else if(e==="-f"||e==="--force")a=!0,t++;else if(e==="-v"||e==="--verbose")d=!0,t++;else if(e==="-n"||e==="--no-dereference")t++;else if(/^-[sfvn]+$/.test(e))e.includes("s")&&(r=!0),e.includes("f")&&(a=!0),e.includes("v")&&(d=!0),t++;else if(e==="--"){t++;break}else return{stdout:"",stderr:`ln: invalid option -- '${e.slice(1)}'
|
|
2
2
|
`,exitCode:1}}let f=i.slice(t);if(f.length<2)return{stdout:"",stderr:`ln: missing file operand
|
|
3
3
|
`,exitCode:1};let n=f[0],l=f[1],o=s.fs.resolvePath(s.cwd,l);if(await s.fs.exists(o))if(a)try{await s.fs.rm(o,{force:!0})}catch{return{stdout:"",stderr:`ln: cannot remove '${l}': Permission denied
|
|
4
4
|
`,exitCode:1}}else return{stdout:"",stderr:`ln: failed to create ${r?"symbolic ":""}link '${l}': File exists
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as M}from"./chunk-ZVV5VXYZ.js";import{a as C,b as A}from"./chunk-74CEPOFO.js";import"./chunk-
|
|
1
|
+
import{a as M}from"./chunk-ZVV5VXYZ.js";import{a as C,b as A}from"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";import{minimatch as F}from"minimatch";function v(r){if(r<1024)return String(r);if(r<1024*1024){let e=r/1024;return e<10?`${e.toFixed(1)}K`:`${Math.round(e)}K`}if(r<1024*1024*1024){let e=r/1048576;return e<10?`${e.toFixed(1)}M`:`${Math.round(e)}M`}let o=r/(1024*1024*1024);return o<10?`${o.toFixed(1)}G`:`${Math.round(o)}G`}function D(r){let e=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][r.getMonth()],h=String(r.getDate()).padStart(2," "),m=new Date,d=new Date(m.getTime()-4320*60*60*1e3);if(r>d){let p=String(r.getHours()).padStart(2,"0"),y=String(r.getMinutes()).padStart(2,"0");return`${e} ${h} ${p}:${y}`}let $=r.getFullYear();return`${e} ${h} ${$}`}var O={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"]},W={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"}},j={name:"ls",async execute(r,o){if(A(r))return C(O);let e=M("ls",r,W);if(!e.ok)return e.error;let h=e.result.flags.showAll,m=e.result.flags.showAlmostAll,d=e.result.flags.longFormat,$=e.result.flags.humanReadable,p=e.result.flags.recursive,y=e.result.flags.reverse,g=e.result.flags.sortBySize,z=e.result.flags.directoryOnly,f=e.result.flags.sortByTime;e.result.flags.onePerLine;let s=e.result.positional;s.length===0&&s.push(".");let n="",i="",c=0;for(let t=0;t<s.length;t++){let a=s[t];if(t>0&&n&&!n.endsWith(`
|
|
2
2
|
|
|
3
3
|
`)&&(n+=`
|
|
4
4
|
`),z){let l=o.fs.resolvePath(o.cwd,a);try{let u=await o.fs.stat(l);if(d){let w=u.isDirectory?"drwxr-xr-x":"-rw-r--r--",S=u.isDirectory?"/":"",P=u.size??0,b=$?v(P).padStart(5):String(P).padStart(5),x=u.mtime??new Date(0),J=D(x);n+=`${w} 1 user user ${b} ${J} ${a}${S}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as m}from"./chunk-46TSKXFW.js";import"./chunk-74CEPOFO.js";import"./chunk-
|
|
1
|
+
import{a as m}from"./chunk-46TSKXFW.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";var o=m("md5sum","md5","compute MD5 message digest");export{o as md5sumCommand};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a}from"./chunk-ZVV5VXYZ.js";import{a as l}from"./chunk-44UOCSGV.js";import"./chunk-74CEPOFO.js";import"./chunk-
|
|
1
|
+
import{a}from"./chunk-ZVV5VXYZ.js";import{a as l}from"./chunk-44UOCSGV.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.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
|
|
2
2
|
`,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}'
|
|
3
3
|
`)}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
|
|
4
4
|
`:s.includes("EEXIST")||s.includes("already exists")?t+=`mkdir: cannot create directory '${r}': File exists
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as y}from"./chunk-ZVV5VXYZ.js";import{a as $}from"./chunk-44UOCSGV.js";import{a as g,b as u}from"./chunk-74CEPOFO.js";import"./chunk-
|
|
1
|
+
import{a as y}from"./chunk-ZVV5VXYZ.js";import{a as $}from"./chunk-44UOCSGV.js";import{a as g,b as u}from"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.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
|
|
2
2
|
`,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
|
|
3
3
|
`,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}'
|
|
4
4
|
`}}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,16 @@
|
|
|
1
|
+
import{a as f,b as m,c}from"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.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(`
|
|
2
|
+
`),t=[],u=i,o=r.endsWith(`
|
|
3
|
+
`)&&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(`
|
|
4
|
+
`)+(o?`
|
|
5
|
+
`:""),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}'
|
|
6
|
+
`};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}'
|
|
7
|
+
`};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}'
|
|
8
|
+
`};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}'
|
|
9
|
+
`};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]}'
|
|
10
|
+
`};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)}'
|
|
11
|
+
`};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]}'
|
|
12
|
+
`};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)}'
|
|
13
|
+
`};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]}'
|
|
14
|
+
`};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)}'
|
|
15
|
+
`};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
|
|
16
|
+
`};let d=b(a,i,o);u+=d.output,o=d.nextNumber}return{exitCode:0,stdout:u,stderr:""}}};export{w as nl};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-DXB73IDG.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
|
|
2
2
|
`,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(`
|
|
3
3
|
`)}
|
|
4
4
|
`,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,4 +1,4 @@
|
|
|
1
|
-
import{a as g}from"./chunk-ZVV5VXYZ.js";import{a as c,b as m}from"./chunk-74CEPOFO.js";import"./chunk-
|
|
1
|
+
import{a as g}from"./chunk-ZVV5VXYZ.js";import{a as c,b as m}from"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.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 ...
|
|
2
2
|
`,exitCode:1};let a=i.stdin?i.stdin.split(`
|
|
3
3
|
`):[""];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(`
|
|
4
4
|
`);r.length>0&&r[r.length-1]===""&&r.pop(),f.push(r)}catch{return{stdout:"",stderr:`paste: ${e}: No such file or directory
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as C,c as I}from"./chunk-NWEGHOXL.js";import{a as w}from"./chunk-44UOCSGV.js";import{a as S,b as $}from"./chunk-74CEPOFO.js";import"./chunk-
|
|
1
|
+
import{a as C,c as I}from"./chunk-NWEGHOXL.js";import{a as w}from"./chunk-44UOCSGV.js";import{a as S,b as $}from"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";import{sprintf as p}from"sprintf-js";var F={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)"]},Q={name:"printf",async execute(e,l){if($(e))return S(F);if(e.length===0)return{stdout:"",stderr:`printf: usage: printf format [arguments]
|
|
2
2
|
`,exitCode:2};let t=null,s=0;for(;s<e.length;){let a=e[s];if(a==="--"){s++;break}if(a==="-v"){if(s+1>=e.length)return{stdout:"",stderr:`printf: -v: option requires an argument
|
|
3
3
|
`,exitCode:1};if(t=e[s+1],!/^[a-zA-Z_][a-zA-Z0-9_]*(\[[^\]]+\])?$/.test(t))return{stdout:"",stderr:`printf: \`${t}': not a valid identifier
|
|
4
4
|
`,exitCode:2};s+=2}else{if(a.startsWith("-")&&a!=="-")break;break}}if(s>=e.length)return{stdout:"",stderr:`printf: usage: printf format [arguments]
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-DXB73IDG.js";var d={name:"pwd",async execute(t,e){return{stdout:`${e.cwd}
|
|
2
2
|
`,stderr:"",exitCode:0}}};export{d as pwdCommand};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as h,b as u}from"./chunk-74CEPOFO.js";import"./chunk-
|
|
1
|
+
import{a as h,b as u}from"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.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)}'
|
|
2
2
|
`,exitCode:1}}let d=i.slice(t);if(d.length===0)return{stdout:"",stderr:`readlink: missing operand
|
|
3
3
|
`,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}
|
|
4
4
|
`}else{let e=await r.fs.readlink(a);l+=`${e}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{a as f,b as a,c}from"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.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(`
|
|
2
|
+
`),i=e.endsWith(`
|
|
3
|
+
`)&&r[r.length-1]==="";return i&&r.pop(),r.map(d).join(`
|
|
4
|
+
`)+(i?`
|
|
5
|
+
`:"")};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
|
|
6
|
+
`};s+=l(i)}return{exitCode:0,stdout:s,stderr:""}}};export{v as rev};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as u}from"./chunk-ZVV5VXYZ.js";import{a as m}from"./chunk-44UOCSGV.js";import"./chunk-74CEPOFO.js";import"./chunk-
|
|
1
|
+
import{a as u}from"./chunk-ZVV5VXYZ.js";import{a as m}from"./chunk-44UOCSGV.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.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
|
|
2
2
|
`,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
|
|
3
3
|
`,i=1;continue}await s.fs.rm(n,{recursive:a,force:c}),p&&(f+=`removed '${r}'
|
|
4
4
|
`)}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,4 +1,4 @@
|
|
|
1
|
-
import{i as g}from"./chunk-CG2HXOFG.js";import{a as D,b as W,c as y}from"./chunk-74CEPOFO.js";import"./chunk-
|
|
1
|
+
import{i as g}from"./chunk-CG2HXOFG.js";import{a as D,b as W,c as y}from"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.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===`
|
|
2
2
|
`?e+=`$
|
|
3
3
|
`: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+=`
|
|
4
4
|
`,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,4 +1,4 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-DXB73IDG.js";var F={name:"seq",async execute(r){let d=`
|
|
2
2
|
`,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
|
|
3
3
|
`,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)))}'
|
|
4
4
|
`,exitCode:1};if(o===0)return{stdout:"",stderr:`seq: invalid Zero increment value: '0'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as m}from"./chunk-46TSKXFW.js";import"./chunk-74CEPOFO.js";import"./chunk-
|
|
1
|
+
import{a as m}from"./chunk-46TSKXFW.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";var e=m("sha1sum","sha1","compute SHA1 message digest");export{e as sha1sumCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as m}from"./chunk-46TSKXFW.js";import"./chunk-74CEPOFO.js";import"./chunk-
|
|
1
|
+
import{a as m}from"./chunk-46TSKXFW.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";var e=m("sha256sum","sha256","compute SHA256 message digest");export{e as sha256sumCommand};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a,b as o}from"./chunk-74CEPOFO.js";import"./chunk-
|
|
1
|
+
import{a,b as o}from"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.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:
|
|
2
2
|
s - seconds (default)
|
|
3
3
|
m - minutes
|
|
4
4
|
h - hours
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as O}from"./chunk-3YNHMZ5M.js";import{a as F,b as N,c as k}from"./chunk-74CEPOFO.js";import"./chunk-
|
|
1
|
+
import{b as O}from"./chunk-3YNHMZ5M.js";import{a as F,b as N,c as k}from"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.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]]
|
|
2
2
|
F is a field number (1-indexed)
|
|
3
3
|
C is a character position within the field (1-indexed)
|
|
4
4
|
OPTS can be: b d f h M n r V (per-key modifiers)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import{a as d,b as a,c as h}from"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.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(`
|
|
2
|
+
`),u=s.endsWith(`
|
|
3
|
+
`)&&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(`
|
|
4
|
+
`):`${r.join(`
|
|
5
|
+
`)}
|
|
6
|
+
`;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]}'
|
|
7
|
+
`};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)}'
|
|
8
|
+
`};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]}'
|
|
9
|
+
`};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)}'
|
|
10
|
+
`};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]}'
|
|
11
|
+
`};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)}'
|
|
12
|
+
`};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]}'
|
|
13
|
+
`};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)}'
|
|
14
|
+
`};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
|
|
15
|
+
`};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,4 +1,4 @@
|
|
|
1
|
-
import{a as d}from"./chunk-ZVV5VXYZ.js";import{a as u,b as g}from"./chunk-74CEPOFO.js";import"./chunk-
|
|
1
|
+
import{a as d}from"./chunk-ZVV5VXYZ.js";import{a as u,b as g}from"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.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
|
|
2
2
|
`,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}
|
|
3
3
|
`}else{let t=r.mode.toString(8).padStart(4,"0"),l=m(r.mode,r.isDirectory);o+=` File: ${i}
|
|
4
4
|
`,o+=` Size: ${r.size} Blocks: ${Math.ceil(r.size/512)}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import{a as c,b as f,c as d}from"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.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]}'
|
|
2
|
+
`};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)}'
|
|
3
|
+
`};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)}'
|
|
4
|
+
`};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}'
|
|
5
|
+
`};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}'
|
|
6
|
+
`};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}'
|
|
7
|
+
`};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}'
|
|
8
|
+
`};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(`
|
|
9
|
+
`)}
|
|
10
|
+
`:""}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
|
|
11
|
+
`}}let a=h(t,o);a.length>0&&(l+=`${a.join(`
|
|
12
|
+
`)}
|
|
13
|
+
`)}return{exitCode:0,stdout:l,stderr:""}}};export{N as strings};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-DXB73IDG.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(`
|
|
2
2
|
`);n[n.length-1]===""&&n.pop();let s=n.reverse();return{stdout:s.length>0?`${s.join(`
|
|
3
3
|
`)}
|
|
4
4
|
`:"",stderr:"",exitCode:0}}catch{return{stdout:"",stderr:`tac: ${t[0]}: No such file or directory
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b as n,d as l}from"./chunk-W2EKKAIL.js";import{a as i,b as s}from"./chunk-74CEPOFO.js";import"./chunk-
|
|
1
|
+
import{a,b as n,d as l}from"./chunk-W2EKKAIL.js";import{a as i,b as s}from"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.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,2 +1,2 @@
|
|
|
1
|
-
import{a as d}from"./chunk-ZVV5VXYZ.js";import{a as p,b as l}from"./chunk-74CEPOFO.js";import"./chunk-
|
|
1
|
+
import{a as d}from"./chunk-ZVV5VXYZ.js";import{a as p,b as l}from"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.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
|
|
2
2
|
`,a=1}return{stdout:o,stderr:n,exitCode:a}}};export{g as teeCommand};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as c,b as f,c as u}from"./chunk-74CEPOFO.js";import"./chunk-
|
|
1
|
+
import{a as c,b as f,c as u}from"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.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.
|
|
2
2
|
|
|
3
3
|
DURATION is a number with optional suffix:
|
|
4
4
|
s - seconds (default)
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as f}from"./chunk-44UOCSGV.js";import{c as r}from"./chunk-74CEPOFO.js";import"./chunk-
|
|
1
|
+
import{a as f}from"./chunk-44UOCSGV.js";import{c as r}from"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.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
|
|
2
2
|
`,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)}
|
|
3
3
|
`,i=1}return{stdout:"",stderr:n,exitCode:i}}};export{l as touchCommand};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as C}from"./chunk-ZVV5VXYZ.js";import{a as g,b as m}from"./chunk-74CEPOFO.js";import"./chunk-
|
|
1
|
+
import{a as C}from"./chunk-ZVV5VXYZ.js";import{a as g,b as m}from"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.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:
|
|
2
2
|
a-z character range
|
|
3
3
|
[:alnum:] all letters and digits
|
|
4
4
|
[:alpha:] all letters
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as P}from"./chunk-ZVV5VXYZ.js";import{a as $,b as w}from"./chunk-74CEPOFO.js";import"./chunk-
|
|
1
|
+
import{a as P}from"./chunk-ZVV5VXYZ.js";import{a as $,b as w}from"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.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+=`
|
|
2
2
|
${l} director${l===1?"y":"ies"}`,u.directoriesOnly||(t+=`, ${r} file${r===1?"":"s"}`),t+=`
|
|
3
3
|
`,{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}
|
|
4
4
|
`,t.fileCount=1,t}catch{return t.stderr=`tree: ${o}: No such file or directory
|