just-bash 2.9.4 → 2.9.6
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/dist/AGENTS.md +31 -2
- package/dist/Bash.d.ts +7 -1
- package/dist/bin/chunks/alias-3GODYSFD.js +2 -0
- package/dist/bin/chunks/awk2-PWEGD656.js +2 -0
- package/dist/bin/chunks/base64-YXBFJFHG.js +2 -0
- package/dist/bin/chunks/basename-KBUKWB2E.js +2 -0
- package/dist/bin/chunks/bash-RJTQJAKW.js +2 -0
- package/dist/bin/chunks/cat-3J7U3HHI.js +2 -0
- package/dist/bin/chunks/chmod-4O2C4V42.js +2 -0
- package/dist/bin/chunks/chunk-26NO42TF.js +14 -0
- package/dist/bin/chunks/chunk-2SIXTZCJ.js +5 -0
- package/dist/bin/chunks/chunk-3MBAUIBB.js +7 -0
- package/dist/bin/chunks/chunk-3Y32LPNT.js +2 -0
- package/dist/bin/chunks/chunk-4E3LY6YK.js +10 -0
- package/dist/bin/chunks/chunk-4P5OA25Z.js +26 -0
- package/dist/bin/chunks/chunk-4PS5JJDT.js +8 -0
- package/dist/bin/chunks/chunk-5G2VOPPJ.js +7 -0
- package/dist/bin/chunks/chunk-5U7Q4GUC.js +6 -0
- package/dist/bin/chunks/chunk-5VFN7VVJ.js +9 -0
- package/dist/bin/chunks/chunk-6VUEI2GS.js +9 -0
- package/dist/bin/chunks/chunk-7BORMNPQ.js +2 -0
- package/dist/bin/chunks/chunk-7ECKLAVW.js +11 -0
- package/dist/bin/chunks/chunk-A4442AOC.js +6 -0
- package/dist/bin/chunks/chunk-BARKRZDC.js +6 -0
- package/dist/bin/chunks/{tr-IAUNBQKH.js → chunk-BDSRLH5T.js} +5 -5
- package/dist/bin/chunks/chunk-BYDV4VEF.js +3 -0
- package/dist/bin/{shell/chunks/yq-XD7UYY5C.js → chunks/chunk-CHB75QIN.js} +24 -24
- package/dist/bin/chunks/chunk-D2GFNFUN.js +7 -0
- package/dist/bin/chunks/chunk-DAGNL3F2.js +32 -0
- package/dist/bin/chunks/{tar-CLEBMI4R.js → chunk-EFX3F2HZ.js} +6 -6
- package/dist/bin/chunks/{rmdir-OEMA5ZTD.js → chunk-EJQKHROT.js} +3 -3
- package/dist/bin/chunks/chunk-EUXCM6C4.js +12 -0
- package/dist/bin/{shell/chunks/sed-E4QAUCYQ.js → chunks/chunk-FEBB4TFH.js} +36 -36
- package/dist/bin/chunks/chunk-FLPVVSN5.js +5 -0
- package/dist/bin/chunks/chunk-ITA43A73.js +7 -0
- package/dist/bin/chunks/chunk-IY3BUFJK.js +5 -0
- package/dist/bin/chunks/chunk-JLX6YWGA.js +3 -0
- package/dist/bin/chunks/chunk-JQBC3FXE.js +8 -0
- package/dist/bin/chunks/chunk-JTF74J6E.js +2 -0
- package/dist/bin/chunks/chunk-JXC25GVQ.js +5 -0
- package/dist/bin/chunks/chunk-K47SEEPI.js +6 -0
- package/dist/bin/chunks/chunk-K7XSYP4L.js +21 -0
- package/dist/bin/chunks/chunk-KLMOJKL4.js +16 -0
- package/dist/bin/chunks/chunk-KWLLB7S3.js +7 -0
- package/dist/bin/chunks/chunk-LJKIWB5F.js +4 -0
- package/dist/bin/chunks/chunk-LMK6G2HH.js +8 -0
- package/dist/bin/chunks/{chunk-B3E7BBYK.js → chunk-LS25HZNJ.js} +41 -41
- package/dist/bin/chunks/chunk-MAVV76T4.js +2 -0
- package/dist/bin/{shell/chunks/xan-QLNZCWIG.js → chunks/chunk-MNNOATCV.js} +17 -17
- package/dist/bin/chunks/chunk-N43DJTSI.js +2 -0
- package/dist/bin/chunks/{file-MWSA2WYI.js → chunk-N5OTVT4F.js} +1 -1
- package/dist/bin/chunks/{time-F4NVQOJH.js → chunk-N73TVRMN.js} +5 -5
- package/dist/bin/chunks/chunk-NEQEZ32M.js +5 -0
- package/dist/bin/chunks/{sleep-O5BOTJGJ.js → chunk-NFZDITRV.js} +4 -4
- package/dist/bin/chunks/chunk-NSUMEERA.js +12 -0
- package/dist/bin/chunks/chunk-OIKCUTTB.js +6 -0
- package/dist/bin/chunks/chunk-P6GNZPVW.js +19 -0
- package/dist/bin/chunks/chunk-P7UCWJ33.js +12 -0
- package/dist/bin/chunks/{sqlite3-CUDCXXK3.js → chunk-PDVXLMUU.js} +9 -9
- package/dist/bin/chunks/chunk-PPBQJBC2.js +5 -0
- package/dist/bin/chunks/chunk-PQNTKMH3.js +6 -0
- package/dist/bin/chunks/chunk-PS4LOXE5.js +8 -0
- package/dist/bin/{shell/chunks/rg-IZR5557M.js → chunks/chunk-Q4QFIAHB.js} +9 -9
- package/dist/bin/chunks/chunk-QEBPVWVB.js +13 -0
- package/dist/bin/chunks/chunk-QXB5WI2V.js +16 -0
- package/dist/bin/chunks/chunk-RJSAGJQJ.js +11 -0
- package/dist/bin/chunks/chunk-ROJPSS6N.js +3 -0
- package/dist/bin/chunks/chunk-RT7TRQVZ.js +3 -0
- package/dist/bin/chunks/chunk-S7OHMN3F.js +6 -0
- package/dist/bin/chunks/{nl-DSM3NUGM.js → chunk-SGA7Y45Z.js} +7 -7
- package/dist/bin/chunks/chunk-SXRVLCZ4.js +2 -0
- package/dist/bin/chunks/chunk-TEFXEYX3.js +3 -0
- package/dist/bin/chunks/chunk-THALLNXT.js +7 -0
- package/dist/bin/chunks/chunk-THLAHQXV.js +16 -0
- package/dist/bin/chunks/chunk-TIDZOIPX.js +3 -0
- package/dist/bin/chunks/chunk-VNER2XXL.js +7 -0
- package/dist/bin/chunks/chunk-W2FKF3MM.js +9 -0
- package/dist/bin/chunks/chunk-WT2HWDDA.js +9 -0
- package/dist/bin/chunks/chunk-X2I3PJTX.js +15 -0
- package/dist/bin/chunks/chunk-XAL6VWGA.js +9 -0
- package/dist/bin/chunks/{html-to-markdown-EPEXKI4B.js → chunk-XKPFI566.js} +9 -9
- package/dist/bin/chunks/chunk-YEKSVVRC.js +11 -0
- package/dist/bin/chunks/chunk-YLE2OYY6.js +2 -0
- package/dist/bin/chunks/chunk-YYQ22ZRL.js +8 -0
- package/dist/bin/chunks/chunk-ZA4HUKJ3.js +13 -0
- package/dist/bin/chunks/chunk-ZKC5HQYO.js +14 -0
- package/dist/bin/chunks/clear-KRGKPFOI.js +2 -0
- package/dist/bin/chunks/column-XGV32UPN.js +2 -0
- package/dist/bin/chunks/comm-R3F3Z5DX.js +2 -0
- package/dist/bin/chunks/cp-XH2ZB7WT.js +2 -0
- package/dist/bin/chunks/cut-HDHQDWRG.js +2 -0
- package/dist/bin/chunks/date-6VDN5QZ5.js +2 -0
- package/dist/bin/chunks/diff-LE7GMFZD.js +2 -0
- package/dist/bin/chunks/dirname-5FAOMLBL.js +2 -0
- package/dist/bin/chunks/du-66BNA4IN.js +2 -0
- package/dist/bin/chunks/echo-2MUAOGUE.js +2 -0
- package/dist/bin/chunks/env-EVLPSWFF.js +2 -0
- package/dist/bin/chunks/expand-26XPP5KB.js +2 -0
- package/dist/bin/{shell/chunks/expansion-LR5H7O2U.js → chunks/expansion-TL4Q62VX.js} +1 -1
- package/dist/bin/chunks/expr-MLHUWFYI.js +2 -0
- package/dist/bin/chunks/file-D5YKS5NV.js +2 -0
- package/dist/bin/chunks/find-K777TRNA.js +2 -0
- package/dist/bin/chunks/flag-coverage-GELILQAH.js +2 -0
- package/dist/bin/chunks/fold-XSVNTAWH.js +2 -0
- package/dist/bin/chunks/grep-FRIPZKKT.js +2 -0
- package/dist/bin/chunks/gzip-EENEW6WQ.js +2 -0
- package/dist/bin/chunks/head-YMNRW3F3.js +2 -0
- package/dist/bin/chunks/help-JF5TTAKQ.js +2 -0
- package/dist/bin/chunks/history-UUKG55YW.js +2 -0
- package/dist/bin/chunks/hostname-WY6RKE32.js +2 -0
- package/dist/bin/chunks/html-to-markdown-WVZA3MCP.js +2 -0
- package/dist/bin/chunks/join-Y4Q5WVVE.js +2 -0
- package/dist/bin/chunks/jq-CXQ33VMW.js +2 -0
- package/dist/bin/chunks/ln-5TCJXDGY.js +2 -0
- package/dist/bin/chunks/ls-ZXYOL67L.js +2 -0
- package/dist/bin/chunks/md5sum-NCLXV2S3.js +2 -0
- package/dist/bin/chunks/mkdir-6OKMS3KO.js +2 -0
- package/dist/bin/chunks/mv-OY7X62QC.js +2 -0
- package/dist/bin/chunks/nl-XH3L75DR.js +2 -0
- package/dist/bin/chunks/od-52FBC34W.js +2 -0
- package/dist/bin/chunks/paste-3UVLMQ2K.js +2 -0
- package/dist/bin/chunks/printf-TZC5BRAY.js +2 -0
- package/dist/bin/chunks/pwd-6VBAPL3Y.js +2 -0
- package/dist/bin/chunks/readlink-YNOUXNUY.js +2 -0
- package/dist/bin/chunks/rev-UHEPS2UL.js +2 -0
- package/dist/bin/chunks/rg-3R5G2XL4.js +2 -0
- package/dist/bin/chunks/rm-5QIBTLJG.js +2 -0
- package/dist/bin/chunks/rmdir-5KLM4EA6.js +2 -0
- package/dist/bin/chunks/sed-WNL6TIIN.js +2 -0
- package/dist/bin/chunks/seq-V7KBLSQ7.js +2 -0
- package/dist/bin/chunks/sha1sum-BHNJ5ALF.js +2 -0
- package/dist/bin/chunks/sha256sum-HJJ3NJ5L.js +2 -0
- package/dist/bin/chunks/sleep-PICQVS6Q.js +2 -0
- package/dist/bin/chunks/sort-NZSEYCI6.js +2 -0
- package/dist/bin/chunks/split-NOZ7FFXW.js +2 -0
- package/dist/bin/chunks/sqlite3-4SEIR46P.js +2 -0
- package/dist/bin/chunks/stat-XH7E4E2C.js +2 -0
- package/dist/bin/chunks/strings-XXKZCWY5.js +2 -0
- package/dist/bin/chunks/tac-TZBNTR4K.js +2 -0
- package/dist/bin/chunks/tail-V537TDFR.js +2 -0
- package/dist/bin/chunks/tar-7B5KH3QG.js +2 -0
- package/dist/bin/chunks/tee-HK2SYCAR.js +2 -0
- package/dist/bin/chunks/time-4C3A4THJ.js +2 -0
- package/dist/bin/chunks/timeout-RS7REDYT.js +2 -0
- package/dist/bin/chunks/touch-DWKSZGOQ.js +2 -0
- package/dist/bin/chunks/tr-GDDRKGRB.js +2 -0
- package/dist/bin/chunks/tree-HEKABARE.js +2 -0
- package/dist/bin/chunks/true-DP5UZP52.js +2 -0
- package/dist/bin/chunks/unexpand-OYZ7KOYR.js +2 -0
- package/dist/bin/chunks/uniq-FZWFZEN5.js +2 -0
- package/dist/bin/chunks/wc-ZIV3TFVG.js +2 -0
- package/dist/bin/chunks/which-67WZ6OMV.js +2 -0
- package/dist/bin/chunks/whoami-E7PN2UWC.js +2 -0
- package/dist/bin/chunks/xan-FMSZPFX4.js +2 -0
- package/dist/bin/chunks/xargs-YWPEV2QC.js +2 -0
- package/dist/bin/chunks/yq-WUJ5JNDT.js +2 -0
- package/dist/bin/just-bash.js +200 -198
- package/dist/bin/shell/chunks/alias-3GODYSFD.js +2 -0
- package/dist/bin/shell/chunks/awk2-PWEGD656.js +2 -0
- package/dist/bin/shell/chunks/base64-YXBFJFHG.js +2 -0
- package/dist/bin/shell/chunks/basename-KBUKWB2E.js +2 -0
- package/dist/bin/shell/chunks/bash-RJTQJAKW.js +2 -0
- package/dist/bin/shell/chunks/cat-3J7U3HHI.js +2 -0
- package/dist/bin/shell/chunks/chmod-4O2C4V42.js +2 -0
- package/dist/bin/shell/chunks/chunk-26NO42TF.js +14 -0
- package/dist/bin/shell/chunks/chunk-2SIXTZCJ.js +5 -0
- package/dist/bin/shell/chunks/chunk-3MBAUIBB.js +7 -0
- package/dist/bin/shell/chunks/chunk-3Y32LPNT.js +2 -0
- package/dist/bin/shell/chunks/chunk-4E3LY6YK.js +10 -0
- package/dist/bin/shell/chunks/chunk-4P5OA25Z.js +26 -0
- package/dist/bin/shell/chunks/chunk-4PS5JJDT.js +8 -0
- package/dist/bin/shell/chunks/chunk-5G2VOPPJ.js +7 -0
- package/dist/bin/shell/chunks/chunk-5U7Q4GUC.js +6 -0
- package/dist/bin/shell/chunks/chunk-5VFN7VVJ.js +9 -0
- package/dist/bin/shell/chunks/chunk-6VUEI2GS.js +9 -0
- package/dist/bin/shell/chunks/chunk-7BORMNPQ.js +2 -0
- package/dist/bin/shell/chunks/chunk-7ECKLAVW.js +11 -0
- package/dist/bin/shell/chunks/chunk-A4442AOC.js +6 -0
- package/dist/bin/shell/chunks/chunk-BARKRZDC.js +6 -0
- package/dist/bin/shell/chunks/{tr-IAUNBQKH.js → chunk-BDSRLH5T.js} +5 -5
- package/dist/bin/shell/chunks/chunk-BYDV4VEF.js +3 -0
- package/dist/bin/{chunks/yq-XD7UYY5C.js → shell/chunks/chunk-CHB75QIN.js} +24 -24
- package/dist/bin/shell/chunks/chunk-D2GFNFUN.js +7 -0
- package/dist/bin/shell/chunks/chunk-DAGNL3F2.js +32 -0
- package/dist/bin/shell/chunks/{tar-CLEBMI4R.js → chunk-EFX3F2HZ.js} +6 -6
- package/dist/bin/shell/chunks/{rmdir-OEMA5ZTD.js → chunk-EJQKHROT.js} +3 -3
- package/dist/bin/shell/chunks/chunk-EUXCM6C4.js +12 -0
- package/dist/bin/{chunks/sed-E4QAUCYQ.js → shell/chunks/chunk-FEBB4TFH.js} +36 -36
- package/dist/bin/shell/chunks/chunk-FLPVVSN5.js +5 -0
- package/dist/bin/shell/chunks/chunk-ITA43A73.js +7 -0
- package/dist/bin/shell/chunks/chunk-IY3BUFJK.js +5 -0
- package/dist/bin/shell/chunks/chunk-JLX6YWGA.js +3 -0
- package/dist/bin/shell/chunks/chunk-JQBC3FXE.js +8 -0
- package/dist/bin/shell/chunks/chunk-JTF74J6E.js +2 -0
- package/dist/bin/shell/chunks/chunk-JXC25GVQ.js +5 -0
- package/dist/bin/shell/chunks/chunk-K47SEEPI.js +6 -0
- package/dist/bin/shell/chunks/chunk-K7XSYP4L.js +21 -0
- package/dist/bin/shell/chunks/chunk-KLMOJKL4.js +16 -0
- package/dist/bin/shell/chunks/chunk-KWLLB7S3.js +7 -0
- package/dist/bin/shell/chunks/chunk-LJKIWB5F.js +4 -0
- package/dist/bin/shell/chunks/chunk-LMK6G2HH.js +8 -0
- package/dist/bin/shell/chunks/{chunk-B3E7BBYK.js → chunk-LS25HZNJ.js} +41 -41
- package/dist/bin/shell/chunks/chunk-MAVV76T4.js +2 -0
- package/dist/bin/{chunks/xan-QLNZCWIG.js → shell/chunks/chunk-MNNOATCV.js} +17 -17
- package/dist/bin/shell/chunks/chunk-N43DJTSI.js +2 -0
- package/dist/bin/shell/chunks/{file-MWSA2WYI.js → chunk-N5OTVT4F.js} +1 -1
- package/dist/bin/shell/chunks/{time-F4NVQOJH.js → chunk-N73TVRMN.js} +5 -5
- package/dist/bin/shell/chunks/chunk-NEQEZ32M.js +5 -0
- package/dist/bin/shell/chunks/{sleep-O5BOTJGJ.js → chunk-NFZDITRV.js} +4 -4
- package/dist/bin/shell/chunks/chunk-NSUMEERA.js +12 -0
- package/dist/bin/shell/chunks/chunk-OIKCUTTB.js +6 -0
- package/dist/bin/shell/chunks/chunk-P6GNZPVW.js +19 -0
- package/dist/bin/shell/chunks/chunk-P7UCWJ33.js +12 -0
- package/dist/bin/shell/chunks/{sqlite3-CUDCXXK3.js → chunk-PDVXLMUU.js} +9 -9
- package/dist/bin/shell/chunks/chunk-PPBQJBC2.js +5 -0
- package/dist/bin/shell/chunks/chunk-PQNTKMH3.js +6 -0
- package/dist/bin/shell/chunks/chunk-PS4LOXE5.js +8 -0
- package/dist/bin/{chunks/rg-IZR5557M.js → shell/chunks/chunk-Q4QFIAHB.js} +9 -9
- package/dist/bin/shell/chunks/chunk-QEBPVWVB.js +13 -0
- package/dist/bin/shell/chunks/chunk-QXB5WI2V.js +16 -0
- package/dist/bin/shell/chunks/chunk-RJSAGJQJ.js +11 -0
- package/dist/bin/shell/chunks/chunk-ROJPSS6N.js +3 -0
- package/dist/bin/shell/chunks/chunk-RT7TRQVZ.js +3 -0
- package/dist/bin/shell/chunks/chunk-S7OHMN3F.js +6 -0
- package/dist/bin/shell/chunks/{nl-DSM3NUGM.js → chunk-SGA7Y45Z.js} +7 -7
- package/dist/bin/shell/chunks/chunk-SXRVLCZ4.js +2 -0
- package/dist/bin/shell/chunks/chunk-TEFXEYX3.js +3 -0
- package/dist/bin/shell/chunks/chunk-THALLNXT.js +7 -0
- package/dist/bin/shell/chunks/chunk-THLAHQXV.js +16 -0
- package/dist/bin/shell/chunks/chunk-TIDZOIPX.js +3 -0
- package/dist/bin/shell/chunks/chunk-VNER2XXL.js +7 -0
- package/dist/bin/shell/chunks/chunk-W2FKF3MM.js +9 -0
- package/dist/bin/shell/chunks/chunk-WT2HWDDA.js +9 -0
- package/dist/bin/shell/chunks/chunk-X2I3PJTX.js +15 -0
- package/dist/bin/shell/chunks/chunk-XAL6VWGA.js +9 -0
- package/dist/bin/shell/chunks/{html-to-markdown-EPEXKI4B.js → chunk-XKPFI566.js} +9 -9
- package/dist/bin/shell/chunks/chunk-YEKSVVRC.js +11 -0
- package/dist/bin/shell/chunks/chunk-YLE2OYY6.js +2 -0
- package/dist/bin/shell/chunks/chunk-YYQ22ZRL.js +8 -0
- package/dist/bin/shell/chunks/chunk-ZA4HUKJ3.js +13 -0
- package/dist/bin/shell/chunks/chunk-ZKC5HQYO.js +14 -0
- package/dist/bin/shell/chunks/clear-KRGKPFOI.js +2 -0
- package/dist/bin/shell/chunks/column-XGV32UPN.js +2 -0
- package/dist/bin/shell/chunks/comm-R3F3Z5DX.js +2 -0
- package/dist/bin/shell/chunks/cp-XH2ZB7WT.js +2 -0
- package/dist/bin/shell/chunks/cut-HDHQDWRG.js +2 -0
- package/dist/bin/shell/chunks/date-6VDN5QZ5.js +2 -0
- package/dist/bin/shell/chunks/diff-LE7GMFZD.js +2 -0
- package/dist/bin/shell/chunks/dirname-5FAOMLBL.js +2 -0
- package/dist/bin/shell/chunks/du-66BNA4IN.js +2 -0
- package/dist/bin/shell/chunks/echo-2MUAOGUE.js +2 -0
- package/dist/bin/shell/chunks/env-EVLPSWFF.js +2 -0
- package/dist/bin/shell/chunks/expand-26XPP5KB.js +2 -0
- package/dist/bin/{chunks/expansion-LR5H7O2U.js → shell/chunks/expansion-TL4Q62VX.js} +1 -1
- package/dist/bin/shell/chunks/expr-MLHUWFYI.js +2 -0
- package/dist/bin/shell/chunks/file-D5YKS5NV.js +2 -0
- package/dist/bin/shell/chunks/find-K777TRNA.js +2 -0
- package/dist/bin/shell/chunks/flag-coverage-GELILQAH.js +2 -0
- package/dist/bin/shell/chunks/fold-XSVNTAWH.js +2 -0
- package/dist/bin/shell/chunks/grep-FRIPZKKT.js +2 -0
- package/dist/bin/shell/chunks/gzip-EENEW6WQ.js +2 -0
- package/dist/bin/shell/chunks/head-YMNRW3F3.js +2 -0
- package/dist/bin/shell/chunks/help-JF5TTAKQ.js +2 -0
- package/dist/bin/shell/chunks/history-UUKG55YW.js +2 -0
- package/dist/bin/shell/chunks/hostname-WY6RKE32.js +2 -0
- package/dist/bin/shell/chunks/html-to-markdown-WVZA3MCP.js +2 -0
- package/dist/bin/shell/chunks/join-Y4Q5WVVE.js +2 -0
- package/dist/bin/shell/chunks/jq-CXQ33VMW.js +2 -0
- package/dist/bin/shell/chunks/ln-5TCJXDGY.js +2 -0
- package/dist/bin/shell/chunks/ls-ZXYOL67L.js +2 -0
- package/dist/bin/shell/chunks/md5sum-NCLXV2S3.js +2 -0
- package/dist/bin/shell/chunks/mkdir-6OKMS3KO.js +2 -0
- package/dist/bin/shell/chunks/mv-OY7X62QC.js +2 -0
- package/dist/bin/shell/chunks/nl-XH3L75DR.js +2 -0
- package/dist/bin/shell/chunks/od-52FBC34W.js +2 -0
- package/dist/bin/shell/chunks/paste-3UVLMQ2K.js +2 -0
- package/dist/bin/shell/chunks/printf-TZC5BRAY.js +2 -0
- package/dist/bin/shell/chunks/pwd-6VBAPL3Y.js +2 -0
- package/dist/bin/shell/chunks/readlink-YNOUXNUY.js +2 -0
- package/dist/bin/shell/chunks/rev-UHEPS2UL.js +2 -0
- package/dist/bin/shell/chunks/rg-3R5G2XL4.js +2 -0
- package/dist/bin/shell/chunks/rm-5QIBTLJG.js +2 -0
- package/dist/bin/shell/chunks/rmdir-5KLM4EA6.js +2 -0
- package/dist/bin/shell/chunks/sed-WNL6TIIN.js +2 -0
- package/dist/bin/shell/chunks/seq-V7KBLSQ7.js +2 -0
- package/dist/bin/shell/chunks/sha1sum-BHNJ5ALF.js +2 -0
- package/dist/bin/shell/chunks/sha256sum-HJJ3NJ5L.js +2 -0
- package/dist/bin/shell/chunks/sleep-PICQVS6Q.js +2 -0
- package/dist/bin/shell/chunks/sort-NZSEYCI6.js +2 -0
- package/dist/bin/shell/chunks/split-NOZ7FFXW.js +2 -0
- package/dist/bin/shell/chunks/sqlite3-4SEIR46P.js +2 -0
- package/dist/bin/shell/chunks/stat-XH7E4E2C.js +2 -0
- package/dist/bin/shell/chunks/strings-XXKZCWY5.js +2 -0
- package/dist/bin/shell/chunks/tac-TZBNTR4K.js +2 -0
- package/dist/bin/shell/chunks/tail-V537TDFR.js +2 -0
- package/dist/bin/shell/chunks/tar-7B5KH3QG.js +2 -0
- package/dist/bin/shell/chunks/tee-HK2SYCAR.js +2 -0
- package/dist/bin/shell/chunks/time-4C3A4THJ.js +2 -0
- package/dist/bin/shell/chunks/timeout-RS7REDYT.js +2 -0
- package/dist/bin/shell/chunks/touch-DWKSZGOQ.js +2 -0
- package/dist/bin/shell/chunks/tr-GDDRKGRB.js +2 -0
- package/dist/bin/shell/chunks/tree-HEKABARE.js +2 -0
- package/dist/bin/shell/chunks/true-DP5UZP52.js +2 -0
- package/dist/bin/shell/chunks/unexpand-OYZ7KOYR.js +2 -0
- package/dist/bin/shell/chunks/uniq-FZWFZEN5.js +2 -0
- package/dist/bin/shell/chunks/wc-ZIV3TFVG.js +2 -0
- package/dist/bin/shell/chunks/which-67WZ6OMV.js +2 -0
- package/dist/bin/shell/chunks/whoami-E7PN2UWC.js +2 -0
- package/dist/bin/shell/chunks/xan-FMSZPFX4.js +2 -0
- package/dist/bin/shell/chunks/xargs-YWPEV2QC.js +2 -0
- package/dist/bin/shell/chunks/yq-WUJ5JNDT.js +2 -0
- package/dist/bin/shell/shell.js +192 -190
- package/dist/bundle/browser.js +640 -638
- package/dist/bundle/chunks/alias-JE7RI5QX.js +1 -0
- package/dist/bundle/chunks/awk2-BDPR2JPZ.js +1 -0
- package/dist/bundle/chunks/base64-A3SGWC34.js +1 -0
- package/dist/bundle/chunks/basename-AA2KJYZQ.js +1 -0
- package/dist/bundle/chunks/bash-OVBCDR7G.js +1 -0
- package/dist/bundle/chunks/cat-C2OBLGHA.js +1 -0
- package/dist/bundle/chunks/chmod-MIKE3OIT.js +1 -0
- package/dist/bundle/chunks/chunk-27LMNKBP.js +7 -0
- package/dist/bundle/chunks/chunk-2OCD45J4.js +12 -0
- package/dist/bundle/chunks/chunk-3KWUDRIP.js +20 -0
- package/dist/bundle/chunks/chunk-4HHKTUW3.js +2 -0
- package/dist/bundle/chunks/chunk-4Q4SM6WR.js +4 -0
- package/dist/bundle/chunks/chunk-55VFSPNA.js +2 -0
- package/dist/bundle/chunks/chunk-5V6VZH6T.js +1 -0
- package/dist/bundle/chunks/chunk-64BAICW3.js +1 -0
- package/dist/bundle/chunks/chunk-6NY2AP72.js +5 -0
- package/dist/bundle/chunks/chunk-7C6RBHP3.js +4 -0
- package/dist/bundle/chunks/chunk-7DBA735O.js +5 -0
- package/dist/bundle/chunks/chunk-A4HU7SVR.js +2 -0
- package/dist/bundle/chunks/chunk-A4JSPFCI.js +6 -0
- package/dist/bundle/chunks/chunk-A7A2DBEE.js +6 -0
- package/dist/bundle/chunks/chunk-A7ICOL4V.js +13 -0
- package/dist/bundle/chunks/chunk-ALLTKNUZ.js +5 -0
- package/dist/bundle/chunks/chunk-APT7OOP2.js +1 -0
- package/dist/bundle/chunks/{file-APPTAFMI.js → chunk-CR5AFCPT.js} +1 -1
- package/dist/bundle/chunks/{time-EGF4KTWV.js → chunk-CSBFBYLD.js} +5 -5
- package/dist/bundle/chunks/chunk-D4J545R4.js +11 -0
- package/dist/bundle/chunks/chunk-DCAAORBQ.js +1 -0
- package/dist/bundle/chunks/chunk-DZ33S2U7.js +31 -0
- package/dist/bundle/chunks/{nl-KWQGFZH5.js → chunk-F23WWYKW.js} +7 -7
- package/dist/bundle/chunks/chunk-FRDGR5VK.js +5 -0
- package/dist/bundle/chunks/chunk-GCTKCWKD.js +3 -0
- package/dist/bundle/chunks/chunk-GXVXFKBA.js +5 -0
- package/dist/bundle/chunks/chunk-GZ2N3SXD.js +8 -0
- package/dist/bundle/chunks/{sqlite3-DK5YHTWU.js → chunk-HDZ4QEVJ.js} +9 -9
- package/dist/bundle/chunks/chunk-HJQJAYMS.js +2 -0
- package/dist/bundle/chunks/chunk-HXILPMCG.js +5 -0
- package/dist/bundle/chunks/chunk-IBFD7QQD.js +5 -0
- package/dist/bundle/chunks/chunk-IKZ5LEGB.js +6 -0
- package/dist/bundle/chunks/{xan-EN6JZQ3T.js → chunk-JI3KJ32H.js} +17 -17
- package/dist/bundle/chunks/chunk-JVPRLUMK.js +7 -0
- package/dist/bundle/chunks/chunk-K3PAWJ7V.js +7 -0
- package/dist/bundle/chunks/chunk-KAEMRWOH.js +15 -0
- package/dist/bundle/chunks/chunk-KTGH7NTP.js +15 -0
- package/dist/bundle/chunks/chunk-KY5VPZXG.js +23 -0
- package/dist/bundle/chunks/{printf-4U5V2VHK.js → chunk-L4KW73FJ.js} +11 -11
- package/dist/bundle/chunks/chunk-LL3S3NLB.js +1 -0
- package/dist/bundle/chunks/chunk-LWEGUNWT.js +7 -0
- package/dist/bundle/chunks/chunk-MDLLFABN.js +4 -0
- package/dist/bundle/chunks/chunk-NCNPKYJZ.js +2 -0
- package/dist/bundle/chunks/chunk-NQOQ2Q77.js +8 -0
- package/dist/bundle/chunks/chunk-NUYSJFDK.js +7 -0
- package/dist/bundle/chunks/chunk-OCK72LWW.js +4 -0
- package/dist/bundle/chunks/chunk-OCLXQMOG.js +6 -0
- package/dist/bundle/chunks/{rmdir-DU6C7ZEO.js → chunk-OCS6LSEM.js} +3 -3
- package/dist/bundle/chunks/chunk-OFJTSXN6.js +8 -0
- package/dist/bundle/chunks/chunk-OGDTSM2Q.js +8 -0
- package/dist/bundle/chunks/chunk-PP6PSHAB.js +4 -0
- package/dist/bundle/chunks/chunk-PYSFUGCK.js +10 -0
- package/dist/bundle/chunks/chunk-QCDB2VPH.js +6 -0
- package/dist/bundle/chunks/{rg-JNKRPEYR.js → chunk-QOENL5UZ.js} +9 -9
- package/dist/bundle/chunks/chunk-R6QSAL5T.js +1 -0
- package/dist/bundle/chunks/chunk-S6BBC45K.js +8 -0
- package/dist/bundle/chunks/chunk-SL4FN3A5.js +9 -0
- package/dist/bundle/chunks/chunk-SXR3EI72.js +4 -0
- package/dist/bundle/chunks/chunk-TLSUDHID.js +6 -0
- package/dist/bundle/chunks/chunk-U7QI5ZS5.js +4 -0
- package/dist/bundle/chunks/{chunk-RERCNF7Z.js → chunk-UJXASUXJ.js} +41 -41
- package/dist/bundle/chunks/chunk-UYGR3CFC.js +2 -0
- package/dist/bundle/chunks/chunk-VJFXDYWH.js +10 -0
- package/dist/bundle/chunks/chunk-VOBGTVA6.js +6 -0
- package/dist/bundle/chunks/chunk-VYOJP4TV.js +13 -0
- package/dist/bundle/chunks/{tar-5V4PGBFL.js → chunk-VZWXH2PZ.js} +6 -6
- package/dist/bundle/chunks/{sed-4K5HXNXE.js → chunk-WACZHM4L.js} +36 -36
- package/dist/bundle/chunks/chunk-WMLBQOWO.js +9 -0
- package/dist/bundle/chunks/{tr-UJSEBPIQ.js → chunk-X6JMGGW2.js} +5 -5
- package/dist/bundle/chunks/chunk-XKQRETAK.js +1 -0
- package/dist/bundle/chunks/{yq-JD6M7T5A.js → chunk-XMDVFEVC.js} +24 -24
- package/dist/bundle/chunks/chunk-XNL7YAHW.js +11 -0
- package/dist/bundle/chunks/chunk-XVDPCNWR.js +11 -0
- package/dist/bundle/chunks/chunk-XZ3MZS57.js +6 -0
- package/dist/bundle/chunks/chunk-YYB54I7F.js +10 -0
- package/dist/bundle/chunks/chunk-Z7JVV2SM.js +12 -0
- package/dist/bundle/chunks/chunk-ZKLK6C7H.js +15 -0
- package/dist/bundle/chunks/clear-5CZ5X4YR.js +1 -0
- package/dist/bundle/chunks/column-WLPMMSTS.js +1 -0
- package/dist/bundle/chunks/comm-5SLSESQG.js +1 -0
- package/dist/bundle/chunks/cp-XOYR4ABJ.js +1 -0
- package/dist/bundle/chunks/cut-LO6YYY5P.js +1 -0
- package/dist/bundle/chunks/date-FT2P5UCQ.js +1 -0
- package/dist/bundle/chunks/diff-HJF2MPDN.js +1 -0
- package/dist/bundle/chunks/dirname-LEMTZZFS.js +1 -0
- package/dist/bundle/chunks/du-DM4QX4XA.js +1 -0
- package/dist/bundle/chunks/echo-O45JWWI2.js +1 -0
- package/dist/bundle/chunks/env-S547XMN7.js +1 -0
- package/dist/bundle/chunks/expand-DTNXU4LQ.js +1 -0
- package/dist/bundle/chunks/{expansion-OFFC2R4K.js → expansion-L4NRX44B.js} +1 -1
- package/dist/bundle/chunks/expr-3572LAOT.js +1 -0
- package/dist/bundle/chunks/file-ZIGAJ4YS.js +1 -0
- package/dist/bundle/chunks/find-74OP3M7S.js +1 -0
- package/dist/bundle/chunks/flag-coverage-5KOYWCUN.js +1 -0
- package/dist/bundle/chunks/fold-LDSORVYE.js +1 -0
- package/dist/bundle/chunks/grep-BPEMMINR.js +1 -0
- package/dist/bundle/chunks/gzip-UTSGNF5Z.js +1 -0
- package/dist/bundle/chunks/head-HT2B6D2J.js +1 -0
- package/dist/bundle/chunks/help-T2NGLTSG.js +1 -0
- package/dist/bundle/chunks/history-J4QRNGRO.js +1 -0
- package/dist/bundle/chunks/hostname-BK6HG2DE.js +1 -0
- package/dist/bundle/chunks/html-to-markdown-TFCECAGV.js +1 -0
- package/dist/bundle/chunks/join-GG2LDHE5.js +1 -0
- package/dist/bundle/chunks/jq-OJYNICKX.js +1 -0
- package/dist/bundle/chunks/ln-YAIFIHCT.js +1 -0
- package/dist/bundle/chunks/ls-OTONBH2E.js +1 -0
- package/dist/bundle/chunks/md5sum-INMIK4DX.js +1 -0
- package/dist/bundle/chunks/mkdir-QWGXDWUS.js +1 -0
- package/dist/bundle/chunks/mv-Z6MORUFL.js +1 -0
- package/dist/bundle/chunks/nl-U5YJDM32.js +1 -0
- package/dist/bundle/chunks/od-VJEF2UR5.js +1 -0
- package/dist/bundle/chunks/paste-7N6AFSDS.js +1 -0
- package/dist/bundle/chunks/printf-KGN6BDCY.js +1 -0
- package/dist/bundle/chunks/pwd-D4OZ7N27.js +1 -0
- package/dist/bundle/chunks/readlink-IEQO24KU.js +1 -0
- package/dist/bundle/chunks/rev-XOSYPP45.js +1 -0
- package/dist/bundle/chunks/rg-ORQK4GVH.js +1 -0
- package/dist/bundle/chunks/rm-KPTLPKPH.js +1 -0
- package/dist/bundle/chunks/rmdir-XTQXT7RK.js +1 -0
- package/dist/bundle/chunks/sed-RXIECPPB.js +1 -0
- package/dist/bundle/chunks/seq-RN5ZUASB.js +1 -0
- package/dist/bundle/chunks/sha1sum-VJPNLNU6.js +1 -0
- package/dist/bundle/chunks/sha256sum-PI32XWXY.js +1 -0
- package/dist/bundle/chunks/sleep-JHK4I472.js +1 -0
- package/dist/bundle/chunks/sort-T7TNLWXL.js +1 -0
- package/dist/bundle/chunks/split-EZOC5IIZ.js +1 -0
- package/dist/bundle/chunks/sqlite3-Z2IGWYCE.js +1 -0
- package/dist/bundle/chunks/stat-74KBZFAX.js +1 -0
- package/dist/bundle/chunks/strings-7PLOGTPD.js +1 -0
- package/dist/bundle/chunks/tac-T7YAU2Y6.js +1 -0
- package/dist/bundle/chunks/tail-S5ULNTJU.js +1 -0
- package/dist/bundle/chunks/tar-K7K7BL55.js +1 -0
- package/dist/bundle/chunks/tee-O7VXZDCO.js +1 -0
- package/dist/bundle/chunks/time-BPT76IHZ.js +1 -0
- package/dist/bundle/chunks/timeout-5UJUQXOE.js +1 -0
- package/dist/bundle/chunks/touch-DX2IJOQ4.js +1 -0
- package/dist/bundle/chunks/tr-RYO2EDCA.js +1 -0
- package/dist/bundle/chunks/tree-LYXBS7DC.js +1 -0
- package/dist/bundle/chunks/true-WHJNXCHG.js +1 -0
- package/dist/bundle/chunks/unexpand-RGTMIGZM.js +1 -0
- package/dist/bundle/chunks/uniq-ZXE4O5XB.js +1 -0
- package/dist/bundle/chunks/wc-TQB3VNOX.js +1 -0
- package/dist/bundle/chunks/which-NCIYTMAT.js +1 -0
- package/dist/bundle/chunks/whoami-DGKU3D2X.js +1 -0
- package/dist/bundle/chunks/xan-Z6KVJKEE.js +1 -0
- package/dist/bundle/chunks/xargs-OGI2NN6J.js +1 -0
- package/dist/bundle/chunks/yq-FD5F3WOJ.js +1 -0
- package/dist/bundle/index.js +157 -155
- package/dist/commands/alias/alias.d.ts +3 -0
- package/dist/commands/awk/awk2.d.ts +2 -0
- package/dist/commands/awk/interpreter/context.d.ts +5 -0
- package/dist/commands/base64/base64.d.ts +2 -0
- package/dist/commands/basename/basename.d.ts +2 -0
- package/dist/commands/bash/bash.d.ts +3 -0
- package/dist/commands/cat/cat.d.ts +2 -0
- package/dist/commands/chmod/chmod.d.ts +2 -0
- package/dist/commands/clear/clear.d.ts +2 -0
- package/dist/commands/column/column.d.ts +2 -0
- package/dist/commands/comm/comm.d.ts +2 -0
- package/dist/commands/cp/cp.d.ts +2 -0
- package/dist/commands/cut/cut.d.ts +2 -0
- package/dist/commands/date/date.d.ts +2 -0
- package/dist/commands/diff/diff.d.ts +2 -0
- package/dist/commands/dirname/dirname.d.ts +2 -0
- package/dist/commands/du/du.d.ts +2 -0
- package/dist/commands/echo/echo.d.ts +2 -0
- package/dist/commands/env/env.d.ts +3 -0
- package/dist/commands/expand/expand.d.ts +2 -0
- package/dist/commands/expand/unexpand.d.ts +2 -0
- package/dist/commands/expr/expr.d.ts +2 -0
- package/dist/commands/file/file.d.ts +2 -0
- package/dist/commands/find/find.d.ts +2 -0
- package/dist/commands/flag-coverage.d.ts +2 -0
- package/dist/commands/fold/fold.d.ts +2 -0
- package/dist/commands/fuzz-flags-types.d.ts +17 -0
- package/dist/commands/fuzz-flags.d.ts +8 -0
- package/dist/commands/grep/grep.d.ts +4 -0
- package/dist/commands/gzip/gzip.d.ts +4 -0
- package/dist/commands/head/head.d.ts +2 -0
- package/dist/commands/help/help.d.ts +2 -0
- package/dist/commands/history/history.d.ts +2 -0
- package/dist/commands/hostname/hostname.d.ts +2 -0
- package/dist/commands/html-to-markdown/html-to-markdown.d.ts +2 -0
- package/dist/commands/join/join.d.ts +2 -0
- package/dist/commands/jq/jq.d.ts +2 -0
- package/dist/commands/ln/ln.d.ts +2 -0
- package/dist/commands/ls/ls.d.ts +2 -0
- package/dist/commands/md5sum/md5sum.d.ts +2 -0
- package/dist/commands/md5sum/sha1sum.d.ts +2 -0
- package/dist/commands/md5sum/sha256sum.d.ts +2 -0
- package/dist/commands/mkdir/mkdir.d.ts +2 -0
- package/dist/commands/mv/mv.d.ts +2 -0
- package/dist/commands/nl/nl.d.ts +2 -0
- package/dist/commands/od/od.d.ts +2 -0
- package/dist/commands/paste/paste.d.ts +2 -0
- package/dist/commands/printf/printf.d.ts +2 -0
- package/dist/commands/pwd/pwd.d.ts +2 -0
- package/dist/commands/query-engine/evaluator.d.ts +4 -0
- package/dist/commands/readlink/readlink.d.ts +2 -0
- package/dist/commands/rev/rev.d.ts +2 -0
- package/dist/commands/rg/rg.d.ts +2 -0
- package/dist/commands/rm/rm.d.ts +2 -0
- package/dist/commands/rmdir/rmdir.d.ts +2 -0
- package/dist/commands/sed/sed.d.ts +2 -0
- package/dist/commands/sed/types.d.ts +2 -0
- package/dist/commands/seq/seq.d.ts +2 -0
- package/dist/commands/sleep/sleep.d.ts +2 -0
- package/dist/commands/sort/sort.d.ts +2 -0
- package/dist/commands/split/split.d.ts +2 -0
- package/dist/commands/sqlite3/sqlite3.d.ts +2 -0
- package/dist/commands/stat/stat.d.ts +2 -0
- package/dist/commands/strings/strings.d.ts +2 -0
- package/dist/commands/tac/tac.d.ts +2 -0
- package/dist/commands/tail/tail.d.ts +2 -0
- package/dist/commands/tar/tar.d.ts +2 -0
- package/dist/commands/tee/tee.d.ts +2 -0
- package/dist/commands/time/time.d.ts +2 -0
- package/dist/commands/timeout/timeout.d.ts +2 -0
- package/dist/commands/touch/touch.d.ts +2 -0
- package/dist/commands/tr/tr.d.ts +2 -0
- package/dist/commands/tree/tree.d.ts +2 -0
- package/dist/commands/true/true.d.ts +3 -0
- package/dist/commands/uniq/uniq.d.ts +2 -0
- package/dist/commands/wc/wc.d.ts +2 -0
- package/dist/commands/which/which.d.ts +2 -0
- package/dist/commands/whoami/whoami.d.ts +2 -0
- package/dist/commands/xan/xan.d.ts +2 -0
- package/dist/commands/xargs/xargs.d.ts +2 -0
- package/dist/commands/yq/yq.d.ts +2 -0
- package/dist/fs/overlay-fs/overlay-fs.d.ts +7 -0
- package/dist/fs/read-write-fs/read-write-fs.d.ts +7 -0
- package/dist/interpreter/interpreter.d.ts +3 -1
- package/dist/interpreter/types.d.ts +3 -1
- package/dist/network/types.d.ts +11 -0
- package/dist/types.d.ts +12 -0
- package/package.json +1 -1
- package/dist/bin/chunks/alias-MGDOL4KG.js +0 -7
- package/dist/bin/chunks/awk2-OKD2P6CM.js +0 -21
- package/dist/bin/chunks/base64-43KPK6TL.js +0 -6
- package/dist/bin/chunks/basename-SO5MVUEX.js +0 -6
- package/dist/bin/chunks/bash-OAUBNRSG.js +0 -6
- package/dist/bin/chunks/cat-HNXE2ES2.js +0 -6
- package/dist/bin/chunks/chmod-TYLTHXFR.js +0 -9
- package/dist/bin/chunks/chunk-HSNUCOOQ.js +0 -6
- package/dist/bin/chunks/clear-CI7A5IXQ.js +0 -2
- package/dist/bin/chunks/column-HQ4AK5DM.js +0 -8
- package/dist/bin/chunks/comm-CPIFQTKY.js +0 -13
- package/dist/bin/chunks/cp-VFXCUKXO.js +0 -8
- package/dist/bin/chunks/cut-IHF6BEOO.js +0 -6
- package/dist/bin/chunks/date-IQLPMFYI.js +0 -5
- package/dist/bin/chunks/diff-ZGXLP3DN.js +0 -19
- package/dist/bin/chunks/dirname-EES7TR26.js +0 -5
- package/dist/bin/chunks/du-PECPOFQT.js +0 -8
- package/dist/bin/chunks/echo-7I42V66Q.js +0 -4
- package/dist/bin/chunks/env-W6IMQ43Y.js +0 -9
- package/dist/bin/chunks/expand-77K5HH2M.js +0 -11
- package/dist/bin/chunks/expr-433HIVAI.js +0 -5
- package/dist/bin/chunks/find-KHOYETRP.js +0 -11
- package/dist/bin/chunks/fold-452R4I2C.js +0 -12
- package/dist/bin/chunks/grep-BD56656Z.js +0 -9
- package/dist/bin/chunks/gzip-5ILPB46W.js +0 -32
- package/dist/bin/chunks/head-TJHLLIMR.js +0 -2
- package/dist/bin/chunks/help-L43ENI4H.js +0 -16
- package/dist/bin/chunks/history-56DL6SXU.js +0 -3
- package/dist/bin/chunks/hostname-WXDKRL2Z.js +0 -3
- package/dist/bin/chunks/join-3IXMEGNA.js +0 -14
- package/dist/bin/chunks/jq-EIPK4SZA.js +0 -13
- package/dist/bin/chunks/ln-EFFNQ3RY.js +0 -10
- package/dist/bin/chunks/ls-5LN47VHU.js +0 -26
- package/dist/bin/chunks/md5sum-VHPDBIVV.js +0 -2
- package/dist/bin/chunks/mkdir-XMSNS6S5.js +0 -7
- package/dist/bin/chunks/mv-P4KHB27X.js +0 -7
- package/dist/bin/chunks/od-KRKGC2U3.js +0 -5
- package/dist/bin/chunks/paste-UCH462KK.js +0 -8
- package/dist/bin/chunks/printf-4W7NDLLV.js +0 -15
- package/dist/bin/chunks/pwd-L26WH2K4.js +0 -3
- package/dist/bin/chunks/readlink-VL3R4LAM.js +0 -7
- package/dist/bin/chunks/rev-VP42N2JN.js +0 -7
- package/dist/bin/chunks/rm-S7ASVG34.js +0 -8
- package/dist/bin/chunks/seq-AVK43XM2.js +0 -7
- package/dist/bin/chunks/sha1sum-4SVNPPXZ.js +0 -2
- package/dist/bin/chunks/sha256sum-BM3AFTIE.js +0 -2
- package/dist/bin/chunks/sort-QF3YLXRW.js +0 -16
- package/dist/bin/chunks/split-7UP7EATZ.js +0 -16
- package/dist/bin/chunks/stat-ZZVPXHLF.js +0 -9
- package/dist/bin/chunks/strings-ZEKN6D4Q.js +0 -14
- package/dist/bin/chunks/tac-KNRFDAY7.js +0 -9
- package/dist/bin/chunks/tail-YAUIERGN.js +0 -2
- package/dist/bin/chunks/tee-XSKPK43X.js +0 -3
- package/dist/bin/chunks/timeout-JED4EKFH.js +0 -12
- package/dist/bin/chunks/touch-IBPHJBM3.js +0 -7
- package/dist/bin/chunks/tree-WC3AXFHC.js +0 -12
- package/dist/bin/chunks/true-OVATH2SQ.js +0 -2
- package/dist/bin/chunks/unexpand-BFVYAPOU.js +0 -11
- package/dist/bin/chunks/uniq-NNXAFO6D.js +0 -5
- package/dist/bin/chunks/wc-CZ2TD6T6.js +0 -6
- package/dist/bin/chunks/which-5QEJAXNR.js +0 -3
- package/dist/bin/chunks/whoami-JVLUNKSG.js +0 -3
- package/dist/bin/chunks/xargs-IWT2HHEA.js +0 -5
- package/dist/bin/shell/chunks/alias-MGDOL4KG.js +0 -7
- package/dist/bin/shell/chunks/awk2-OKD2P6CM.js +0 -21
- package/dist/bin/shell/chunks/base64-43KPK6TL.js +0 -6
- package/dist/bin/shell/chunks/basename-SO5MVUEX.js +0 -6
- package/dist/bin/shell/chunks/bash-OAUBNRSG.js +0 -6
- package/dist/bin/shell/chunks/cat-HNXE2ES2.js +0 -6
- package/dist/bin/shell/chunks/chmod-TYLTHXFR.js +0 -9
- package/dist/bin/shell/chunks/chunk-HSNUCOOQ.js +0 -6
- package/dist/bin/shell/chunks/clear-CI7A5IXQ.js +0 -2
- package/dist/bin/shell/chunks/column-HQ4AK5DM.js +0 -8
- package/dist/bin/shell/chunks/comm-CPIFQTKY.js +0 -13
- package/dist/bin/shell/chunks/cp-VFXCUKXO.js +0 -8
- package/dist/bin/shell/chunks/cut-IHF6BEOO.js +0 -6
- package/dist/bin/shell/chunks/date-IQLPMFYI.js +0 -5
- package/dist/bin/shell/chunks/diff-ZGXLP3DN.js +0 -19
- package/dist/bin/shell/chunks/dirname-EES7TR26.js +0 -5
- package/dist/bin/shell/chunks/du-PECPOFQT.js +0 -8
- package/dist/bin/shell/chunks/echo-7I42V66Q.js +0 -4
- package/dist/bin/shell/chunks/env-W6IMQ43Y.js +0 -9
- package/dist/bin/shell/chunks/expand-77K5HH2M.js +0 -11
- package/dist/bin/shell/chunks/expr-433HIVAI.js +0 -5
- package/dist/bin/shell/chunks/find-KHOYETRP.js +0 -11
- package/dist/bin/shell/chunks/fold-452R4I2C.js +0 -12
- package/dist/bin/shell/chunks/grep-BD56656Z.js +0 -9
- package/dist/bin/shell/chunks/gzip-5ILPB46W.js +0 -32
- package/dist/bin/shell/chunks/head-TJHLLIMR.js +0 -2
- package/dist/bin/shell/chunks/help-L43ENI4H.js +0 -16
- package/dist/bin/shell/chunks/history-56DL6SXU.js +0 -3
- package/dist/bin/shell/chunks/hostname-WXDKRL2Z.js +0 -3
- package/dist/bin/shell/chunks/join-3IXMEGNA.js +0 -14
- package/dist/bin/shell/chunks/jq-EIPK4SZA.js +0 -13
- package/dist/bin/shell/chunks/ln-EFFNQ3RY.js +0 -10
- package/dist/bin/shell/chunks/ls-5LN47VHU.js +0 -26
- package/dist/bin/shell/chunks/md5sum-VHPDBIVV.js +0 -2
- package/dist/bin/shell/chunks/mkdir-XMSNS6S5.js +0 -7
- package/dist/bin/shell/chunks/mv-P4KHB27X.js +0 -7
- package/dist/bin/shell/chunks/od-KRKGC2U3.js +0 -5
- package/dist/bin/shell/chunks/paste-UCH462KK.js +0 -8
- package/dist/bin/shell/chunks/printf-4W7NDLLV.js +0 -15
- package/dist/bin/shell/chunks/pwd-L26WH2K4.js +0 -3
- package/dist/bin/shell/chunks/readlink-VL3R4LAM.js +0 -7
- package/dist/bin/shell/chunks/rev-VP42N2JN.js +0 -7
- package/dist/bin/shell/chunks/rm-S7ASVG34.js +0 -8
- package/dist/bin/shell/chunks/seq-AVK43XM2.js +0 -7
- package/dist/bin/shell/chunks/sha1sum-4SVNPPXZ.js +0 -2
- package/dist/bin/shell/chunks/sha256sum-BM3AFTIE.js +0 -2
- package/dist/bin/shell/chunks/sort-QF3YLXRW.js +0 -16
- package/dist/bin/shell/chunks/split-7UP7EATZ.js +0 -16
- package/dist/bin/shell/chunks/stat-ZZVPXHLF.js +0 -9
- package/dist/bin/shell/chunks/strings-ZEKN6D4Q.js +0 -14
- package/dist/bin/shell/chunks/tac-KNRFDAY7.js +0 -9
- package/dist/bin/shell/chunks/tail-YAUIERGN.js +0 -2
- package/dist/bin/shell/chunks/tee-XSKPK43X.js +0 -3
- package/dist/bin/shell/chunks/timeout-JED4EKFH.js +0 -12
- package/dist/bin/shell/chunks/touch-IBPHJBM3.js +0 -7
- package/dist/bin/shell/chunks/tree-WC3AXFHC.js +0 -12
- package/dist/bin/shell/chunks/true-OVATH2SQ.js +0 -2
- package/dist/bin/shell/chunks/unexpand-BFVYAPOU.js +0 -11
- package/dist/bin/shell/chunks/uniq-NNXAFO6D.js +0 -5
- package/dist/bin/shell/chunks/wc-CZ2TD6T6.js +0 -6
- package/dist/bin/shell/chunks/which-5QEJAXNR.js +0 -3
- package/dist/bin/shell/chunks/whoami-JVLUNKSG.js +0 -3
- package/dist/bin/shell/chunks/xargs-IWT2HHEA.js +0 -5
- package/dist/bundle/chunks/alias-YGOORMWI.js +0 -6
- package/dist/bundle/chunks/awk2-YNEKUV4T.js +0 -20
- package/dist/bundle/chunks/base64-2JFR3HGT.js +0 -5
- package/dist/bundle/chunks/basename-CFA5ZIGT.js +0 -5
- package/dist/bundle/chunks/bash-BYWM5OPC.js +0 -5
- package/dist/bundle/chunks/cat-GPKR7D6K.js +0 -5
- package/dist/bundle/chunks/chmod-ODWUR7E6.js +0 -8
- package/dist/bundle/chunks/chunk-WQCJYUEW.js +0 -5
- package/dist/bundle/chunks/clear-VT2LJIDX.js +0 -1
- package/dist/bundle/chunks/column-R6OLMEUA.js +0 -7
- package/dist/bundle/chunks/comm-AXQM7FFF.js +0 -12
- package/dist/bundle/chunks/cp-NJSENVKC.js +0 -7
- package/dist/bundle/chunks/cut-NVKWEAZF.js +0 -5
- package/dist/bundle/chunks/date-PN3CMG7K.js +0 -4
- package/dist/bundle/chunks/diff-ELUS3RW7.js +0 -6
- package/dist/bundle/chunks/dirname-YPJLCQYA.js +0 -4
- package/dist/bundle/chunks/du-T4JUAAB2.js +0 -7
- package/dist/bundle/chunks/echo-6S7WE7XB.js +0 -3
- package/dist/bundle/chunks/env-M3AXY56V.js +0 -8
- package/dist/bundle/chunks/expand-VSTNOVF5.js +0 -10
- package/dist/bundle/chunks/expr-YSFDPKPV.js +0 -4
- package/dist/bundle/chunks/find-WTVSUXL3.js +0 -10
- package/dist/bundle/chunks/fold-6CFXIPYZ.js +0 -11
- package/dist/bundle/chunks/grep-UTH3KDWL.js +0 -8
- package/dist/bundle/chunks/gzip-4P4KGYT5.js +0 -31
- package/dist/bundle/chunks/head-SA7P5NJ7.js +0 -1
- package/dist/bundle/chunks/help-UD3E73G5.js +0 -15
- package/dist/bundle/chunks/history-TMBGOQO6.js +0 -2
- package/dist/bundle/chunks/hostname-NWR32CGF.js +0 -2
- package/dist/bundle/chunks/html-to-markdown-ZK6GQVSL.js +0 -4
- package/dist/bundle/chunks/join-X3QYPZUA.js +0 -13
- package/dist/bundle/chunks/jq-6U2TPE6U.js +0 -12
- package/dist/bundle/chunks/ln-Y7YB677N.js +0 -9
- package/dist/bundle/chunks/ls-PUJHEPXS.js +0 -23
- package/dist/bundle/chunks/md5sum-TGZPGVOK.js +0 -1
- package/dist/bundle/chunks/mkdir-SF2UE4KB.js +0 -6
- package/dist/bundle/chunks/mv-JPBZPM4O.js +0 -6
- package/dist/bundle/chunks/od-3FPDPLWJ.js +0 -4
- package/dist/bundle/chunks/paste-QAP6Y75J.js +0 -7
- package/dist/bundle/chunks/pwd-S4NVAMC4.js +0 -2
- package/dist/bundle/chunks/readlink-EM4O3U4P.js +0 -6
- package/dist/bundle/chunks/rev-FKUV5GH5.js +0 -6
- package/dist/bundle/chunks/rm-MJFRIDNT.js +0 -7
- package/dist/bundle/chunks/seq-5VRIVQYP.js +0 -6
- package/dist/bundle/chunks/sha1sum-37LOTSQP.js +0 -1
- package/dist/bundle/chunks/sha256sum-I4J5BPZA.js +0 -1
- package/dist/bundle/chunks/sleep-AK4QE4WR.js +0 -9
- package/dist/bundle/chunks/sort-LT2PE47K.js +0 -15
- package/dist/bundle/chunks/split-LGSGJHV5.js +0 -15
- package/dist/bundle/chunks/stat-IOLJTP7U.js +0 -8
- package/dist/bundle/chunks/strings-LRU5XCFP.js +0 -13
- package/dist/bundle/chunks/tac-2X4JLF4W.js +0 -8
- package/dist/bundle/chunks/tail-52LRAWXT.js +0 -1
- package/dist/bundle/chunks/tee-4KHTWVWB.js +0 -2
- package/dist/bundle/chunks/timeout-X3X3N6IE.js +0 -11
- package/dist/bundle/chunks/touch-TDTEBHHI.js +0 -6
- package/dist/bundle/chunks/tree-UFVZH4SS.js +0 -11
- package/dist/bundle/chunks/true-CNJ54NE6.js +0 -1
- package/dist/bundle/chunks/unexpand-I7A2VXFD.js +0 -10
- package/dist/bundle/chunks/uniq-XBP4SJA3.js +0 -4
- package/dist/bundle/chunks/wc-VDPK3LVS.js +0 -5
- package/dist/bundle/chunks/which-GF77XMJD.js +0 -2
- package/dist/bundle/chunks/whoami-YUDAIS32.js +0 -2
- package/dist/bundle/chunks/xargs-4FRA6OJ7.js +0 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d}from"./chunk-VOBGTVA6.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";export{a as aliasCommand,c as flagsForFuzzing,b as unaliasCommand,d as unaliasFlagsForFuzzing};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk-3KWUDRIP.js";import"./chunk-OJDRYQWQ.js";import"./chunk-YNYSPYQ5.js";import"./chunk-PSW6BMXW.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";export{a as awkCommand2,b as flagsForFuzzing};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk-IBFD7QQD.js";import"./chunk-HWKDQ44K.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";export{a as base64Command,b as flagsForFuzzing};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk-ALLTKNUZ.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";export{a as basenameCommand,b as flagsForFuzzing};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d}from"./chunk-HXILPMCG.js";import"./chunk-OJDRYQWQ.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";export{a as bashCommand,c as flagsForFuzzing,b as shCommand,d as shFlagsForFuzzing};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk-7DBA735O.js";import"./chunk-7L36YK2X.js";import"./chunk-NUFRM6SI.js";import"./chunk-HWKDQ44K.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";export{a as catCommand,b as flagsForFuzzing};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk-GZ2N3SXD.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";export{a as chmodCommand,b as flagsForFuzzing};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{a as u}from"./chunk-HWKDQ44K.js";import{a as m}from"./chunk-44UOCSGV.js";var d={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"}},b={name:"rm",async execute(p,s){let e=u("rm",p,d);if(!e.ok)return e.error;let c=e.result.flags.recursive||e.result.flags.recursiveUpper,a=e.result.flags.force,g=e.result.flags.verbose,i=e.result.positional;if(i.length===0)return a?{stdout:"",stderr:"",exitCode:0}:{stdout:"",stderr:`rm: missing operand
|
|
2
|
+
`,exitCode:1};let f="",t="",l=0;for(let r of i)try{let n=s.fs.resolvePath(s.cwd,r);if((await s.fs.stat(n)).isDirectory&&!c){t+=`rm: cannot remove '${r}': Is a directory
|
|
3
|
+
`,l=1;continue}await s.fs.rm(n,{recursive:c,force:a}),g&&(f+=`removed '${r}'
|
|
4
|
+
`)}catch(n){if(!a){let o=m(n);o.includes("ENOENT")||o.includes("no such file")?t+=`rm: cannot remove '${r}': No such file or directory
|
|
5
|
+
`:o.includes("ENOTEMPTY")||o.includes("not empty")?t+=`rm: cannot remove '${r}': Directory not empty
|
|
6
|
+
`:t+=`rm: cannot remove '${r}': ${o}
|
|
7
|
+
`,l=1}}return{stdout:f,stderr:t,exitCode:l}}},h={name:"rm",flags:[{flag:"-r",type:"boolean"},{flag:"-R",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0};export{b as a,h as b};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{a as O,b as J}from"./chunk-FRDGR5VK.js";import{a as N}from"./chunk-7L36YK2X.js";import{k as x}from"./chunk-PSW6BMXW.js";import{a as C,b as E,c as q}from"./chunk-74CEPOFO.js";function I(s){let r=[],t=0,i=s.length;for(;t<i;){for(;t<i&&/\s/.test(s[t]);)t++;if(t>=i)break;let u=t,n=s[t];if(n==="{"||n==="["){let o=n,l=n==="{"?"}":"]",c=1,p=!1,d=!1;for(t++;t<i&&c>0;){let h=s[t];d?d=!1:h==="\\"?d=!0:h==='"'?p=!p:p||(h===o?c++:h===l&&c--),t++}if(c!==0)throw new Error(`Unexpected end of JSON input at position ${t} (unclosed ${o})`);r.push(JSON.parse(s.slice(u,t)))}else if(n==='"'){let o=!1;for(t++;t<i;){let l=s[t];if(o)o=!1;else if(l==="\\")o=!0;else if(l==='"'){t++;break}t++}r.push(JSON.parse(s.slice(u,t)))}else if(n==="-"||n>="0"&&n<="9"){for(;t<i&&/[\d.eE+-]/.test(s[t]);)t++;r.push(JSON.parse(s.slice(u,t)))}else if(s.slice(t,t+4)==="true")r.push(!0),t+=4;else if(s.slice(t,t+5)==="false")r.push(!1),t+=5;else if(s.slice(t,t+4)==="null")r.push(null),t+=4;else{let o=s.slice(t,t+10);throw new Error(`Invalid JSON at position ${u}: unexpected '${o.split(/\s/)[0]}'`)}}return r}var A={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 j(s,r,t,i,u,n=0){if(s===null||s===void 0)return"null";if(typeof s=="boolean")return String(s);if(typeof s=="number")return Number.isFinite(s)?String(s):"null";if(typeof s=="string")return t?s:JSON.stringify(s);let o=u?" ":" ";if(Array.isArray(s))return s.length===0?"[]":r?`[${s.map(c=>j(c,!0,!1,i,u)).join(",")}]`:`[
|
|
2
|
+
${s.map(c=>o.repeat(n+1)+j(c,!1,!1,i,u,n+1)).join(`,
|
|
3
|
+
`)}
|
|
4
|
+
${o.repeat(n)}]`;if(typeof s=="object"){let l=Object.keys(s);return i&&(l=l.sort()),l.length===0?"{}":r?`{${l.map(p=>`${JSON.stringify(p)}:${j(s[p],!0,!1,i,u)}`).join(",")}}`:`{
|
|
5
|
+
${l.map(p=>{let d=j(s[p],!1,!1,i,u,n+1);return`${o.repeat(n+1)}${JSON.stringify(p)}: ${d}`}).join(`,
|
|
6
|
+
`)}
|
|
7
|
+
${o.repeat(n)}}`}return String(s)}var P={name:"jq",async execute(s,r){if(E(s))return C(A);let t=!1,i=!1,u=!1,n=!1,o=!1,l=!1,c=!1,p=!1,d=".",h=!1,g=[];for(let a=0;a<s.length;a++){let e=s[a];if(e==="-r"||e==="--raw-output")t=!0;else if(e==="-c"||e==="--compact-output")i=!0;else if(e==="-e"||e==="--exit-status")u=!0;else if(e==="-s"||e==="--slurp")n=!0;else if(e==="-n"||e==="--null-input")o=!0;else if(e==="-j"||e==="--join-output")l=!0;else if(!(e==="-a"||e==="--ascii")){if(e==="-S"||e==="--sort-keys")c=!0;else if(!(e==="-C"||e==="--color")){if(!(e==="-M"||e==="--monochrome"))if(e==="--tab")p=!0;else if(e==="-")g.push("-");else{if(e.startsWith("--"))return q("jq",e);if(e.startsWith("-")){for(let f of e.slice(1))if(f==="r")t=!0;else if(f==="c")i=!0;else if(f==="e")u=!0;else if(f==="s")n=!0;else if(f==="n")o=!0;else if(f==="j")l=!0;else if(f!=="a"){if(f==="S")c=!0;else if(f!=="C"){if(f!=="M")return q("jq",`-${f}`)}}}else h?g.push(e):(d=e,h=!0)}}}}let y=[];if(!o)if(g.length===0||g.length===1&&g[0]==="-")y.push({source:"stdin",content:r.stdin});else{let a=await N(r,g,{cmdName:"jq",stopOnError:!0});if(a.exitCode!==0)return{stdout:"",stderr:a.stderr,exitCode:2};y=a.files.map(e=>({source:e.filename||"stdin",content:e.content}))}try{let a=J(d),e=[],f={limits:r.limits?{maxIterations:r.limits.maxJqIterations}:void 0,env:r.env,coverage:r.coverage};if(o)e=O(null,a,f);else if(n){let m=[];for(let{content:w}of y){let b=w.trim();b&&m.push(...I(b))}e=O(m,a,f)}else for(let{content:m}of y){let w=m.trim();if(!w)continue;let b=I(w);for(let z of b)e.push(...O(z,a,f))}let k=e.map(m=>j(m,i,t,c,p)),F=l?"":`
|
|
8
|
+
`,S=k.join(F),$=r.limits?.maxStringLength;if($!==void 0&&$>0&&S.length>$)throw new x(`jq: output size limit exceeded (${$} bytes)`,"string_length");let L=u&&(e.length===0||e.every(m=>m==null||m===!1))?1:0;return{stdout:S?l?S:`${S}
|
|
9
|
+
`:"",stderr:"",exitCode:L}}catch(a){if(a instanceof x)return{stdout:"",stderr:`jq: ${a.message}
|
|
10
|
+
`,exitCode:x.EXIT_CODE};let e=a.message;return e.includes("Unknown function")?{stdout:"",stderr:`jq: error: ${e}
|
|
11
|
+
`,exitCode:3}:{stdout:"",stderr:`jq: parse error: ${e}
|
|
12
|
+
`,exitCode:5}}}},U={name:"jq",flags:[{flag:"-r",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-e",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-j",type:"boolean"},{flag:"-S",type:"boolean"},{flag:"--tab",type:"boolean"}],stdinType:"json",needsArgs:!0};export{P as a,U as b};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import{a as oe}from"./chunk-OJDRYQWQ.js";import{a as A,b as P}from"./chunk-YNYSPYQ5.js";import{k as O}from"./chunk-PSW6BMXW.js";import{a as se,b as ae,c as z}from"./chunk-74CEPOFO.js";var Le=1e4,Me=100,Pe=new P(/\s+/);function Q(e={}){let{fieldSep:t=Pe,maxIterations:n=Le,maxRecursionDepth:i=Me,maxOutputSize:a=0,fs:s,cwd:o,exec:c,coverage:u}=e;return{FS:" ",OFS:" ",ORS:`
|
|
2
|
+
`,OFMT:"%.6g",NR:0,NF:0,FNR:0,FILENAME:"",RSTART:0,RLENGTH:-1,SUBSEP:"",fields:[],line:"",vars:Object.create(null),arrays:Object.create(null),arrayAliases:new Map,ARGC:0,ARGV:Object.create(null),ENVIRON:Object.create(null),functions:new Map,fieldSep:t,maxIterations:n,maxRecursionDepth:i,maxOutputSize:a,currentRecursionDepth:0,exitCode:0,shouldExit:!1,shouldNext:!1,shouldNextFile:!1,loopBreak:!1,loopContinue:!1,hasReturn:!1,inEndBlock:!1,output:"",openedFiles:new Set,fs:s,cwd:o,exec:c,coverage:u}}function le(e,t,n){switch(n){case"+":return e+t;case"-":return e-t;case"*":return e*t;case"/":return t!==0?e/t:0;case"%":return t!==0?e%t:0;case"^":case"**":return e**t;default:return 0}}function C(e){if(typeof e=="number")return e;let t=parseFloat(e);return Number.isNaN(t)?0:t}function I(e){return typeof e=="string"?e:(Number.isInteger(e),String(e))}async function U(e,t){if(e.type==="regex")return e.pattern;let n=I(await t.evalExpr(e));return n.startsWith("/")&&n.endsWith("/")&&(n=n.slice(1,-1)),n}async function ue(e,t){return e?e.type==="variable"?e.name:e.type==="field"?`$${Math.floor(C(await t.evalExpr(e.index)))}`:"$0":"$0"}function he(e,t){if(e==="$0")return t.line;if(e.startsWith("$")){let n=parseInt(e.slice(1),10)-1;return t.fields[n]||""}return I(t.vars[e]??"")}function pe(e,t,n){if(e==="$0")n.line=t,n.fields=n.FS===" "?t.trim().split(/\s+/).filter(Boolean):n.fieldSep.split(t),n.NF=n.fields.length;else if(e.startsWith("$")){let i=parseInt(e.slice(1),10)-1;for(;n.fields.length<=i;)n.fields.push("");n.fields[i]=t,n.NF=n.fields.length,n.line=n.fields.join(n.OFS)}else n.vars[e]=t}async function Te(e,t,n){return e.length===0?t.line.length:I(await n.evalExpr(e[0])).length}async function Fe(e,t,n){if(e.length<2)return"";let i=I(await n.evalExpr(e[0])),a=Math.floor(C(await n.evalExpr(e[1])))-1;if(e.length>=3){let s=Math.floor(C(await n.evalExpr(e[2])));return i.substr(Math.max(0,a),s)}return i.substr(Math.max(0,a))}async function _e(e,t,n){if(e.length<2)return 0;let i=I(await n.evalExpr(e[0])),a=I(await n.evalExpr(e[1])),s=i.indexOf(a);return s===-1?0:s+1}async function Ge(e,t,n){if(e.length<2)return 0;let i=I(await n.evalExpr(e[0])),a=e[1];if(a.type!=="variable")return 0;let s=a.name,o=t.FS;if(e.length>=3){let u=e[2];if(u.type==="regex")o=A(u.pattern);else{let N=I(await n.evalExpr(u));o=N===" "?A("\\s+"):N}}else t.FS===" "&&(o=A("\\s+"));let c=typeof o=="string"?i.split(o):o.split(i);t.arrays[s]=Object.create(null);for(let u=0;u<c.length;u++)t.arrays[s][String(u+1)]=c[u];return c.length}async function De(e,t,n){if(e.length<2)return 0;let i=await U(e[0],n),a=I(await n.evalExpr(e[1])),s=await ue(e[2],n),o=he(s,t);try{let u=A(i).replace(o,fe(a)),N=u!==o?1:0;return pe(s,u,t),N}catch{return 0}}async function xe(e,t,n){if(e.length<2)return 0;let i=await U(e[0],n),a=I(await n.evalExpr(e[1])),s=await ue(e[2],n),o=he(s,t);try{let c=A(i,"g"),u=c.match(o),N=u?u.length:0,k=c.replace(o,fe(a));return pe(s,k,t),N}catch{return 0}}function fe(e){return t=>{let n="",i=0;for(;i<e.length;)if(e[i]==="\\"&&i+1<e.length){let a=e[i+1];a==="&"?(n+="&",i+=2):a==="\\"?(n+="\\",i+=2):(n+=e[i+1],i+=2)}else e[i]==="&"?(n+=t,i++):(n+=e[i],i++);return n}}async function Ue(e,t,n){if(e.length<2)return t.RSTART=0,t.RLENGTH=-1,0;let i=I(await n.evalExpr(e[0])),a=await U(e[1],n);try{let o=A(a).exec(i);if(o)return t.RSTART=o.index+1,t.RLENGTH=o[0].length,t.RSTART}catch{}return t.RSTART=0,t.RLENGTH=-1,0}async function Be(e,t,n){if(e.length<3)return"";let i=await U(e[0],n),a=I(await n.evalExpr(e[1])),s=I(await n.evalExpr(e[2])),o=e.length>=4?I(await n.evalExpr(e[3])):t.line;try{let c=s.toLowerCase()==="g",u=c?0:parseInt(s,10)||1;if(c)return A(i,"g").replace(o,(k,...y)=>ce(a,k,y.slice(0,-2)));{let N=0;return A(i,"g").replace(o,(y,...w)=>(N++,N===u?ce(a,y,w.slice(0,-2)):y))}}catch{return o}}function ce(e,t,n){let i="",a=0;for(;a<e.length;)if(e[a]==="\\"&&a+1<e.length){let s=e[a+1];if(s==="&")i+="&",a+=2;else if(s==="0")i+=t,a+=2;else if(s>="1"&&s<="9"){let o=parseInt(s,10)-1;i+=n[o]||"",a+=2}else s==="n"?(i+=`
|
|
3
|
+
`,a+=2):s==="t"?(i+=" ",a+=2):(i+=s,a+=2)}else e[a]==="&"?(i+=t,a++):(i+=e[a],a++);return i}async function He(e,t,n){return e.length===0?"":I(await n.evalExpr(e[0])).toLowerCase()}async function $e(e,t,n){return e.length===0?"":I(await n.evalExpr(e[0])).toUpperCase()}async function We(e,t,n){if(e.length===0)return"";let i=I(await n.evalExpr(e[0])),a=[];for(let s=1;s<e.length;s++)a.push(await n.evalExpr(e[s]));return B(i,a)}async function Ve(e,t,n){return e.length===0?0:Math.floor(C(await n.evalExpr(e[0])))}async function Ke(e,t,n){return e.length===0?0:Math.sqrt(C(await n.evalExpr(e[0])))}async function Xe(e,t,n){return e.length===0?0:Math.sin(C(await n.evalExpr(e[0])))}async function je(e,t,n){return e.length===0?0:Math.cos(C(await n.evalExpr(e[0])))}async function ze(e,t,n){let i=e.length>0?C(await n.evalExpr(e[0])):0,a=e.length>1?C(await n.evalExpr(e[1])):0;return Math.atan2(i,a)}async function Qe(e,t,n){return e.length===0?0:Math.log(C(await n.evalExpr(e[0])))}async function qe(e,t,n){return e.length===0?1:Math.exp(C(await n.evalExpr(e[0])))}function Je(e,t,n){return t.random?t.random():Math.random()}async function Ze(e,t,n){let i=e.length>0?C(await n.evalExpr(e[0])):Date.now();return t.vars._srand_seed=i,i}function Ye(e,t){return()=>{throw new Error(`${e}() is not supported - ${t}`)}}function q(e){return()=>{throw new Error(`function '${e}()' is not implemented`)}}var L=1e4;function B(e,t){let n=0,i="",a=0;for(;a<e.length;)if(e[a]==="%"&&a+1<e.length){let s=a+1,o="",c="",u="",N,k=s;for(;s<e.length&&/\d/.test(e[s]);)s++;s>k&&e[s]==="$"?(N=parseInt(e.substring(k,s),10)-1,s++):s=k;let y=()=>{if(s<e.length){if(s+1<e.length&&(e[s]==="h"&&e[s+1]==="h"||e[s]==="l"&&e[s+1]==="l")){s+=2;return}/[lzjh]/.test(e[s])&&s++}};for(;s<e.length&&/[-+ #0]/.test(e[s]);)o+=e[s++];if(e[s]==="*"){let l=t[n++],p=l!==void 0?Math.floor(Number(l)):0;p<0?(o+="-",c=String(Math.min(-p,L))):c=String(Math.min(p,L)),s++}else for(;s<e.length&&/\d/.test(e[s]);)c+=e[s++];if(c&&parseInt(c,10)>L&&(c=String(L)),e[s]==="."){if(s++,e[s]==="*"){let l=t[n++];u=String(Math.min(l!==void 0?Math.floor(Number(l)):0,L)),s++}else for(;s<e.length&&/\d/.test(e[s]);)u+=e[s++];u&&parseInt(u,10)>L&&(u=String(L))}y();let w=e[s],g=t[N!==void 0?N:n];switch(w){case"s":{let l=g!==void 0?String(g):"";if(u&&(l=l.substring(0,parseInt(u,10))),c){let p=parseInt(c,10);o.includes("-")?l=l.padEnd(p):l=l.padStart(p)}i+=l,N===void 0&&n++;break}case"d":case"i":{let l=g!==void 0?Math.floor(Number(g)):0;Number.isNaN(l)&&(l=0);let p=l<0,E=Math.abs(l).toString();if(u){let b=parseInt(u,10);E=E.padStart(b,"0")}let d="";p?d="-":o.includes("+")?d="+":o.includes(" ")&&(d=" ");let R=d+E;if(c){let b=parseInt(c,10);o.includes("-")?R=R.padEnd(b):o.includes("0")&&!u?R=d+E.padStart(b-d.length,"0"):R=R.padStart(b)}i+=R,N===void 0&&n++;break}case"f":{let l=g!==void 0?Number(g):0;Number.isNaN(l)&&(l=0);let p=u?parseInt(u,10):6,E=l.toFixed(p);if(c){let d=parseInt(c,10);o.includes("-")?E=E.padEnd(d):E=E.padStart(d)}i+=E,N===void 0&&n++;break}case"e":case"E":{let l=g!==void 0?Number(g):0;Number.isNaN(l)&&(l=0);let p=u?parseInt(u,10):6,E=l.toExponential(p);if(w==="E"&&(E=E.toUpperCase()),c){let d=parseInt(c,10);o.includes("-")?E=E.padEnd(d):E=E.padStart(d)}i+=E,N===void 0&&n++;break}case"g":case"G":{let l=g!==void 0?Number(g):0;Number.isNaN(l)&&(l=0);let p=u?parseInt(u,10):6,E=l!==0?Math.floor(Math.log10(Math.abs(l))):0,d;if(l===0?d="0":E<-4||E>=p?(d=l.toExponential(p-1),w==="G"&&(d=d.toUpperCase())):d=l.toPrecision(p),d.includes(".")&&(d=d.replace(/\.?0+$/,"").replace(/\.?0+e/,"e")),d.includes("e")&&(d=d.replace(/\.?0+e/,"e")),c){let R=parseInt(c,10);o.includes("-")?d=d.padEnd(R):d=d.padStart(R)}i+=d,N===void 0&&n++;break}case"x":case"X":{let l=g!==void 0?Math.floor(Number(g)):0;Number.isNaN(l)&&(l=0);let p=Math.abs(l).toString(16);if(w==="X"&&(p=p.toUpperCase()),u){let R=parseInt(u,10);p=p.padStart(R,"0")}let E=l<0?"-":"",d=E+p;if(c){let R=parseInt(c,10);o.includes("-")?d=d.padEnd(R):o.includes("0")&&!u?d=E+p.padStart(R-E.length,"0"):d=d.padStart(R)}i+=d,N===void 0&&n++;break}case"o":{let l=g!==void 0?Math.floor(Number(g)):0;Number.isNaN(l)&&(l=0);let p=Math.abs(l).toString(8);if(u){let R=parseInt(u,10);p=p.padStart(R,"0")}let E=l<0?"-":"",d=E+p;if(c){let R=parseInt(c,10);o.includes("-")?d=d.padEnd(R):o.includes("0")&&!u?d=E+p.padStart(R-E.length,"0"):d=d.padStart(R)}i+=d,N===void 0&&n++;break}case"c":{typeof g=="number"?i+=String.fromCharCode(g):i+=String(g??"").charAt(0)||"",N===void 0&&n++;break}case"%":i+="%";break;default:i+=e.substring(a,s+1)}a=s+1}else if(e[a]==="\\"&&a+1<e.length){let s=e[a+1];switch(s){case"n":i+=`
|
|
4
|
+
`;break;case"t":i+=" ";break;case"r":i+="\r";break;case"\\":i+="\\";break;default:i+=s}a+=2}else i+=e[a++];return i}var de=new Map([["length",Te],["substr",Fe],["index",_e],["split",Ge],["sub",De],["gsub",xe],["match",Ue],["gensub",Be],["tolower",He],["toupper",$e],["sprintf",We],["int",Ve],["sqrt",Ke],["sin",Xe],["cos",je],["atan2",ze],["log",Qe],["exp",qe],["rand",Je],["srand",Ze],["system",Ye("system","shell execution not allowed in sandboxed environment")],["close",()=>0],["fflush",()=>0],["systime",q("systime")],["mktime",q("mktime")],["strftime",q("strftime")]]);function v(e){return typeof e=="number"?e!==0:!(e===""||e==="0")}function m(e){if(typeof e=="number")return e;let t=parseFloat(e);return Number.isNaN(t)?0:t}function S(e){return typeof e=="string"?e:(Number.isInteger(e),String(e))}function J(e){if(typeof e=="number")return!0;let t=String(e).trim();return t===""?!1:!Number.isNaN(Number(t))}function G(e,t){try{return A(e).test(t)}catch{return!1}}function Ee(e,t){return t===""?[]:e.FS===" "?t.trim().split(/\s+/).filter(Boolean):e.fieldSep.split(t)}function H(e,t){return t===0?e.line:t<0||t>e.fields.length?"":e.fields[t-1]??""}function Z(e,t,n){if(t===0)e.line=S(n),e.fields=Ee(e,e.line),e.NF=e.fields.length;else if(t>0){for(;e.fields.length<t;)e.fields.push("");e.fields[t-1]=S(n),e.NF=e.fields.length,e.line=e.fields.join(e.OFS)}}function T(e,t){e.line=t,e.fields=Ee(e,t),e.NF=e.fields.length}function Ne(e,t){if(e.FS=t,t===" ")e.fieldSep=new P(/\s+/);else try{e.fieldSep=A(t)}catch{e.fieldSep=A(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))}}function $(e,t){switch(t){case"FS":return e.FS;case"OFS":return e.OFS;case"ORS":return e.ORS;case"OFMT":return e.OFMT;case"NR":return e.NR;case"NF":return e.NF;case"FNR":return e.FNR;case"FILENAME":return e.FILENAME;case"RSTART":return e.RSTART;case"RLENGTH":return e.RLENGTH;case"SUBSEP":return e.SUBSEP;case"ARGC":return e.ARGC}return e.vars[t]??""}function F(e,t,n){switch(t){case"FS":Ne(e,S(n));return;case"OFS":e.OFS=S(n);return;case"ORS":e.ORS=S(n);return;case"OFMT":e.OFMT=S(n);return;case"NR":e.NR=Math.floor(m(n));return;case"NF":{let i=Math.floor(m(n));if(i<e.NF)e.fields=e.fields.slice(0,i),e.line=e.fields.join(e.OFS);else if(i>e.NF){for(;e.fields.length<i;)e.fields.push("");e.line=e.fields.join(e.OFS)}e.NF=i;return}case"FNR":e.FNR=Math.floor(m(n));return;case"FILENAME":e.FILENAME=S(n);return;case"RSTART":e.RSTART=Math.floor(m(n));return;case"RLENGTH":e.RLENGTH=Math.floor(m(n));return;case"SUBSEP":e.SUBSEP=S(n);return}e.vars[t]=n}function D(e,t){let n=t,i=new Set,a=e.arrayAliases.get(n);for(;a!==void 0&&!i.has(n);)i.add(n),n=a,a=e.arrayAliases.get(n);return n}function W(e,t,n){if(t==="ARGV")return e.ARGV[n]??"";if(t==="ENVIRON")return e.ENVIRON[n]??"";let i=D(e,t);return e.arrays[i]?.[n]??""}function Y(e,t,n,i){let a=D(e,t);e.arrays[a]||(e.arrays[a]=Object.create(null)),e.arrays[a][n]=i}function Se(e,t,n){if(t==="ARGV")return e.ARGV[n]!==void 0;if(t==="ENVIRON")return e.ENVIRON[n]!==void 0;let i=D(e,t);return e.arrays[i]?.[n]!==void 0}function ye(e,t,n){let i=D(e,t);e.arrays[i]&&delete e.arrays[i][n]}function Re(e,t){let n=D(e,t);delete e.arrays[n]}var ee=null;function me(e){ee=e}async function f(e,t){switch(e.coverage?.hit(`awk:expr:${t.type}`),t.type){case"number":return t.value;case"string":return t.value;case"regex":return G(t.pattern,e.line)?1:0;case"field":return et(e,t);case"variable":return $(e,t.name);case"array_access":return tt(e,t);case"binary":return nt(e,t);case"unary":return st(e,t);case"ternary":return v(await f(e,t.condition))?await f(e,t.consequent):await f(e,t.alternate);case"call":return at(e,t.name,t.args);case"assignment":return lt(e,t);case"pre_increment":return ct(e,t.operand);case"pre_decrement":return ut(e,t.operand);case"post_increment":return ht(e,t.operand);case"post_decrement":return pt(e,t.operand);case"in":return ft(e,t.key,t.array);case"getline":return dt(e,t.variable,t.file,t.command);case"tuple":return St(e,t.elements);default:return""}}async function et(e,t){let n=Math.floor(m(await f(e,t.index)));return H(e,n)}async function tt(e,t){let n=S(await f(e,t.key));return W(e,t.array,n)}async function nt(e,t){let n=t.operator;if(n==="||")return v(await f(e,t.left))||v(await f(e,t.right))?1:0;if(n==="&&")return v(await f(e,t.left))&&v(await f(e,t.right))?1:0;if(n==="~"){let c=await f(e,t.left);t.right.type==="regex"&&e.coverage?.hit("awk:expr:regex");let u=t.right.type==="regex"?t.right.pattern:S(await f(e,t.right));try{return A(u).test(S(c))?1:0}catch{return 0}}if(n==="!~"){let c=await f(e,t.left);t.right.type==="regex"&&e.coverage?.hit("awk:expr:regex");let u=t.right.type==="regex"?t.right.pattern:S(await f(e,t.right));try{return A(u).test(S(c))?0:1}catch{return 1}}let i=await f(e,t.left),a=await f(e,t.right);if(n===" "){let c=S(i)+S(a);if(e.maxOutputSize>0&&c.length>e.maxOutputSize)throw new O(`awk: string concatenation size limit exceeded (${e.maxOutputSize} bytes)`,"string_length",e.output);return c}if(rt(n))return it(i,a,n);let s=m(i),o=m(a);return le(s,o,n)}function rt(e){return["<","<=",">",">=","==","!="].includes(e)}function it(e,t,n){let i=J(e),a=J(t);if(i&&a){let c=m(e),u=m(t);switch(n){case"<":return c<u?1:0;case"<=":return c<=u?1:0;case">":return c>u?1:0;case">=":return c>=u?1:0;case"==":return c===u?1:0;case"!=":return c!==u?1:0}}let s=S(e),o=S(t);switch(n){case"<":return s<o?1:0;case"<=":return s<=o?1:0;case">":return s>o?1:0;case">=":return s>=o?1:0;case"==":return s===o?1:0;case"!=":return s!==o?1:0}return 0}async function st(e,t){let n=await f(e,t.operand);switch(t.operator){case"!":return v(n)?0:1;case"-":return-m(n);case"+":return+m(n);default:return n}}async function at(e,t,n){let i=de.get(t);if(i)return i(n,e,{evalExpr:s=>f(e,s)});let a=e.functions.get(t);return a?ot(e,a,n):""}async function ot(e,t,n){if(e.currentRecursionDepth++,e.currentRecursionDepth>e.maxRecursionDepth)throw e.currentRecursionDepth--,new O(`awk: recursion depth exceeded maximum (${e.maxRecursionDepth})`,"recursion",e.output);let i=Object.create(null);for(let o of t.params)i[o]=e.vars[o];let a=[];for(let o=0;o<t.params.length;o++){let c=t.params[o];if(o<n.length){let u=n[o];u.type==="variable"&&(e.arrayAliases.set(c,u.name),a.push(c));let N=await f(e,u);e.vars[c]=N}else e.vars[c]=""}e.hasReturn=!1,e.returnValue=void 0,ee&&await ee(e,t.body.statements);let s=e.returnValue??"";for(let o of t.params)i[o]!==void 0?e.vars[o]=i[o]:delete e.vars[o];for(let o of a)e.arrayAliases.delete(o);return e.hasReturn=!1,e.returnValue=void 0,e.currentRecursionDepth--,s}async function lt(e,t){let n=await f(e,t.value),i=t.target,a=t.operator,s;if(a==="=")s=n;else{let o;if(i.type==="field"){let N=Math.floor(m(await f(e,i.index)));o=H(e,N)}else if(i.type==="variable")o=$(e,i.name);else{let N=S(await f(e,i.key));o=W(e,i.array,N)}let c=m(o),u=m(n);switch(a){case"+=":s=c+u;break;case"-=":s=c-u;break;case"*=":s=c*u;break;case"/=":s=u!==0?c/u:0;break;case"%=":s=u!==0?c%u:0;break;case"^=":s=c**u;break;default:s=n}}if(i.type==="field"){let o=Math.floor(m(await f(e,i.index)));Z(e,o,s)}else if(i.type==="variable")F(e,i.name,s);else{let o=S(await f(e,i.key));Y(e,i.array,o,s)}return s}async function V(e,t,n,i){let a;if(t.type==="field"){let s=Math.floor(m(await f(e,t.index)));a=m(H(e,s)),Z(e,s,a+n)}else if(t.type==="variable")a=m($(e,t.name)),F(e,t.name,a+n);else{let s=S(await f(e,t.key));a=m(W(e,t.array,s)),Y(e,t.array,s,a+n)}return i?a+n:a}async function ct(e,t){return V(e,t,1,!0)}async function ut(e,t){return V(e,t,-1,!0)}async function ht(e,t){return V(e,t,1,!1)}async function pt(e,t){return V(e,t,-1,!1)}async function ft(e,t,n){let i;if(t.type==="tuple"){e.coverage?.hit("awk:expr:tuple");let a=[];for(let s of t.elements)a.push(S(await f(e,s)));i=a.join(e.SUBSEP)}else i=S(await f(e,t));return Se(e,n,i)?1:0}async function dt(e,t,n,i){if(i)return Et(e,t,i);if(n)return Nt(e,t,n);if(!e.lines||e.lineIndex===void 0)return-1;let a=e.lineIndex+1;if(a>=e.lines.length)return 0;let s=e.lines[a];return t?F(e,t,s):T(e,s),e.NR++,e.lineIndex=a,1}async function Et(e,t,n){if(!e.exec)return-1;let i=S(await f(e,n)),a=`__cmd_${i}`,s=`__cmdi_${i}`,o,c;if(e.vars[a]===void 0)try{o=(await e.exec(i)).stdout.split(`
|
|
5
|
+
`),o.length>0&&o[o.length-1]===""&&o.pop(),e.vars[a]=JSON.stringify(o),e.vars[s]=-1,c=-1}catch{return-1}else o=JSON.parse(e.vars[a]),c=e.vars[s];let u=c+1;if(u>=o.length)return 0;let N=o[u];return e.vars[s]=u,t?F(e,t,N):T(e,N),1}async function Nt(e,t,n){if(!e.fs||!e.cwd)return-1;let i=S(await f(e,n));if(i==="/dev/null")return 0;let a=e.fs.resolvePath(e.cwd,i),s=`__fc_${a}`,o=`__fi_${a}`,c,u;if(e.vars[s]===void 0)try{c=(await e.fs.readFile(a)).split(`
|
|
6
|
+
`),c.length>0&&c[c.length-1]===""&&c.pop(),e.vars[s]=JSON.stringify(c),e.vars[o]=-1,u=-1}catch{return-1}else c=JSON.parse(e.vars[s]),u=e.vars[o];let N=u+1;if(N>=c.length)return 0;let k=c[N];return e.vars[o]=N,t?F(e,t,k):T(e,k),1}async function St(e,t){if(t.length===0)return"";for(let n=0;n<t.length-1;n++)await f(e,t[n]);return f(e,t[t.length-1])}me(_);function te(e){if(e.maxOutputSize>0&&e.output.length>e.maxOutputSize)throw new O(`awk: output size limit exceeded (${e.maxOutputSize} bytes)`,"string_length",e.output)}async function _(e,t){for(let n of t)if(await M(e,n),yt(e))break}function yt(e){return e.shouldExit||e.shouldNext||e.shouldNextFile||e.loopBreak||e.loopContinue||e.hasReturn}async function M(e,t){switch(e.coverage?.hit(`awk:stmt:${t.type}`),t.type){case"block":await _(e,t.statements);break;case"expr_stmt":await f(e,t.expression);break;case"print":await Rt(e,t.args,t.output);break;case"printf":await mt(e,t.format,t.args,t.output);break;case"if":await At(e,t);break;case"while":await wt(e,t);break;case"do_while":await gt(e,t);break;case"for":await It(e,t);break;case"for_in":await vt(e,t);break;case"break":e.loopBreak=!0;break;case"continue":e.loopContinue=!0;break;case"next":e.shouldNext=!0;break;case"nextfile":e.shouldNextFile=!0;break;case"exit":e.shouldExit=!0,e.exitCode=t.code?Math.floor(m(await f(e,t.code))):0;break;case"return":e.hasReturn=!0,e.returnValue=t.value?await f(e,t.value):"";break;case"delete":await kt(e,t.target);break}}async function Rt(e,t,n){let i=[];for(let s of t){let o=await f(e,s);typeof o=="number"?Number.isInteger(o)&&Math.abs(o)<Number.MAX_SAFE_INTEGER?i.push(String(o)):i.push(B(e.OFMT,[o])):i.push(S(o))}let a=i.join(e.OFS)+e.ORS;n?await Ae(e,n.redirect,n.file,a):(e.output+=a,te(e))}async function mt(e,t,n,i){let a=S(await f(e,t)),s=[];for(let c of n)s.push(await f(e,c));let o=B(a,s);i?await Ae(e,i.redirect,i.file,o):(e.output+=o,te(e))}async function Ae(e,t,n,i){if(!e.fs||!e.cwd){e.output+=i,te(e);return}let a=S(await f(e,n)),s=e.fs.resolvePath(e.cwd,a);t===">"?e.openedFiles.has(s)?await e.fs.appendFile(s,i):(await e.fs.writeFile(s,i),e.openedFiles.add(s)):(e.openedFiles.has(s)||e.openedFiles.add(s),await e.fs.appendFile(s,i))}async function At(e,t){v(await f(e,t.condition))?await M(e,t.consequent):t.alternate&&await M(e,t.alternate)}async function wt(e,t){let n=0;for(;v(await f(e,t.condition));){if(n++,n>e.maxIterations)throw new O(`awk: while loop exceeded maximum iterations (${e.maxIterations})`,"iterations",e.output);if(e.loopContinue=!1,await M(e,t.body),e.loopBreak){e.loopBreak=!1;break}if(e.shouldExit||e.shouldNext||e.hasReturn)break}}async function gt(e,t){let n=0;do{if(n++,n>e.maxIterations)throw new O(`awk: do-while loop exceeded maximum iterations (${e.maxIterations})`,"iterations",e.output);if(e.loopContinue=!1,await M(e,t.body),e.loopBreak){e.loopBreak=!1;break}if(e.shouldExit||e.shouldNext||e.hasReturn)break}while(v(await f(e,t.condition)))}async function It(e,t){t.init&&await f(e,t.init);let n=0;for(;!t.condition||v(await f(e,t.condition));){if(n++,n>e.maxIterations)throw new O(`awk: for loop exceeded maximum iterations (${e.maxIterations})`,"iterations",e.output);if(e.loopContinue=!1,await M(e,t.body),e.loopBreak){e.loopBreak=!1;break}if(e.shouldExit||e.shouldNext||e.hasReturn)break;t.update&&await f(e,t.update)}}async function vt(e,t){let n=e.arrays[t.array];if(n)for(let i of Object.keys(n)){if(e.vars[t.variable]=i,e.loopContinue=!1,await M(e,t.body),e.loopBreak){e.loopBreak=!1;break}if(e.shouldExit||e.shouldNext||e.hasReturn)break}}async function kt(e,t){if(t.type==="array_access"){let n=S(await f(e,t.key));ye(e,t.array,n)}else t.type==="variable"&&Re(e,t.name)}var x=class{ctx;program=null;rangeStates=[];constructor(t){this.ctx=t}execute(t){this.program=t,this.ctx.output="";for(let n of t.functions)this.ctx.functions.set(n.name,n);this.rangeStates=t.rules.map(()=>!1)}async executeBegin(){if(this.program){for(let t of this.program.rules)if(t.pattern?.type==="begin"&&(await _(this.ctx,t.action.statements),this.ctx.shouldExit))break}}async executeLine(t){if(!(!this.program||this.ctx.shouldExit)){T(this.ctx,t),this.ctx.NR++,this.ctx.FNR++,this.ctx.shouldNext=!1;for(let n=0;n<this.program.rules.length&&!(this.ctx.shouldExit||this.ctx.shouldNext||this.ctx.shouldNextFile);n++){let i=this.program.rules[n];i.pattern?.type==="begin"||i.pattern?.type==="end"||await this.matchesRule(i,n)&&await _(this.ctx,i.action.statements)}}}async executeEnd(){if(this.program&&!this.ctx.inEndBlock){this.ctx.inEndBlock=!0,this.ctx.shouldExit=!1;for(let t of this.program.rules)if(t.pattern?.type==="end"&&(await _(this.ctx,t.action.statements),this.ctx.shouldExit))break;this.ctx.inEndBlock=!1}}getOutput(){return this.ctx.output}getExitCode(){return this.ctx.exitCode}getContext(){return this.ctx}async matchesRule(t,n){let i=t.pattern;if(!i)return!0;switch(i.type){case"begin":case"end":return!1;case"regex_pattern":return G(i.pattern,this.ctx.line);case"expr_pattern":return v(await f(this.ctx,i.expression));case"range":{let a=await this.matchPattern(i.start),s=await this.matchPattern(i.end);return this.rangeStates[n]?(s&&(this.rangeStates[n]=!1),!0):a?(this.rangeStates[n]=!0,s&&(this.rangeStates[n]=!1),!0):!1}default:return!1}}async matchPattern(t){switch(t.type){case"regex_pattern":return G(t.pattern,this.ctx.line);case"expr_pattern":return v(await f(this.ctx,t.expression));default:return!1}}};var r;(function(e){e.NUMBER="NUMBER",e.STRING="STRING",e.REGEX="REGEX",e.IDENT="IDENT",e.BEGIN="BEGIN",e.END="END",e.IF="IF",e.ELSE="ELSE",e.WHILE="WHILE",e.DO="DO",e.FOR="FOR",e.IN="IN",e.BREAK="BREAK",e.CONTINUE="CONTINUE",e.NEXT="NEXT",e.NEXTFILE="NEXTFILE",e.EXIT="EXIT",e.RETURN="RETURN",e.DELETE="DELETE",e.FUNCTION="FUNCTION",e.PRINT="PRINT",e.PRINTF="PRINTF",e.GETLINE="GETLINE",e.PLUS="PLUS",e.MINUS="MINUS",e.STAR="STAR",e.SLASH="SLASH",e.PERCENT="PERCENT",e.CARET="CARET",e.EQ="EQ",e.NE="NE",e.LT="LT",e.GT="GT",e.LE="LE",e.GE="GE",e.MATCH="MATCH",e.NOT_MATCH="NOT_MATCH",e.AND="AND",e.OR="OR",e.NOT="NOT",e.ASSIGN="ASSIGN",e.PLUS_ASSIGN="PLUS_ASSIGN",e.MINUS_ASSIGN="MINUS_ASSIGN",e.STAR_ASSIGN="STAR_ASSIGN",e.SLASH_ASSIGN="SLASH_ASSIGN",e.PERCENT_ASSIGN="PERCENT_ASSIGN",e.CARET_ASSIGN="CARET_ASSIGN",e.INCREMENT="INCREMENT",e.DECREMENT="DECREMENT",e.QUESTION="QUESTION",e.COLON="COLON",e.COMMA="COMMA",e.SEMICOLON="SEMICOLON",e.NEWLINE="NEWLINE",e.LPAREN="LPAREN",e.RPAREN="RPAREN",e.LBRACE="LBRACE",e.RBRACE="RBRACE",e.LBRACKET="LBRACKET",e.RBRACKET="RBRACKET",e.DOLLAR="DOLLAR",e.APPEND="APPEND",e.PIPE="PIPE",e.EOF="EOF"})(r||(r={}));var Ct=new Map([["BEGIN",r.BEGIN],["END",r.END],["if",r.IF],["else",r.ELSE],["while",r.WHILE],["do",r.DO],["for",r.FOR],["in",r.IN],["break",r.BREAK],["continue",r.CONTINUE],["next",r.NEXT],["nextfile",r.NEXTFILE],["exit",r.EXIT],["return",r.RETURN],["delete",r.DELETE],["function",r.FUNCTION],["print",r.PRINT],["printf",r.PRINTF],["getline",r.GETLINE]]);function Ot(e){return e.replace(/\[\[:space:\]\]/g,"[ \\t\\n\\r\\f\\v]").replace(/\[\[:blank:\]\]/g,"[ \\t]").replace(/\[\[:alpha:\]\]/g,"[a-zA-Z]").replace(/\[\[:digit:\]\]/g,"[0-9]").replace(/\[\[:alnum:\]\]/g,"[a-zA-Z0-9]").replace(/\[\[:upper:\]\]/g,"[A-Z]").replace(/\[\[:lower:\]\]/g,"[a-z]").replace(/\[\[:punct:\]\]/g,"[!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~]").replace(/\[\[:xdigit:\]\]/g,"[0-9A-Fa-f]").replace(/\[\[:graph:\]\]/g,"[!-~]").replace(/\[\[:print:\]\]/g,"[ -~]").replace(/\[\[:cntrl:\]\]/g,"[\\x00-\\x1f\\x7f]")}var K=class{input;pos=0;line=1;column=1;lastTokenType=null;constructor(t){this.input=t}tokenize(){let t=[];for(;this.pos<this.input.length;){let n=this.nextToken();n&&(t.push(n),this.lastTokenType=n.type)}return t.push(this.makeToken(r.EOF,"")),t}makeToken(t,n){return{type:t,value:n,line:this.line,column:this.column}}peek(t=0){return this.input[this.pos+t]||""}advance(){let t=this.input[this.pos++]||"";return t===`
|
|
7
|
+
`?(this.line++,this.column=1):this.column++,t}skipWhitespace(){for(;this.pos<this.input.length;){let t=this.peek();if(t===" "||t===" "||t==="\r")this.advance();else if(t==="\\")if(this.peek(1)===`
|
|
8
|
+
`)this.advance(),this.advance();else break;else if(t==="#")for(;this.pos<this.input.length&&this.peek()!==`
|
|
9
|
+
`;)this.advance();else break}}nextToken(){if(this.skipWhitespace(),this.pos>=this.input.length)return null;let t=this.line,n=this.column,i=this.peek();return i===`
|
|
10
|
+
`?(this.advance(),{type:r.NEWLINE,value:`
|
|
11
|
+
`,line:t,column:n}):i==='"'?this.readString():i==="/"&&this.canBeRegex()?this.readRegex():this.isDigit(i)||i==="."&&this.isDigit(this.peek(1))?this.readNumber():this.isAlpha(i)||i==="_"?this.readIdentifier():this.readOperator()}canBeRegex(){return new Set([null,r.NEWLINE,r.SEMICOLON,r.LBRACE,r.RBRACE,r.LPAREN,r.LBRACKET,r.COMMA,r.ASSIGN,r.PLUS_ASSIGN,r.MINUS_ASSIGN,r.STAR_ASSIGN,r.SLASH_ASSIGN,r.PERCENT_ASSIGN,r.CARET_ASSIGN,r.AND,r.OR,r.NOT,r.MATCH,r.NOT_MATCH,r.QUESTION,r.COLON,r.LT,r.GT,r.LE,r.GE,r.EQ,r.NE,r.PLUS,r.MINUS,r.STAR,r.PERCENT,r.CARET,r.PRINT,r.PRINTF,r.IF,r.WHILE,r.DO,r.FOR,r.RETURN]).has(this.lastTokenType)}readString(){let t=this.line,n=this.column;this.advance();let i="";for(;this.pos<this.input.length&&this.peek()!=='"';)if(this.peek()==="\\"){this.advance();let a=this.advance();switch(a){case"n":i+=`
|
|
12
|
+
`;break;case"t":i+=" ";break;case"r":i+="\r";break;case"f":i+="\f";break;case"b":i+="\b";break;case"v":i+="\v";break;case"a":i+="\x07";break;case"\\":i+="\\";break;case'"':i+='"';break;case"/":i+="/";break;case"x":{let s="";for(;s.length<2&&/[0-9a-fA-F]/.test(this.peek());)s+=this.advance();s.length>0?i+=String.fromCharCode(parseInt(s,16)):i+="x";break}default:if(/[0-7]/.test(a)){let s=a;for(;s.length<3&&/[0-7]/.test(this.peek());)s+=this.advance();i+=String.fromCharCode(parseInt(s,8))}else i+=a}}else i+=this.advance();return this.peek()==='"'&&this.advance(),{type:r.STRING,value:i,line:t,column:n}}readRegex(){let t=this.line,n=this.column;this.advance();let i="";for(;this.pos<this.input.length&&this.peek()!=="/";)if(this.peek()==="\\")i+=this.advance(),this.pos<this.input.length&&(i+=this.advance());else{if(this.peek()===`
|
|
13
|
+
`)break;i+=this.advance()}return this.peek()==="/"&&this.advance(),i=Ot(i),{type:r.REGEX,value:i,line:t,column:n}}readNumber(){let t=this.line,n=this.column,i="";for(;this.isDigit(this.peek());)i+=this.advance();if(this.peek()==="."&&this.isDigit(this.peek(1)))for(i+=this.advance();this.isDigit(this.peek());)i+=this.advance();if(this.peek()==="e"||this.peek()==="E")for(i+=this.advance(),(this.peek()==="+"||this.peek()==="-")&&(i+=this.advance());this.isDigit(this.peek());)i+=this.advance();return{type:r.NUMBER,value:parseFloat(i),line:t,column:n}}readIdentifier(){let t=this.line,n=this.column,i="";for(;this.isAlphaNumeric(this.peek())||this.peek()==="_";)i+=this.advance();let a=Ct.get(i);return a!==void 0?{type:a,value:i,line:t,column:n}:{type:r.IDENT,value:i,line:t,column:n}}readOperator(){let t=this.line,n=this.column,i=this.advance(),a=this.peek();switch(i){case"+":return a==="+"?(this.advance(),{type:r.INCREMENT,value:"++",line:t,column:n}):a==="="?(this.advance(),{type:r.PLUS_ASSIGN,value:"+=",line:t,column:n}):{type:r.PLUS,value:"+",line:t,column:n};case"-":return a==="-"?(this.advance(),{type:r.DECREMENT,value:"--",line:t,column:n}):a==="="?(this.advance(),{type:r.MINUS_ASSIGN,value:"-=",line:t,column:n}):{type:r.MINUS,value:"-",line:t,column:n};case"*":return a==="*"?(this.advance(),{type:r.CARET,value:"**",line:t,column:n}):a==="="?(this.advance(),{type:r.STAR_ASSIGN,value:"*=",line:t,column:n}):{type:r.STAR,value:"*",line:t,column:n};case"/":return a==="="?(this.advance(),{type:r.SLASH_ASSIGN,value:"/=",line:t,column:n}):{type:r.SLASH,value:"/",line:t,column:n};case"%":return a==="="?(this.advance(),{type:r.PERCENT_ASSIGN,value:"%=",line:t,column:n}):{type:r.PERCENT,value:"%",line:t,column:n};case"^":return a==="="?(this.advance(),{type:r.CARET_ASSIGN,value:"^=",line:t,column:n}):{type:r.CARET,value:"^",line:t,column:n};case"=":return a==="="?(this.advance(),{type:r.EQ,value:"==",line:t,column:n}):{type:r.ASSIGN,value:"=",line:t,column:n};case"!":return a==="="?(this.advance(),{type:r.NE,value:"!=",line:t,column:n}):a==="~"?(this.advance(),{type:r.NOT_MATCH,value:"!~",line:t,column:n}):{type:r.NOT,value:"!",line:t,column:n};case"<":return a==="="?(this.advance(),{type:r.LE,value:"<=",line:t,column:n}):{type:r.LT,value:"<",line:t,column:n};case">":return a==="="?(this.advance(),{type:r.GE,value:">=",line:t,column:n}):a===">"?(this.advance(),{type:r.APPEND,value:">>",line:t,column:n}):{type:r.GT,value:">",line:t,column:n};case"&":return a==="&"?(this.advance(),{type:r.AND,value:"&&",line:t,column:n}):{type:r.IDENT,value:"&",line:t,column:n};case"|":return a==="|"?(this.advance(),{type:r.OR,value:"||",line:t,column:n}):{type:r.PIPE,value:"|",line:t,column:n};case"~":return{type:r.MATCH,value:"~",line:t,column:n};case"?":return{type:r.QUESTION,value:"?",line:t,column:n};case":":return{type:r.COLON,value:":",line:t,column:n};case",":return{type:r.COMMA,value:",",line:t,column:n};case";":return{type:r.SEMICOLON,value:";",line:t,column:n};case"(":return{type:r.LPAREN,value:"(",line:t,column:n};case")":return{type:r.RPAREN,value:")",line:t,column:n};case"{":return{type:r.LBRACE,value:"{",line:t,column:n};case"}":return{type:r.RBRACE,value:"}",line:t,column:n};case"[":return{type:r.LBRACKET,value:"[",line:t,column:n};case"]":return{type:r.RBRACKET,value:"]",line:t,column:n};case"$":return{type:r.DOLLAR,value:"$",line:t,column:n};default:return{type:r.IDENT,value:i,line:t,column:n}}}isDigit(t){return t>="0"&&t<="9"}isAlpha(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"}isAlphaNumeric(t){return this.isDigit(t)||this.isAlpha(t)}};var h={LPAREN:"LPAREN",RPAREN:"RPAREN",QUESTION:"QUESTION",NEWLINE:"NEWLINE",SEMICOLON:"SEMICOLON",RBRACE:"RBRACE",COMMA:"COMMA",PIPE:"PIPE",GT:"GT",APPEND:"APPEND",AND:"AND",OR:"OR",ASSIGN:"ASSIGN",PLUS_ASSIGN:"PLUS_ASSIGN",MINUS_ASSIGN:"MINUS_ASSIGN",STAR_ASSIGN:"STAR_ASSIGN",SLASH_ASSIGN:"SLASH_ASSIGN",PERCENT_ASSIGN:"PERCENT_ASSIGN",CARET_ASSIGN:"CARET_ASSIGN",RBRACKET:"RBRACKET",COLON:"COLON",IN:"IN",PRINT:"PRINT",PRINTF:"PRINTF",IDENT:"IDENT",LT:"LT",LE:"LE",GE:"GE",EQ:"EQ",NE:"NE",MATCH:"MATCH",NOT_MATCH:"NOT_MATCH",NUMBER:"NUMBER",STRING:"STRING",DOLLAR:"DOLLAR",NOT:"NOT",MINUS:"MINUS",PLUS:"PLUS",INCREMENT:"INCREMENT",DECREMENT:"DECREMENT"};function ke(e){e.expect(h.PRINT);let t=[];if(e.check(h.NEWLINE)||e.check(h.SEMICOLON)||e.check(h.RBRACE)||e.check(h.PIPE)||e.check(h.GT)||e.check(h.APPEND))t.push({type:"field",index:{type:"number",value:0}});else for(t.push(X(e));e.check(h.COMMA);)e.advance(),t.push(X(e));let n;return e.check(h.GT)?(e.advance(),n={redirect:">",file:e.parsePrimary()}):e.check(h.APPEND)&&(e.advance(),n={redirect:">>",file:e.parsePrimary()}),{type:"print",args:t,output:n}}function X(e){return bt(e)?ne(e,!0):ne(e,!1)}function ne(e,t){let n=t?e.parseTernary():Lt(e);if(e.match(h.ASSIGN,h.PLUS_ASSIGN,h.MINUS_ASSIGN,h.STAR_ASSIGN,h.SLASH_ASSIGN,h.PERCENT_ASSIGN,h.CARET_ASSIGN)){let i=e.advance(),a=ne(e,t);if(n.type!=="variable"&&n.type!=="field"&&n.type!=="array_access")throw new Error("Invalid assignment target");return{type:"assignment",operator:new Map([["=","="],["+=","+="],["-=","-="],["*=","*="],["/=","/="],["%=","%="],["^=","^="]]).get(i.value)??"=",target:n,value:a}}return n}function bt(e){let t=0,n=e.pos;for(;n<e.tokens.length;){let i=e.tokens[n];if(i.type===h.LPAREN&&t++,i.type===h.RPAREN&&t--,i.type===h.QUESTION&&t===0)return!0;if(i.type===h.NEWLINE||i.type===h.SEMICOLON||i.type===h.RBRACE||i.type===h.COMMA||i.type===h.PIPE)return!1;n++}return!1}function Lt(e){let t=we(e);for(;e.check(h.OR);){e.advance();let n=we(e);t={type:"binary",operator:"||",left:t,right:n}}return t}function we(e){let t=ge(e);for(;e.check(h.AND);){e.advance();let n=ge(e);t={type:"binary",operator:"&&",left:t,right:n}}return t}function ge(e){let t=Mt(e);if(e.check(h.IN)){e.advance();let n=String(e.expect(h.IDENT).value);return{type:"in",key:t,array:n}}return t}function Mt(e){let t=Ie(e);for(;Pt(e)&&!Tt(e);){let n=Ie(e);t={type:"binary",operator:" ",left:t,right:n}}return t}function Ie(e){let t=ve(e);for(;e.match(h.MATCH,h.NOT_MATCH);){let n=e.advance().type===h.MATCH?"~":"!~",i=ve(e);t={type:"binary",operator:n,left:t,right:i}}return t}function ve(e){let t=e.parseAddSub();for(;e.match(h.LT,h.LE,h.GE,h.EQ,h.NE);){let n=e.advance(),i=e.parseAddSub();t={type:"binary",operator:new Map([["<","<"],["<=","<="],[">=",">="],["==","=="],["!=","!="]]).get(n.value)??"==",left:t,right:i}}return t}function Pt(e){return e.match(h.NUMBER,h.STRING,h.IDENT,h.DOLLAR,h.LPAREN,h.NOT,h.MINUS,h.PLUS,h.INCREMENT,h.DECREMENT)}function Tt(e){return e.match(h.AND,h.OR,h.QUESTION,h.ASSIGN,h.PLUS_ASSIGN,h.MINUS_ASSIGN,h.STAR_ASSIGN,h.SLASH_ASSIGN,h.PERCENT_ASSIGN,h.CARET_ASSIGN,h.COMMA,h.SEMICOLON,h.NEWLINE,h.RBRACE,h.RPAREN,h.RBRACKET,h.COLON,h.PIPE,h.APPEND,h.GT,h.IN)}function Ce(e){e.expect(h.PRINTF);let t=e.check(h.LPAREN);t&&(e.advance(),e.skipNewlines());let n=t?e.parseExpression():X(e),i=[];for(;e.check(h.COMMA);)e.advance(),t&&e.skipNewlines(),i.push(t?e.parseExpression():X(e));t&&(e.skipNewlines(),e.expect(h.RPAREN));let a;return e.check(h.GT)?(e.advance(),a={redirect:">",file:e.parsePrimary()}):e.check(h.APPEND)&&(e.advance(),a={redirect:">>",file:e.parsePrimary()}),{type:"printf",format:n,args:i,output:a}}var j=class{tokens=[];pos=0;parse(t){let n=new K(t);return this.tokens=n.tokenize(),this.pos=0,this.parseProgram()}setPos(t){this.pos=t}current(){return this.tokens[this.pos]||{type:r.EOF,value:"",line:0,column:0}}advance(){let t=this.current();return this.pos<this.tokens.length&&this.pos++,t}match(...t){return t.includes(this.current().type)}check(t){return this.current().type===t}expect(t,n){if(!this.check(t)){let i=this.current();throw new Error(n||`Expected ${t}, got ${i.type} at line ${i.line}:${i.column}`)}return this.advance()}skipNewlines(){for(;this.check(r.NEWLINE);)this.advance()}skipTerminators(){for(;this.check(r.NEWLINE)||this.check(r.SEMICOLON);)this.advance()}parseProgram(){let t=[],n=[];for(this.skipNewlines();!this.check(r.EOF)&&(this.skipNewlines(),!this.check(r.EOF));)this.check(r.FUNCTION)?t.push(this.parseFunction()):n.push(this.parseRule()),this.skipTerminators();return{functions:t,rules:n}}parseFunction(){this.expect(r.FUNCTION);let t=this.expect(r.IDENT).value;this.expect(r.LPAREN);let n=[];if(!this.check(r.RPAREN))for(n.push(this.expect(r.IDENT).value);this.check(r.COMMA);)this.advance(),n.push(this.expect(r.IDENT).value);this.expect(r.RPAREN),this.skipNewlines();let i=this.parseBlock();return{name:t,params:n,body:i}}parseRule(){let t;if(this.check(r.BEGIN))this.advance(),t={type:"begin"};else if(this.check(r.END))this.advance(),t={type:"end"};else if(this.check(r.LBRACE))t=void 0;else if(this.check(r.REGEX)){let i=this.advance();if(this.check(r.AND)||this.check(r.OR)){let a={type:"binary",operator:"~",left:{type:"field",index:{type:"number",value:0}},right:{type:"regex",pattern:i.value}};t={type:"expr_pattern",expression:this.parseLogicalOrRest(a)}}else{let a={type:"regex_pattern",pattern:i.value};if(this.check(r.COMMA)){this.advance();let s;this.check(r.REGEX)?s={type:"regex_pattern",pattern:this.advance().value}:s={type:"expr_pattern",expression:this.parseExpression()},t={type:"range",start:a,end:s}}else t=a}}else{let a={type:"expr_pattern",expression:this.parseExpression()};if(this.check(r.COMMA)){this.advance();let s;this.check(r.REGEX)?s={type:"regex_pattern",pattern:this.advance().value}:s={type:"expr_pattern",expression:this.parseExpression()},t={type:"range",start:a,end:s}}else t=a}this.skipNewlines();let n;return this.check(r.LBRACE)?n=this.parseBlock():n={type:"block",statements:[{type:"print",args:[{type:"field",index:{type:"number",value:0}}]}]},{pattern:t,action:n}}parseBlock(){this.expect(r.LBRACE),this.skipNewlines();let t=[];for(;!this.check(r.RBRACE)&&!this.check(r.EOF);)t.push(this.parseStatement()),this.skipTerminators();return this.expect(r.RBRACE),{type:"block",statements:t}}parseStatement(){if(this.check(r.SEMICOLON)||this.check(r.NEWLINE))return this.advance(),{type:"block",statements:[]};if(this.check(r.LBRACE))return this.parseBlock();if(this.check(r.IF))return this.parseIf();if(this.check(r.WHILE))return this.parseWhile();if(this.check(r.DO))return this.parseDoWhile();if(this.check(r.FOR))return this.parseFor();if(this.check(r.BREAK))return this.advance(),{type:"break"};if(this.check(r.CONTINUE))return this.advance(),{type:"continue"};if(this.check(r.NEXT))return this.advance(),{type:"next"};if(this.check(r.NEXTFILE))return this.advance(),{type:"nextfile"};if(this.check(r.EXIT)){this.advance();let n;return!this.check(r.NEWLINE)&&!this.check(r.SEMICOLON)&&!this.check(r.RBRACE)&&!this.check(r.EOF)&&(n=this.parseExpression()),{type:"exit",code:n}}if(this.check(r.RETURN)){this.advance();let n;return!this.check(r.NEWLINE)&&!this.check(r.SEMICOLON)&&!this.check(r.RBRACE)&&!this.check(r.EOF)&&(n=this.parseExpression()),{type:"return",value:n}}if(this.check(r.DELETE)){this.advance();let n=this.parsePrimary();if(n.type!=="array_access"&&n.type!=="variable")throw new Error("delete requires array element or array");return{type:"delete",target:n}}return this.check(r.PRINT)?ke(this):this.check(r.PRINTF)?Ce(this):{type:"expr_stmt",expression:this.parseExpression()}}parseIf(){this.expect(r.IF),this.expect(r.LPAREN);let t=this.parseExpression();this.expect(r.RPAREN),this.skipNewlines();let n=this.parseStatement();this.skipTerminators();let i;return this.check(r.ELSE)&&(this.advance(),this.skipNewlines(),i=this.parseStatement()),{type:"if",condition:t,consequent:n,alternate:i}}parseWhile(){this.expect(r.WHILE),this.expect(r.LPAREN);let t=this.parseExpression();this.expect(r.RPAREN),this.skipNewlines();let n=this.parseStatement();return{type:"while",condition:t,body:n}}parseDoWhile(){this.expect(r.DO),this.skipNewlines();let t=this.parseStatement();this.skipNewlines(),this.expect(r.WHILE),this.expect(r.LPAREN);let n=this.parseExpression();return this.expect(r.RPAREN),{type:"do_while",body:t,condition:n}}parseFor(){if(this.expect(r.FOR),this.expect(r.LPAREN),this.check(r.IDENT)){let s=this.advance();if(this.check(r.IN)){this.advance();let o=this.expect(r.IDENT).value;this.expect(r.RPAREN),this.skipNewlines();let c=this.parseStatement();return{type:"for_in",variable:s.value,array:o,body:c}}this.pos--}let t;this.check(r.SEMICOLON)||(t=this.parseExpression()),this.expect(r.SEMICOLON);let n;this.check(r.SEMICOLON)||(n=this.parseExpression()),this.expect(r.SEMICOLON);let i;this.check(r.RPAREN)||(i=this.parseExpression()),this.expect(r.RPAREN),this.skipNewlines();let a=this.parseStatement();return{type:"for",init:t,condition:n,update:i,body:a}}parseExpression(){return this.parseAssignment()}parseAssignment(){let t=this.parseTernary();if(this.match(r.ASSIGN,r.PLUS_ASSIGN,r.MINUS_ASSIGN,r.STAR_ASSIGN,r.SLASH_ASSIGN,r.PERCENT_ASSIGN,r.CARET_ASSIGN)){let n=this.advance(),i=this.parseAssignment();if(t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access")throw new Error("Invalid assignment target");return{type:"assignment",operator:{"=":"=","+=":"+=","-=":"-=","*=":"*=","/=":"/=","%=":"%=","^=":"^="}[n.value],target:t,value:i}}return t}parseTernary(){let t=this.parsePipeGetline();if(this.check(r.QUESTION)){this.advance();let n=this.parseExpression();this.expect(r.COLON);let i=this.parseExpression();t={type:"ternary",condition:t,consequent:n,alternate:i}}return t}parsePipeGetline(){let t=this.parseOr();if(this.check(r.PIPE)){if(this.advance(),!this.check(r.GETLINE))throw new Error("Expected 'getline' after '|' in expression context");this.advance();let n;return this.check(r.IDENT)&&(n=this.advance().value),{type:"getline",command:t,variable:n}}return t}parseOr(){let t=this.parseAnd();for(;this.check(r.OR);){this.advance();let n=this.parseAnd();t={type:"binary",operator:"||",left:t,right:n}}return t}parseLogicalOrRest(t){for(t=this.parseLogicalAndRest(t);this.check(r.OR);){this.advance();let n=this.parseAnd();t={type:"binary",operator:"||",left:t,right:n}}return t}parseLogicalAndRest(t){for(;this.check(r.AND);){this.advance();let n=this.parseIn();t={type:"binary",operator:"&&",left:t,right:n}}return t}parseAnd(){let t=this.parseIn();for(;this.check(r.AND);){this.advance();let n=this.parseIn();t={type:"binary",operator:"&&",left:t,right:n}}return t}parseIn(){let t=this.parseConcatenation();if(this.check(r.IN)){this.advance();let n=this.expect(r.IDENT).value;return{type:"in",key:t,array:n}}return t}parseConcatenation(){let t=this.parseMatch();for(;this.canStartExpression()&&!this.isConcatTerminator();){let n=this.parseMatch();t={type:"binary",operator:" ",left:t,right:n}}return t}parseMatch(){let t=this.parseComparison();for(;this.match(r.MATCH,r.NOT_MATCH);){let n=this.advance().type===r.MATCH?"~":"!~",i=this.parseComparison();t={type:"binary",operator:n,left:t,right:i}}return t}parseComparison(){let t=this.parseAddSub();for(;this.match(r.LT,r.LE,r.GT,r.GE,r.EQ,r.NE);){let n=this.advance(),i=this.parseAddSub();t={type:"binary",operator:new Map([["<","<"],["<=","<="],[">",">"],[">=",">="],["==","=="],["!=","!="]]).get(n.value)??"==",left:t,right:i}}return t}canStartExpression(){return this.match(r.NUMBER,r.STRING,r.IDENT,r.DOLLAR,r.LPAREN,r.NOT,r.MINUS,r.PLUS,r.INCREMENT,r.DECREMENT)}isConcatTerminator(){return this.match(r.AND,r.OR,r.QUESTION,r.ASSIGN,r.PLUS_ASSIGN,r.MINUS_ASSIGN,r.STAR_ASSIGN,r.SLASH_ASSIGN,r.PERCENT_ASSIGN,r.CARET_ASSIGN,r.COMMA,r.SEMICOLON,r.NEWLINE,r.RBRACE,r.RPAREN,r.RBRACKET,r.COLON,r.PIPE,r.APPEND,r.IN)}parseAddSub(){let t=this.parseMulDiv();for(;this.match(r.PLUS,r.MINUS);){let n=this.advance().value,i=this.parseMulDiv();t={type:"binary",operator:n,left:t,right:i}}return t}parseMulDiv(){let t=this.parseUnary();for(;this.match(r.STAR,r.SLASH,r.PERCENT);){let n=this.advance(),i=this.parseUnary();t={type:"binary",operator:new Map([["*","*"],["/","/"],["%","%"]]).get(n.value)??"*",left:t,right:i}}return t}parseUnary(){if(this.check(r.INCREMENT)){this.advance();let t=this.parseUnary();return t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access"?{type:"unary",operator:"+",operand:{type:"unary",operator:"+",operand:t}}:{type:"pre_increment",operand:t}}if(this.check(r.DECREMENT)){this.advance();let t=this.parseUnary();return t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access"?{type:"unary",operator:"-",operand:{type:"unary",operator:"-",operand:t}}:{type:"pre_decrement",operand:t}}if(this.match(r.NOT,r.MINUS,r.PLUS)){let t=this.advance().value,n=this.parseUnary();return{type:"unary",operator:t,operand:n}}return this.parsePower()}parsePower(){let t=this.parsePostfix();if(this.check(r.CARET)){this.advance();let n=this.parsePower();t={type:"binary",operator:"^",left:t,right:n}}return t}parsePostfix(){let t=this.parsePrimary();if(this.check(r.INCREMENT)){if(this.advance(),t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access")throw new Error("Invalid increment operand");return{type:"post_increment",operand:t}}if(this.check(r.DECREMENT)){if(this.advance(),t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access")throw new Error("Invalid decrement operand");return{type:"post_decrement",operand:t}}return t}parseFieldIndex(){if(this.check(r.INCREMENT)){this.advance();let t=this.parseFieldIndex();return t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access"?{type:"unary",operator:"+",operand:{type:"unary",operator:"+",operand:t}}:{type:"pre_increment",operand:t}}if(this.check(r.DECREMENT)){this.advance();let t=this.parseFieldIndex();return t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access"?{type:"unary",operator:"-",operand:{type:"unary",operator:"-",operand:t}}:{type:"pre_decrement",operand:t}}if(this.match(r.NOT,r.MINUS,r.PLUS)){let t=this.advance().value,n=this.parseFieldIndex();return{type:"unary",operator:t,operand:n}}return this.parseFieldIndexPower()}parseFieldIndexPower(){let t=this.parseFieldIndexPrimary();if(this.check(r.CARET)){this.advance();let n=this.parseFieldIndexPower();t={type:"binary",operator:"^",left:t,right:n}}return t}parseFieldIndexPrimary(){if(this.check(r.NUMBER))return{type:"number",value:this.advance().value};if(this.check(r.STRING))return{type:"string",value:this.advance().value};if(this.check(r.DOLLAR))return this.advance(),{type:"field",index:this.parseFieldIndex()};if(this.check(r.LPAREN)){this.advance();let t=this.parseExpression();return this.expect(r.RPAREN),t}if(this.check(r.IDENT)){let t=this.advance().value;if(this.check(r.LPAREN)){this.advance();let n=[];if(!this.check(r.RPAREN))for(n.push(this.parseExpression());this.check(r.COMMA);)this.advance(),n.push(this.parseExpression());return this.expect(r.RPAREN),{type:"call",name:t,args:n}}if(this.check(r.LBRACKET)){this.advance();let n=this.parseExpression();if(this.check(r.COMMA)){let i=[n];for(;this.check(r.COMMA);)this.advance(),i.push(this.parseExpression());this.expect(r.RBRACKET);let a=i.reduce((s,o)=>({type:"binary",operator:" ",left:{type:"binary",operator:" ",left:s,right:{type:"variable",name:"SUBSEP"}},right:o}));return{type:"array_access",array:t,key:a}}return this.expect(r.RBRACKET),{type:"array_access",array:t,key:n}}return{type:"variable",name:t}}throw new Error(`Unexpected token in field index: ${this.current().type} at line ${this.current().line}:${this.current().column}`)}parsePrimary(){if(this.check(r.NUMBER))return{type:"number",value:this.advance().value};if(this.check(r.STRING))return{type:"string",value:this.advance().value};if(this.check(r.REGEX))return{type:"regex",pattern:this.advance().value};if(this.check(r.DOLLAR))return this.advance(),{type:"field",index:this.parseFieldIndex()};if(this.check(r.LPAREN)){this.advance();let t=this.parseExpression();if(this.check(r.COMMA)){let n=[t];for(;this.check(r.COMMA);)this.advance(),n.push(this.parseExpression());return this.expect(r.RPAREN),{type:"tuple",elements:n}}return this.expect(r.RPAREN),t}if(this.check(r.GETLINE)){this.advance();let t,n;return this.check(r.IDENT)&&(t=this.advance().value),this.check(r.LT)&&(this.advance(),n=this.parsePrimary()),{type:"getline",variable:t,file:n}}if(this.check(r.IDENT)){let t=this.advance().value;if(this.check(r.LPAREN)){this.advance();let n=[];if(this.skipNewlines(),!this.check(r.RPAREN))for(n.push(this.parseExpression());this.check(r.COMMA);)this.advance(),this.skipNewlines(),n.push(this.parseExpression());return this.skipNewlines(),this.expect(r.RPAREN),{type:"call",name:t,args:n}}if(this.check(r.LBRACKET)){this.advance();let n=[this.parseExpression()];for(;this.check(r.COMMA);)this.advance(),n.push(this.parseExpression());this.expect(r.RBRACKET);let i;if(n.length===1)i=n[0];else{i=n[0];for(let a=1;a<n.length;a++)i={type:"binary",operator:" ",left:{type:"binary",operator:" ",left:i,right:{type:"variable",name:"SUBSEP"}},right:n[a]}}return{type:"array_access",array:t,key:i}}return{type:"variable",name:t}}throw new Error(`Unexpected token: ${this.current().type} at line ${this.current().line}:${this.current().column}`)}};var Ft={name:"awk",summary:"pattern scanning and text processing language",usage:"awk [OPTIONS] 'PROGRAM' [FILE...]",options:["-F FS use FS as field separator","-v VAR=VAL assign VAL to variable VAR"," --help display this help and exit"]},On={name:"awk",async execute(e,t){if(ae(e))return se(Ft);let n=new P(/\s+/),i=" ",a=Object.create(null),s=0;for(let l=0;l<e.length;l++){let p=e[l];if(p==="-F"&&l+1<e.length)i=re(e[++l]),n=Oe(i),s=l+1;else if(p.startsWith("-F"))i=re(p.slice(2)),n=Oe(i),s=l+1;else if(p==="-v"&&l+1<e.length){let E=e[++l],d=E.indexOf("=");if(d>0){let R=E.slice(0,d),b=re(E.slice(d+1));a[R]=b}s=l+1}else{if(p.startsWith("--"))return z("awk",p);if(p.startsWith("-")&&p.length>1){let E=p[1];if(E!=="F"&&E!=="v")return z("awk",`-${E}`);s=l+1}else if(!p.startsWith("-")){s=l;break}}}if(s>=e.length)return{stdout:"",stderr:`awk: missing program
|
|
14
|
+
`,exitCode:1};let o=e[s],c=e.slice(s+1),u=new j,N;try{N=u.parse(o)}catch(l){return{stdout:"",stderr:`awk: ${l instanceof Error?l.message:String(l)}
|
|
15
|
+
`,exitCode:1}}let k={readFile:t.fs.readFile.bind(t.fs),writeFile:t.fs.writeFile.bind(t.fs),appendFile:async(l,p)=>{try{let E=await t.fs.readFile(l);await t.fs.writeFile(l,E+p)}catch{await t.fs.writeFile(l,p)}},resolvePath:t.fs.resolvePath.bind(t.fs)},y=Q({fieldSep:n,maxIterations:t.limits?.maxAwkIterations,maxOutputSize:t.limits?.maxStringLength,fs:k,cwd:t.cwd,exec:t.exec?l=>t.exec(l,{cwd:t.cwd}):void 0,coverage:t.coverage});y.FS=i,y.vars=Object.assign(Object.create(null),a),y.ARGC=c.length+1,y.ARGV=Object.create(null),y.ARGV[0]="awk";for(let l=0;l<c.length;l++)y.ARGV[String(l+1)]=c[l];y.ENVIRON=oe(t.env);let w=new x(y);w.execute(N);let ie=N.rules.some(l=>l.pattern?.type!=="begin"&&l.pattern?.type!=="end"),g=N.rules.some(l=>l.pattern?.type==="end");try{if(await w.executeBegin(),y.shouldExit)return await w.executeEnd(),{stdout:w.getOutput(),stderr:"",exitCode:w.getExitCode()};if(!ie&&!g)return{stdout:w.getOutput(),stderr:"",exitCode:w.getExitCode()};let l=[];if(c.length>0)for(let p of c)try{let E=t.fs.resolvePath(t.cwd,p),R=(await t.fs.readFile(E)).split(`
|
|
16
|
+
`);R.length>0&&R[R.length-1]===""&&R.pop(),l.push({filename:p,lines:R})}catch{return{stdout:"",stderr:`awk: ${p}: No such file or directory
|
|
17
|
+
`,exitCode:1}}else{let p=t.stdin.split(`
|
|
18
|
+
`);p.length>0&&p[p.length-1]===""&&p.pop(),l.push({filename:"",lines:p})}for(let p of l){for(y.FILENAME=p.filename,y.FNR=0,y.lines=p.lines,y.lineIndex=-1,y.shouldNextFile=!1;y.lineIndex<p.lines.length-1&&(y.lineIndex++,await w.executeLine(p.lines[y.lineIndex]),!(y.shouldExit||y.shouldNextFile)););if(y.shouldExit)break}return await w.executeEnd(),{stdout:w.getOutput(),stderr:"",exitCode:w.getExitCode()}}catch(l){let p=l instanceof Error?l.message:String(l),E=l instanceof O?O.EXIT_CODE:2;return{stdout:w.getOutput(),stderr:`awk: ${p}
|
|
19
|
+
`,exitCode:E}}}};function re(e){return e.replace(/\\t/g," ").replace(/\\n/g,`
|
|
20
|
+
`).replace(/\\r/g,"\r").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\a/g,"\x07").replace(/\\v/g,"\v").replace(/\\\\/g,"\\")}function Oe(e){if(e===" ")return A("\\s+");if(/[[\](){}.*+?^$|\\]/.test(e))try{return A(e)}catch{return A(be(e))}return A(be(e))}function be(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var bn={name:"awk",flags:[{flag:"-F",type:"value",valueHint:"delimiter"},{flag:"-v",type:"value",valueHint:"string"}],stdinType:"text",needsArgs:!0};export{On as a,bn as b};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{a as o,b as i}from"./chunk-74CEPOFO.js";var m={name:"dirname",summary:"strip last component from file name",usage:"dirname [OPTION] NAME...",options:[" --help display this help and exit"]},p={name:"dirname",async execute(t,l){if(i(t))return o(m);let r=t.filter(n=>!n.startsWith("-"));if(r.length===0)return{stdout:"",stderr:`dirname: missing operand
|
|
2
|
+
`,exitCode:1};let e=[];for(let n of r){let a=n.replace(/\/+$/,""),s=a.lastIndexOf("/");s===-1?e.push("."):s===0?e.push("/"):e.push(a.slice(0,s))}return{stdout:`${e.join(`
|
|
3
|
+
`)}
|
|
4
|
+
`,stderr:"",exitCode:0}}},c={name:"dirname",flags:[],needsArgs:!0};export{p as a,c as b};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as d}from"./chunk-HWKDQ44K.js";import{a as p,b as l}from"./chunk-74CEPOFO.js";var u={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"}},y={name:"tee",async execute(n,e){if(l(n))return p(u);let t=d("tee",n,m);if(!t.ok)return t.error;let{append:f}=t.result.flags,c=t.result.positional,o=e.stdin,r="",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{r+=`tee: ${i}: No such file or directory
|
|
2
|
+
`,a=1}return{stdout:o,stderr:r,exitCode:a}}},w={name:"tee",flags:[{flag:"-a",type:"boolean"}],stdinType:"text",needsArgs:!0};export{y as a,w as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as s}from"./chunk-EIZGF4BS.js";var a=s("sha256sum","sha256","compute SHA256 message digest"),m={name:"sha256sum",flags:[{flag:"-c",type:"boolean"}],needsFiles:!0};export{a,m as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as n,b as i,c as r}from"./chunk-HDQ56CKY.js";import{a,b as s}from"./chunk-74CEPOFO.js";var f={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"]},m={name:"head",async execute(t,l){if(s(t))return a(f);let e=n(t,"head");if(!e.ok)return e.error;let{lines:o,bytes:p}=e.options;return i(l,e.options,"head",d=>r(d,o,p))}},g={name:"head",flags:[{flag:"-n",type:"value",valueHint:"number"},{flag:"-c",type:"value",valueHint:"number"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"text",needsFiles:!0};export{m as a,g as b};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{b as x}from"./chunk-7L36YK2X.js";import{a as y,b as I,c as m}from"./chunk-74CEPOFO.js";var w={name:"cut",summary:"remove sections from each line of files",usage:"cut [OPTION]... [FILE]...",options:["-c LIST select only these characters","-d DELIM use DELIM instead of TAB for field delimiter","-f LIST select only these fields","-s, --only-delimited do not print lines without delimiters"," --help display this help and exit"]};function F(t){let c=[],l=t.split(",");for(let n of l)if(n.includes("-")){let[s,r]=n.split("-");c.push({start:s?parseInt(s,10):1,end:r?parseInt(r,10):null})}else{let s=parseInt(n,10);c.push({start:s,end:s})}return c}function L(t,c){let l=[];for(let n of c){let s=n.start-1,r=n.end===null?t.length:n.end;for(let o=s;o<r&&o<t.length;o++)o>=0&&!l.includes(t[o])&&l.push(t[o])}return l}var C={name:"cut",async execute(t,c){if(I(t))return y(w);let l=" ",n=null,s=null,r=!1,o=[];for(let i=0;i<t.length;i++){let e=t[i];if(e==="-d")l=t[++i]||" ";else if(e.startsWith("-d"))l=e.slice(2);else if(e==="-f")n=t[++i];else if(e.startsWith("-f"))n=e.slice(2);else if(e==="-c")s=t[++i];else if(e.startsWith("-c"))s=e.slice(2);else if(e==="-s"||e==="--only-delimited")r=!0;else{if(e.startsWith("--"))return m("cut",e);if(e.startsWith("-")){let f=!1;for(let a of e.slice(1))if(a==="s")r=!0;else if(!"dfc".includes(a)){f=!0;break}if(f)return m("cut",e)}else o.push(e)}}if(!n&&!s)return{stdout:"",stderr:`cut: you must specify a list of bytes, characters, or fields
|
|
2
|
+
`,exitCode:1};let p=await x(c,o,{cmdName:"cut"});if(!p.ok)return p.error;let u=p.content.split(`
|
|
3
|
+
`);u.length>0&&u[u.length-1]===""&&u.pop();let g=F(n||s||"1"),h="";for(let i of u)if(s){let e=i.split(""),f=[];for(let a of g){let v=a.start-1,H=a.end===null?e.length:a.end;for(let d=v;d<H&&d<e.length;d++)d>=0&&f.push(e[d])}h+=`${f.join("")}
|
|
4
|
+
`}else{if(r&&!i.includes(l))continue;let e=i.split(l),f=L(e,g);h+=`${f.join(l)}
|
|
5
|
+
`}return{stdout:h,stderr:"",exitCode:0}}},S={name:"cut",flags:[{flag:"-d",type:"value",valueHint:"delimiter"},{flag:"-f",type:"value",valueHint:"string"},{flag:"-c",type:"value",valueHint:"string"},{flag:"-s",type:"boolean"}],stdinType:"text",needsFiles:!0};export{C as a,S as b};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{b as g}from"./chunk-7L36YK2X.js";import{a as d}from"./chunk-HWKDQ44K.js";import{a as p,b as f}from"./chunk-74CEPOFO.js";var O={name:"uniq",summary:"report or omit repeated lines",usage:"uniq [OPTION]... [INPUT [OUTPUT]]",options:["-c, --count prefix lines by the number of occurrences","-d, --repeated only print duplicate lines","-i, --ignore-case ignore case when comparing","-u, --unique only print unique lines"," --help display this help and exit"]},w={count:{short:"c",long:"count",type:"boolean"},duplicatesOnly:{short:"d",long:"repeated",type:"boolean"},uniqueOnly:{short:"u",long:"unique",type:"boolean"},ignoreCase:{short:"i",long:"ignore-case",type:"boolean"}},N={name:"uniq",async execute(c,m){if(f(c))return p(O);let o=d("uniq",c,w);if(!o.ok)return o.error;let{count:y,duplicatesOnly:h,uniqueOnly:q,ignoreCase:b}=o.result.flags,C=o.result.positional,s=await g(m,C,{cmdName:"uniq"});if(!s.ok)return s.error;let n=s.content.split(`
|
|
2
|
+
`);if(n.length>0&&n[n.length-1]===""&&n.pop(),n.length===0)return{stdout:"",stderr:"",exitCode:0};let t=[],r=n[0],i=1,x=(e,l)=>b?e.toLowerCase()===l.toLowerCase():e===l;for(let e=1;e<n.length;e++)x(n[e],r)?i++:(t.push({line:r,count:i}),r=n[e],i=1);t.push({line:r,count:i});let u=t;h?u=t.filter(e=>e.count>1):q&&(u=t.filter(e=>e.count===1));let a="";for(let{line:e,count:l}of u)y?a+=`${String(l).padStart(4)} ${e}
|
|
3
|
+
`:a+=`${e}
|
|
4
|
+
`;return{stdout:a,stderr:"",exitCode:0}}},P={name:"uniq",flags:[{flag:"-c",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-u",type:"boolean"},{flag:"-i",type:"boolean"}],stdinType:"text",needsFiles:!0};export{N as a,P as b};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{a as d}from"./chunk-7L36YK2X.js";import{a as p}from"./chunk-HWKDQ44K.js";import{a as c,b as m}from"./chunk-74CEPOFO.js";var f={name:"cat",summary:"concatenate files and print on the standard output",usage:"cat [OPTION]... [FILE]...",options:["-n, --number number all output lines"," --help display this help and exit"]},b={number:{short:"n",long:"number",type:"boolean"}},N={name:"cat",async execute(t,o){if(m(t))return c(f);let e=p("cat",t,b);if(!e.ok)return e.error;let r=e.result.flags.number,a=e.result.positional,s=await d(o,a,{cmdName:"cat",allowStdinMarker:!0,stopOnError:!1}),n="",l=1;for(let{content:i}of s.files)if(r){let u=g(i,l);n+=u.content,l=u.nextLineNumber}else n+=i;return{stdout:n,stderr:s.stderr,exitCode:s.exitCode}}};function g(t,o){let e=t.split(`
|
|
2
|
+
`),r=t.endsWith(`
|
|
3
|
+
`),a=r?e.slice(0,-1):e;return{content:a.map((n,l)=>`${String(o+l).padStart(6," ")} ${n}`).join(`
|
|
4
|
+
`)+(r?`
|
|
5
|
+
`:""),nextLineNumber:o+a.length}}var F={name:"cat",flags:[{flag:"-n",type:"boolean"},{flag:"-A",type:"boolean"},{flag:"-b",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-e",type:"boolean"},{flag:"-t",type:"boolean"}],stdinType:"text",needsFiles:!0};export{N as a,F as b};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var o={name:"pwd",async execute(l,a){let t=!1;for(let e of l)if(e==="-P")t=!0;else if(e==="-L")t=!1;else{if(e==="--")break;e.startsWith("-")}let s=a.cwd;if(t)try{s=await a.fs.realpath(a.cwd)}catch{}return{stdout:`${s}
|
|
2
|
+
`,stderr:"",exitCode:0}}},f={name:"pwd",flags:[{flag:"-P",type:"boolean"},{flag:"-L",type:"boolean"}]};export{o as a,f as b};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{a as y}from"./chunk-HWKDQ44K.js";import{a as $}from"./chunk-44UOCSGV.js";import{a as u,b as h}from"./chunk-74CEPOFO.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(h(m))return u(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,i=s.result.positional;if(d&&(p=!1),i.length<2)return{stdout:"",stderr:`mv: missing destination file operand
|
|
2
|
+
`,exitCode:1};let r=i.pop()??"",g=i,n=t.fs.resolvePath(t.cwd,r),v="",f="",b=0,a=!1;try{a=(await t.fs.stat(n)).isDirectory}catch{}if(g.length>1&&!a)return{stdout:"",stderr:`mv: target '${r}' is not a directory
|
|
3
|
+
`,exitCode:1};for(let e of g)try{let c=t.fs.resolvePath(t.cwd,e),o=n;if(a){let l=e.split("/").pop()||e;o=n==="/"?`/${l}`:`${n}/${l}`}if(d)try{await t.fs.stat(o);continue}catch{}if(await t.fs.mv(c,o),w){let l=a?`${r}/${e.split("/").pop()||e}`:r;v+=`renamed '${e}' -> '${l}'
|
|
4
|
+
`}}catch(c){let o=$(c);o.includes("ENOENT")||o.includes("no such file")?f+=`mv: cannot stat '${e}': No such file or directory
|
|
5
|
+
`:f+=`mv: cannot move '${e}': ${o}
|
|
6
|
+
`,b=1}return{stdout:v,stderr:f,exitCode:b}}},x={name:"mv",flags:[{flag:"-f",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0,minArgs:2};export{O as a,x as b};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
var F={name:"seq",async execute(r){let d=`
|
|
2
|
+
`,f=!1,s=[],t=0;for(;t<r.length;){let e=r[t];if(e==="-s"&&t+1<r.length){d=r[t+1],t+=2;continue}if(e==="-w"){f=!0,t++;continue}if(e==="--"){t++;break}if(e.startsWith("-")&&e!=="-"){if(e.startsWith("-s")&&e.length>2){d=e.slice(2),t++;continue}if((e==="-ws"||e==="-sw")&&(f=!0,t+1<r.length)){d=r[t+1],t+=2;continue}}s.push(e),t++}for(;t<r.length;)s.push(r[t]),t++;if(s.length===0)return{stdout:"",stderr:`seq: missing operand
|
|
3
|
+
`,exitCode:1};let l=1,o=1,a;if(s.length===1?a=parseFloat(s[0]):s.length===2?(l=parseFloat(s[0]),a=parseFloat(s[1])):(l=parseFloat(s[0]),o=parseFloat(s[1]),a=parseFloat(s[2])),Number.isNaN(l)||Number.isNaN(o)||Number.isNaN(a))return{stdout:"",stderr:`seq: invalid floating point argument: '${s.find(n=>Number.isNaN(parseFloat(n)))}'
|
|
4
|
+
`,exitCode:1};if(o===0)return{stdout:"",stderr:`seq: invalid Zero increment value: '0'
|
|
5
|
+
`,exitCode:1};let i=[],h=e=>{let n=String(e),u=n.indexOf(".");return u===-1?0:n.length-u-1},c=Math.max(h(l),h(o),h(a)),p=1e5,g=0;if(o>0)for(let e=l;e<=a+1e-10&&!(g++>p);e+=o)i.push(c>0?e.toFixed(c):String(Math.round(e)));else for(let e=l;e>=a-1e-10&&!(g++>p);e+=o)i.push(c>0?e.toFixed(c):String(Math.round(e)));if(f&&i.length>0){let e=Math.max(...i.map(n=>n.replace("-","").length));for(let n=0;n<i.length;n++){let u=i[n].startsWith("-"),x=(u?i[n].slice(1):i[n]).padStart(e,"0");i[n]=u?`-${x}`:x}}let m=i.join(d);return{stdout:m?`${m}
|
|
6
|
+
`:"",stderr:"",exitCode:0}}},b={name:"seq",flags:[{flag:"-s",type:"value",valueHint:"string"},{flag:"-w",type:"boolean"}],needsArgs:!0};export{F as a,b};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import{a as j,b as y,c as g}from"./chunk-74CEPOFO.js";var v={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 N(i,s){return s?i.split(s):i.split(/[ \t]+/).filter(n=>n.length>0)}function F(i,s,n,f){let e=N(i,s),r=e[n-1]??"";return f&&(r=r.toLowerCase()),{fields:e,joinKey:r,original:i}}function m(i,s,n){let f=n.separator??" ";if(n.outputFormat){let o=[];for(let{file:c,field:p}of n.outputFormat){let a=c===1?i:s;a&&p===0?o.push(a.joinKey):a&&a.fields[p-1]!==void 0?o.push(a.fields[p-1]):o.push(n.emptyString)}return o.join(f)}let e=[],r=i?.joinKey??s?.joinKey??"";if(e.push(r),i)for(let o=0;o<i.fields.length;o++)o!==n.field1-1&&e.push(i.fields[o]);if(s)for(let o=0;o<s.fields.length;o++)o!==n.field2-1&&e.push(s.fields[o]);return e.join(f)}function I(i){let s=i.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),o=Number.parseInt(e[2],10);if(r!==1&&r!==2)return null;n.push({file:r,field:o})}return n}var w={name:"join",execute:async(i,s)=>{if(y(i))return j(v);let n={field1:1,field2:1,separator:null,printUnpairable:new Set,onlyUnpairable:new Set,emptyString:"",outputFormat:null,ignoreCase:!1},f=[],e=0;for(;e<i.length;){let t=i[e];if(t==="-1"&&e+1<i.length){let l=Number.parseInt(i[e+1],10);if(Number.isNaN(l)||l<1)return{exitCode:1,stdout:"",stderr:`join: invalid field number: '${i[e+1]}'
|
|
2
|
+
`};n.field1=l,e+=2}else if(t==="-2"&&e+1<i.length){let l=Number.parseInt(i[e+1],10);if(Number.isNaN(l)||l<1)return{exitCode:1,stdout:"",stderr:`join: invalid field number: '${i[e+1]}'
|
|
3
|
+
`};n.field2=l,e+=2}else if((t==="-t"||t==="--field-separator")&&e+1<i.length)n.separator=i[e+1],e+=2;else if(t.startsWith("-t")&&t.length>2)n.separator=t.slice(2),e++;else if(t==="-a"&&e+1<i.length){let l=Number.parseInt(i[e+1],10);if(l!==1&&l!==2)return{exitCode:1,stdout:"",stderr:`join: invalid file number: '${i[e+1]}'
|
|
4
|
+
`};n.printUnpairable.add(l),e+=2}else if(t.match(/^-a[12]$/))n.printUnpairable.add(Number.parseInt(t[2],10)),e++;else if(t==="-v"&&e+1<i.length){let l=Number.parseInt(i[e+1],10);if(l!==1&&l!==2)return{exitCode:1,stdout:"",stderr:`join: invalid file number: '${i[e+1]}'
|
|
5
|
+
`};n.onlyUnpairable.add(l),e+=2}else if(t.match(/^-v[12]$/))n.onlyUnpairable.add(Number.parseInt(t[2],10)),e++;else if(t==="-e"&&e+1<i.length)n.emptyString=i[e+1],e+=2;else if(t==="-o"&&e+1<i.length){let l=I(i[e+1]);if(!l)return{exitCode:1,stdout:"",stderr:`join: invalid field spec: '${i[e+1]}'
|
|
6
|
+
`};n.outputFormat=l,e+=2}else if(t==="-i"||t==="--ignore-case")n.ignoreCase=!0,e++;else if(t==="--"){f.push(...i.slice(e+1));break}else{if(t.startsWith("-")&&t!=="-")return g("join",t);f.push(t),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 t of f)if(t==="-")r.push(s.stdin??"");else{let l=s.fs.resolvePath(s.cwd,t),u=await s.fs.readFile(l);if(u===null)return{exitCode:1,stdout:"",stderr:`join: ${t}: No such file or directory
|
|
9
|
+
`};r.push(u)}let o=(t,l)=>{let u=t.split(`
|
|
10
|
+
`);return t.endsWith(`
|
|
11
|
+
`)&&u[u.length-1]===""&&u.pop(),u.filter(h=>h.length>0).map(h=>F(h,n.separator,l,n.ignoreCase))},c=o(r[0],n.field1),p=o(r[1],n.field2),a=new Map;for(let t of p){let l=a.get(t.joinKey);l?l.push(t):a.set(t.joinKey,[t])}let d=[],b=new Set;for(let t of c){let l=a.get(t.joinKey);if(l&&l.length>0){if(b.add(t.joinKey),n.onlyUnpairable.size===0)for(let u of l)d.push(m(t,u,n))}else(n.printUnpairable.has(1)||n.onlyUnpairable.has(1))&&d.push(m(t,null,n))}if(n.printUnpairable.has(2)||n.onlyUnpairable.has(2))for(let t of p)b.has(t.joinKey)||d.push(m(null,t,n));return{exitCode:0,stdout:d.length>0?`${d.join(`
|
|
12
|
+
`)}
|
|
13
|
+
`:"",stderr:""}}},U={name:"join",flags:[{flag:"-1",type:"value",valueHint:"number"},{flag:"-2",type:"value",valueHint:"number"},{flag:"-t",type:"value",valueHint:"delimiter"},{flag:"-a",type:"value",valueHint:"number"},{flag:"-v",type:"value",valueHint:"number"},{flag:"-e",type:"value",valueHint:"string"},{flag:"-o",type:"value",valueHint:"format"},{flag:"-i",type:"boolean"}],needsArgs:!0,minArgs:2};export{w as a,U as b};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{a as r,b as m}from"./chunk-74CEPOFO.js";var p={name:"basename",summary:"strip directory and suffix from filenames",usage:`basename NAME [SUFFIX]
|
|
2
|
+
basename OPTION... NAME...`,options:["-a, --multiple support multiple arguments","-s, --suffix=SUFFIX remove a trailing SUFFIX"," --help display this help and exit"]},c={name:"basename",async execute(n,u){if(m(n))return r(p);let l=!1,s="",a=[];for(let t=0;t<n.length;t++){let e=n[t];e==="-a"||e==="--multiple"?l=!0:e==="-s"&&t+1<n.length?(s=n[++t],l=!0):e.startsWith("--suffix=")?(s=e.slice(9),l=!0):e.startsWith("-")||a.push(e)}if(a.length===0)return{stdout:"",stderr:`basename: missing operand
|
|
3
|
+
`,exitCode:1};!l&&a.length>=2&&(s=a.pop()??"");let o=[];for(let t of a){let e=t.replace(/\/+$/,""),i=e.split("/").pop()||e;s&&i.endsWith(s)&&(i=i.slice(0,-s.length)),o.push(i)}return{stdout:`${o.join(`
|
|
4
|
+
`)}
|
|
5
|
+
`,stderr:"",exitCode:0}}},h={name:"basename",flags:[{flag:"-a",type:"boolean"},{flag:"-s",type:"value",valueHint:"string"}],needsArgs:!0};export{c as a,h as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as m}from"./chunk-EIZGF4BS.js";var s=m("md5sum","md5","compute MD5 message digest"),o={name:"md5sum",flags:[{flag:"-c",type:"boolean"}],needsFiles:!0};export{s as a,o as b};
|
|
@@ -14,7 +14,7 @@ import{a as Ce,b as Fe,c as ne}from"./chunk-74CEPOFO.js";import{a as G,c as B,e
|
|
|
14
14
|
`:`${c}: ${l}
|
|
15
15
|
`}catch{o+=t?`cannot open
|
|
16
16
|
`:`${c}: cannot open (No such file or directory)
|
|
17
|
-
`,s=1}return{stdout:o,stderr:"",exitCode:s}}};export{Dr as
|
|
17
|
+
`,s=1}return{stdout:o,stderr:"",exitCode:s}}},Mr={name:"file",flags:[{flag:"-b",type:"boolean"},{flag:"-i",type:"boolean"},{flag:"-L",type:"boolean"}],needsArgs:!0};export{Dr as a,Mr as b};
|
|
18
18
|
/*! Bundled license information:
|
|
19
19
|
|
|
20
20
|
ieee754/index.js:
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as c}from"./chunk-OJDRYQWQ.js";var C={name:"time",async execute(i,r){let a="%e %M",o=null,d=!1,m=!1,t=0;for(;t<i.length;){let e=i[t];if(e==="-f"||e==="--format"){if(t++,t>=i.length)return{stdout:"",stderr:`time: missing argument to '-f'
|
|
2
2
|
`,exitCode:1};a=i[t],t++}else if(e==="-o"||e==="--output"){if(t++,t>=i.length)return{stdout:"",stderr:`time: missing argument to '-o'
|
|
3
3
|
`,exitCode:1};o=i[t],t++}else if(e==="-a"||e==="--append")d=!0,t++;else if(e==="-v"||e==="--verbose")a=`Command being timed: %C
|
|
4
4
|
Elapsed (wall clock) time: %e seconds
|
|
5
|
-
Maximum resident set size (kbytes): %M`,t++;else if(e==="-p"||e==="--portability")m=!0,t++;else if(e==="--"){t++;break}else if(e.startsWith("-"))t++;else break}let f=i.slice(t);if(f.length===0)return{stdout:"",stderr:"",exitCode:0};let p=performance.now(),
|
|
6
|
-
`,exitCode:1};s=await r.exec(
|
|
5
|
+
Maximum resident set size (kbytes): %M`,t++;else if(e==="-p"||e==="--portability")m=!0,t++;else if(e==="--"){t++;break}else if(e.startsWith("-"))t++;else break}let f=i.slice(t);if(f.length===0)return{stdout:"",stderr:"",exitCode:0};let p=performance.now(),u=f.join(" "),s;try{if(!r.exec)return{stdout:"",stderr:`time: exec not available
|
|
6
|
+
`,exitCode:1};s=await r.exec(u,{env:c(r.env),cwd:r.cwd})}catch(e){s={stdout:"",stderr:`time: ${e.message}
|
|
7
7
|
`,exitCode:127}}let l=(performance.now()-p)/1e3,n;if(m?n=`real ${l.toFixed(2)}
|
|
8
8
|
user 0.00
|
|
9
9
|
sys 0.00
|
|
10
|
-
`:(n=a.replace(/%e/g,l.toFixed(2)).replace(/%E/g,w(l)).replace(/%M/g,"0").replace(/%S/g,"0.00").replace(/%U/g,"0.00").replace(/%P/g,"0%").replace(/%C/g,
|
|
10
|
+
`:(n=a.replace(/%e/g,l.toFixed(2)).replace(/%E/g,w(l)).replace(/%M/g,"0").replace(/%S/g,"0.00").replace(/%U/g,"0.00").replace(/%P/g,"0%").replace(/%C/g,u),n.endsWith(`
|
|
11
11
|
`)||(n+=`
|
|
12
12
|
`)),o)try{let e=r.fs.resolvePath(r.cwd,o);if(d&&await r.fs.exists(e)){let g=await r.fs.readFile(e);await r.fs.writeFile(e,g+n)}else await r.fs.writeFile(e,n)}catch(e){return{stdout:s.stdout,stderr:s.stderr+`time: cannot write to '${o}': ${e.message}
|
|
13
|
-
`,exitCode:s.exitCode}}else s={...s,stderr:s.stderr+n};return s}};function w(i){let r=Math.floor(i/3600),a=Math.floor(i%3600/60),o=i%60;return r>0?`${r}:${a.toString().padStart(2,"0")}:${o.toFixed(2).padStart(5,"0")}`:`${a}:${o.toFixed(2).padStart(5,"0")}`}export{C as
|
|
13
|
+
`,exitCode:s.exitCode}}else s={...s,stderr:s.stderr+n};return s}};function w(i){let r=Math.floor(i/3600),a=Math.floor(i%3600/60),o=i%60;return r>0?`${r}:${a.toString().padStart(2,"0")}:${o.toFixed(2).padStart(5,"0")}`:`${a}:${o.toFixed(2).padStart(5,"0")}`}var F={name:"time",flags:[{flag:"-p",type:"boolean"}],needsArgs:!0};export{C as a,F as b};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{a as p,b as h,c as w}from"./chunk-74CEPOFO.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 g(s,r,n){return n?new TextEncoder().encode(s).length:s===" "?8-r%8:s==="\b"?-1:1}function y(s,r){if(s.length===0)return s;let{width:n,breakAtSpaces:u,countBytes:i}=r,l=[],e="",t=0,o=-1,f=0;for(let c=0;c<s.length;c++){let a=s[c],d=g(a,t,i);t+d>n&&e.length>0?u&&o>=0?(l.push(e.slice(0,o+1)),e=e.slice(o+1)+a,t=t-f-1+d,o=-1,f=0):(l.push(e),e=a,t=d,o=-1,f=0):(e+=a,t+=d,(a===" "||a===" ")&&(o=e.length-1,f=t-d))}return e.length>0&&l.push(e),l.join(`
|
|
2
|
+
`)}function b(s,r){if(s==="")return"";let n=s.split(`
|
|
3
|
+
`),u=s.endsWith(`
|
|
4
|
+
`)&&n[n.length-1]==="";return u&&n.pop(),n.map(l=>y(l,r)).join(`
|
|
5
|
+
`)+(u?`
|
|
6
|
+
`:"")}var k={name:"fold",execute:async(s,r)=>{if(h(s))return p(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 l="";if(u.length===0){let e=r.stdin??"";l=b(e,n)}else for(let e of u){let t=r.fs.resolvePath(r.cwd,e),o=await r.fs.readFile(t);if(o===null)return{exitCode:1,stdout:l,stderr:`fold: ${e}: No such file or directory
|
|
11
|
+
`};l+=b(o,n)}return{exitCode:0,stdout:l,stderr:""}}},x={name:"fold",flags:[{flag:"-w",type:"value",valueHint:"number"},{flag:"-s",type:"boolean"},{flag:"-b",type:"boolean"}],stdinType:"text",needsFiles:!0};export{k as a,x as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as l,b as n,d as s}from"./chunk-HDQ56CKY.js";import{a,b as i}from"./chunk-74CEPOFO.js";var m={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"]},d={name:"tail",async execute(t,r){if(i(t))return a(m);let e=l(t,"tail");if(!e.ok)return e.error;let{lines:o,bytes:p,fromLine:f}=e.options;return n(r,e.options,"tail",u=>s(u,o,p,f??!1))}},c={name:"tail",flags:[{flag:"-n",type:"value",valueHint:"number"},{flag:"-c",type:"value",valueHint:"number"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"text",needsFiles:!0};export{d as a,c as b};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import{a as $}from"./chunk-HWKDQ44K.js";import{a as v,b as z}from"./chunk-74CEPOFO.js";import{constants as C,gunzipSync as b,gzipSync as w}from"node:zlib";var q={name:"gzip",summary:"compress or expand files",usage:"gzip [OPTION]... [FILE]...",description:`Compress FILEs (by default, in-place).
|
|
2
|
+
|
|
3
|
+
When no FILE is given, or when FILE is -, read from standard input.
|
|
4
|
+
|
|
5
|
+
With -d, decompress instead.`,options:["-c, --stdout write to standard output, keep original files","-d, --decompress decompress","-f, --force force overwrite of output file","-k, --keep keep (don't delete) input files","-l, --list list compressed file contents","-n, --no-name do not save or restore the original name and timestamp","-N, --name save or restore the original file name and timestamp","-q, --quiet suppress all warnings","-r, --recursive operate recursively on directories","-S, --suffix=SUF use suffix SUF on compressed files (default: .gz)","-t, --test test compressed file integrity","-v, --verbose verbose mode","-1, --fast compress faster","-9, --best compress better"," --help display this help and exit"]},I={name:"gunzip",summary:"decompress files",usage:"gunzip [OPTION]... [FILE]...",description:`Decompress FILEs (by default, in-place).
|
|
6
|
+
|
|
7
|
+
When no FILE is given, or when FILE is -, read from standard input.`,options:["-c, --stdout write to standard output, keep original files","-f, --force force overwrite of output file","-k, --keep keep (don't delete) input files","-l, --list list compressed file contents","-n, --no-name do not restore the original name and timestamp","-N, --name restore the original file name and timestamp","-q, --quiet suppress all warnings","-r, --recursive operate recursively on directories","-S, --suffix=SUF use suffix SUF on compressed files (default: .gz)","-t, --test test compressed file integrity","-v, --verbose verbose mode"," --help display this help and exit"]},P={name:"zcat",summary:"decompress files to stdout",usage:"zcat [OPTION]... [FILE]...",description:`Decompress FILEs to standard output.
|
|
8
|
+
|
|
9
|
+
When no FILE is given, or when FILE is -, read from standard input.`,options:["-f, --force force; read compressed data even from a terminal","-l, --list list compressed file contents","-q, --quiet suppress all warnings","-S, --suffix=SUF use suffix SUF on compressed files (default: .gz)","-t, --test test compressed file integrity","-v, --verbose verbose mode"," --help display this help and exit"]},L={stdout:{short:"c",long:"stdout",type:"boolean"},toStdout:{long:"to-stdout",type:"boolean"},decompress:{short:"d",long:"decompress",type:"boolean"},uncompress:{long:"uncompress",type:"boolean"},force:{short:"f",long:"force",type:"boolean"},keep:{short:"k",long:"keep",type:"boolean"},list:{short:"l",long:"list",type:"boolean"},noName:{short:"n",long:"no-name",type:"boolean"},name:{short:"N",long:"name",type:"boolean"},quiet:{short:"q",long:"quiet",type:"boolean"},recursive:{short:"r",long:"recursive",type:"boolean"},suffix:{short:"S",long:"suffix",type:"string",default:".gz"},test:{short:"t",long:"test",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"},fast:{short:"1",long:"fast",type:"boolean"},level2:{short:"2",type:"boolean"},level3:{short:"3",type:"boolean"},level4:{short:"4",type:"boolean"},level5:{short:"5",type:"boolean"},level6:{short:"6",type:"boolean"},level7:{short:"7",type:"boolean"},level8:{short:"8",type:"boolean"},best:{short:"9",long:"best",type:"boolean"}};function F(e){return e.best?C.Z_BEST_COMPRESSION:e.level8?8:e.level7?7:e.level6?6:e.level5?5:e.level4?4:e.level3?3:e.level2?2:e.fast?C.Z_BEST_SPEED:C.Z_DEFAULT_COMPRESSION}function S(e){if(e.length<10)return{originalName:null,mtime:null,headerSize:0};if(e[0]!==31||e[1]!==139)return{originalName:null,mtime:null,headerSize:0};let t=e[3],o=e[4]|e[5]<<8|e[6]<<16|e[7]<<24,r=10;if(t&4){if(r+2>e.length)return{originalName:null,mtime:null,headerSize:0};let n=e[r]|e[r+1]<<8;r+=2+n}let s=null;if(t&8){let n=r;for(;r<e.length&&e[r]!==0;)r++;r<e.length&&(s=new TextDecoder().decode(e.slice(n,r)),r++)}if(t&16){for(;r<e.length&&e[r]!==0;)r++;r++}return t&2&&(r+=2),{originalName:s,mtime:o>0?new Date(o*1e3):null,headerSize:r}}function D(e){if(e.length<4)return 0;let t=e.length;return e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24}function m(e){return e.length>=2&&e[0]===31&&e[1]===139}async function E(e,t,o,r,s,n){let l=o.suffix,f,p,a;if(t==="-"||t==="")if(a=Uint8Array.from(e.stdin,u=>u.charCodeAt(0)),s){if(!m(a))return o.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`${r}: stdin: not in gzip format
|
|
10
|
+
`,exitCode:1};try{let u=b(a);return{stdout:String.fromCharCode(...u),stderr:"",exitCode:0}}catch(u){let i=u instanceof Error?u.message:"unknown error";return{stdout:"",stderr:`${r}: stdin: ${i}
|
|
11
|
+
`,exitCode:1}}}else{let u=F(o),i=w(a,{level:u});return{stdout:String.fromCharCode(...i),stderr:"",exitCode:0}}f=e.fs.resolvePath(e.cwd,t);try{if((await e.fs.stat(f)).isDirectory)return o.recursive?await k(e,f,o,r,s,n):o.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`${r}: ${t}: is a directory -- ignored
|
|
12
|
+
`,exitCode:1}}catch{return{stdout:"",stderr:`${r}: ${t}: No such file or directory
|
|
13
|
+
`,exitCode:1}}try{a=await e.fs.readFileBuffer(f)}catch{return{stdout:"",stderr:`${r}: ${t}: No such file or directory
|
|
14
|
+
`,exitCode:1}}if(s){if(!t.endsWith(l))return o.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`${r}: ${t}: unknown suffix -- ignored
|
|
15
|
+
`,exitCode:1};if(!m(a))return o.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`${r}: ${t}: not in gzip format
|
|
16
|
+
`,exitCode:1};let u;try{u=b(a)}catch(i){let c=i instanceof Error?i.message:"unknown error";return{stdout:"",stderr:`${r}: ${t}: ${c}
|
|
17
|
+
`,exitCode:1}}if(n)return{stdout:String.fromCharCode(...u),stderr:"",exitCode:0};if(o.name){let i=S(a);i.originalName?p=e.fs.resolvePath(e.cwd,i.originalName):p=f.slice(0,-l.length)}else p=f.slice(0,-l.length);if(!o.force)try{return await e.fs.stat(p),{stdout:"",stderr:`${r}: ${p} already exists; not overwritten
|
|
18
|
+
`,exitCode:1}}catch{}if(await e.fs.writeFile(p,u),!o.keep&&!n&&await e.fs.rm(f),o.verbose){let i=a.length>0?((1-a.length/u.length)*100).toFixed(1):"0.0";return{stdout:"",stderr:`${t}: ${i}% -- replaced with ${p.split("/").pop()}
|
|
19
|
+
`,exitCode:0}}return{stdout:"",stderr:"",exitCode:0}}else{if(t.endsWith(l))return o.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`${r}: ${t} already has ${l} suffix -- unchanged
|
|
20
|
+
`,exitCode:1};let u=F(o),i;try{i=w(a,{level:u})}catch(c){let d=c instanceof Error?c.message:"unknown error";return{stdout:"",stderr:`${r}: ${t}: ${d}
|
|
21
|
+
`,exitCode:1}}if(n)return{stdout:String.fromCharCode(...i),stderr:"",exitCode:0};if(p=f+l,!o.force)try{return await e.fs.stat(p),{stdout:"",stderr:`${r}: ${p} already exists; not overwritten
|
|
22
|
+
`,exitCode:1}}catch{}if(await e.fs.writeFile(p,i),!o.keep&&!n&&await e.fs.rm(f),o.verbose){let c=a.length>0?((1-i.length/a.length)*100).toFixed(1):"0.0";return{stdout:"",stderr:`${t}: ${c}% -- replaced with ${p.split("/").pop()}
|
|
23
|
+
`,exitCode:0}}return{stdout:"",stderr:"",exitCode:0}}}async function k(e,t,o,r,s,n){let l=await e.fs.readdir(t),f="",p="",a=0;for(let u of l){let i=e.fs.resolvePath(t,u),c=await e.fs.stat(i);if(c.isDirectory){let d=await k(e,i,o,r,s,n);f+=d.stdout,p+=d.stderr,d.exitCode!==0&&(a=d.exitCode)}else if(c.isFile){let d=o.suffix;if(s&&!u.endsWith(d)||!s&&u.endsWith(d))continue;let y=i.startsWith(`${e.cwd}/`)?i.slice(e.cwd.length+1):i,h=await E(e,y,o,r,s,n);f+=h.stdout,p+=h.stderr,h.exitCode!==0&&(a=h.exitCode)}}return{stdout:f,stderr:p,exitCode:a}}async function O(e,t,o,r){let s;if(t==="-"||t==="")s=Uint8Array.from(e.stdin,i=>i.charCodeAt(0));else{let i=e.fs.resolvePath(e.cwd,t);try{s=await e.fs.readFileBuffer(i)}catch{return{stdout:"",stderr:`${r}: ${t}: No such file or directory
|
|
24
|
+
`,exitCode:1}}}if(!m(s))return o.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`${r}: ${t}: not in gzip format
|
|
25
|
+
`,exitCode:1};let n=s.length,l=D(s),f=l>0?((1-n/l)*100).toFixed(1):"0.0",a=S(s).originalName||(t==="-"?"":t.replace(/\.gz$/,""));return{stdout:`${n.toString().padStart(10)} ${l.toString().padStart(10)} ${f.padStart(5)}% ${a}
|
|
26
|
+
`,stderr:"",exitCode:0}}async function U(e,t,o,r){let s;if(t==="-"||t==="")s=Uint8Array.from(e.stdin,n=>n.charCodeAt(0));else{let n=e.fs.resolvePath(e.cwd,t);try{s=await e.fs.readFileBuffer(n)}catch{return{stdout:"",stderr:`${r}: ${t}: No such file or directory
|
|
27
|
+
`,exitCode:1}}}if(!m(s))return o.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`${r}: ${t}: not in gzip format
|
|
28
|
+
`,exitCode:1};try{return b(s),o.verbose?{stdout:"",stderr:`${t}: OK
|
|
29
|
+
`,exitCode:0}:{stdout:"",stderr:"",exitCode:0}}catch(n){let l=n instanceof Error?n.message:"invalid";return{stdout:"",stderr:`${r}: ${t}: ${l}
|
|
30
|
+
`,exitCode:1}}}async function x(e,t,o){let r=o==="zcat"?P:o==="gunzip"?I:q;if(z(e))return v(r);let s=$(o,e,L);if(!s.ok)return s.error.stderr.includes("unrecognized option"),s.error;let n=s.result.flags,l=s.result.positional,f=o==="gunzip"||o==="zcat"||n.decompress||n.uncompress,p=o==="zcat"||n.stdout||n.toStdout;if(n.list){l.length===0&&(l=["-"]);let c=` compressed uncompressed ratio uncompressed_name
|
|
31
|
+
`,d="",y=0;for(let h of l){let g=await O(t,h,n,o);c+=g.stdout,d+=g.stderr,g.exitCode!==0&&(y=g.exitCode)}return{stdout:c,stderr:d,exitCode:y}}if(n.test){l.length===0&&(l=["-"]);let c="",d="",y=0;for(let h of l){let g=await U(t,h,n,o);c+=g.stdout,d+=g.stderr,g.exitCode!==0&&(y=g.exitCode)}return{stdout:c,stderr:d,exitCode:y}}l.length===0&&(l=["-"]);let a="",u="",i=0;for(let c of l){let d=await E(t,c,n,o,f,p);a+=d.stdout,u+=d.stderr,d.exitCode!==0&&(i=d.exitCode)}return{stdout:a,stderr:u,exitCode:i}}var _={name:"gzip",async execute(e,t){return x(e,t,"gzip")}},H={name:"gunzip",async execute(e,t){return x(e,t,"gunzip")}},B={name:"zcat",async execute(e,t){return x(e,t,"zcat")}},G={name:"gzip",flags:[{flag:"-c",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-k",type:"boolean"},{flag:"-l",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-t",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-1",type:"boolean"},{flag:"-9",type:"boolean"}],stdinType:"binary",needsFiles:!0},Z={name:"gunzip",flags:[{flag:"-c",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-k",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"binary",needsFiles:!0},M={name:"zcat",flags:[{flag:"-f",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"binary",needsFiles:!0};export{_ as a,H as b,B as c,G as d,Z as e,M as f};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{a as f,b as m,c}from"./chunk-74CEPOFO.js";
|
|
2
|
-
`),t=[],u=i,
|
|
3
|
-
`)&&l[l.length-1]==="";
|
|
4
|
-
`)+(
|
|
5
|
-
`:""),nextNumber:u}}var
|
|
1
|
+
import{a as f,b as m,c}from"./chunk-74CEPOFO.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,a=r.endsWith(`
|
|
3
|
+
`)&&l[l.length-1]==="";a&&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
|
+
`)+(a?`
|
|
5
|
+
`:""),nextNumber:u}}var y={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
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
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
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}'
|
|
@@ -12,5 +12,5 @@ import{a as f,b as m,c}from"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";var
|
|
|
12
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
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
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="",
|
|
16
|
-
`};let d=b(
|
|
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="",a=i.startNumber;if(l.length===0){let n=s.stdin??"";u=b(n,i,a).output}else for(let n of l){let e=s.fs.resolvePath(s.cwd,n),o=await s.fs.readFile(e);if(o===null)return{exitCode:1,stdout:u,stderr:`nl: ${n}: No such file or directory
|
|
16
|
+
`};let d=b(o,i,a);u+=d.output,a=d.nextNumber}return{exitCode:0,stdout:u,stderr:""}}},x={name:"nl",flags:[{flag:"-b",type:"value",valueHint:"string"},{flag:"-n",type:"value",valueHint:"string"},{flag:"-w",type:"value",valueHint:"number"},{flag:"-s",type:"value",valueHint:"string"},{flag:"-v",type:"value",valueHint:"number"},{flag:"-i",type:"value",valueHint:"number"}],stdinType:"text",needsFiles:!0};export{y as a,x as b};
|