just-binary 3.2.4 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/Bash.d.ts +56 -1
- package/dist/bin/chunks/alias-MILMQPGR.js +2 -0
- package/dist/bin/chunks/awk2-FB5MXVFV.js +2 -0
- package/dist/bin/chunks/base64-NGAPXZAM.js +2 -0
- package/dist/bin/chunks/basename-ZFBDKUVW.js +2 -0
- package/dist/bin/chunks/bash-FQY3C37R.js +2 -0
- package/dist/bin/chunks/cat-UO3ZDQHP.js +2 -0
- package/dist/bin/chunks/chmod-GYXHDITN.js +2 -0
- package/dist/bin/chunks/chunk-2FWUPGJH.js +6 -0
- package/dist/bin/chunks/chunk-2JQKBSIH.js +14 -0
- package/dist/bin/chunks/chunk-2MX7URRE.js +10 -0
- package/dist/bin/chunks/chunk-3G7ONQFJ.js +11 -0
- package/dist/bin/chunks/chunk-3KKXX5QY.js +13 -0
- package/dist/bin/chunks/chunk-3SWITKTS.js +7 -0
- package/dist/bin/chunks/chunk-3V7N5SEN.js +9 -0
- package/dist/bin/chunks/chunk-45S6IACR.js +3 -0
- package/dist/bin/chunks/chunk-4PDI7A54.js +20 -0
- package/dist/bin/chunks/chunk-532RLOPK.js +14 -0
- package/dist/bin/chunks/chunk-5B4HIQFQ.js +7 -0
- package/dist/bin/chunks/chunk-5CTS5L3T.js +18 -0
- package/dist/bin/chunks/chunk-5RANCCE2.js +6 -0
- package/dist/bin/chunks/chunk-63FHXCEF.js +4 -0
- package/dist/bin/chunks/chunk-64ICY43M.js +8 -0
- package/dist/bin/chunks/chunk-6MJ6NBIG.js +8 -0
- package/dist/bin/chunks/chunk-6N6IRP6G.js +6 -0
- package/dist/bin/chunks/chunk-6VQWCKYE.js +2 -0
- package/dist/bin/chunks/chunk-6WKRPHAZ.js +36 -0
- package/dist/bin/chunks/chunk-73X3QWRT.js +80 -0
- package/dist/bin/chunks/chunk-7FCHB2LT.js +14 -0
- package/dist/bin/chunks/chunk-7FGPQVVJ.js +12 -0
- package/dist/bin/chunks/chunk-7FUCLMNU.js +7 -0
- package/dist/bin/chunks/chunk-7LGOLTRR.js +5 -0
- package/dist/bin/chunks/chunk-7POGKC42.js +11 -0
- package/dist/bin/chunks/chunk-A257OMG4.js +2 -0
- package/dist/bin/chunks/chunk-BH4O34VZ.js +26 -0
- package/dist/bin/chunks/chunk-BTCJZ7OY.js +10 -0
- package/dist/bin/chunks/chunk-CEU7KGBV.js +24 -0
- package/dist/bin/chunks/chunk-COM2NIBS.js +3 -0
- package/dist/bin/chunks/chunk-CXEBUGVP.js +7 -0
- package/dist/bin/chunks/chunk-CY4RP66Q.js +21 -0
- package/dist/bin/chunks/chunk-DM55Q4EM.js +5 -0
- package/dist/bin/chunks/chunk-DUBCYODB.js +11 -0
- package/dist/bin/chunks/chunk-DUPNDZ3H.js +6 -0
- package/dist/bin/chunks/chunk-EKD22SYR.js +23 -0
- package/dist/bin/chunks/chunk-EOMAF5KQ.js +6 -0
- package/dist/bin/chunks/chunk-EQOXJHK3.js +2 -0
- package/dist/bin/chunks/chunk-EYZ62W3A.js +8 -0
- package/dist/bin/chunks/chunk-FHWRQZ3L.js +9 -0
- package/dist/bin/chunks/chunk-FUPQF256.js +10 -0
- package/dist/bin/chunks/chunk-GNVKOWAD.js +7 -0
- package/dist/bin/chunks/chunk-GZGWA6JM.js +3 -0
- package/dist/bin/chunks/chunk-HMHPYX5K.js +9 -0
- package/dist/bin/chunks/chunk-IA7QY73Z.js +9 -0
- package/dist/bin/chunks/chunk-J7ARATA6.js +4 -0
- package/dist/bin/chunks/chunk-JGKR7YR7.js +2 -0
- package/dist/bin/chunks/chunk-JILAHEMU.js +2 -0
- package/dist/bin/chunks/chunk-JKVUWQVK.js +12 -0
- package/dist/bin/chunks/chunk-JVUFZWPW.js +3 -0
- package/dist/bin/chunks/chunk-JYZZJOWW.js +2 -0
- package/dist/bin/chunks/chunk-KSXVXC3N.js +2 -0
- package/dist/bin/chunks/chunk-KTGY5SRV.js +2 -0
- package/dist/bin/chunks/chunk-KTZIEG4R.js +13 -0
- package/dist/bin/chunks/chunk-LNAXROAQ.js +5 -0
- package/dist/bin/chunks/chunk-LV3CC7SU.js +7 -0
- package/dist/bin/chunks/chunk-LVWII44I.js +23 -0
- package/dist/bin/chunks/chunk-LZC6DGAO.js +8 -0
- package/dist/bin/chunks/chunk-M3JG3HYB.js +14 -0
- package/dist/bin/chunks/chunk-MJODCFGH.js +140 -0
- package/dist/bin/chunks/chunk-MJTA3OJF.js +7 -0
- package/dist/bin/chunks/chunk-N7YAMUQG.js +34 -0
- package/dist/bin/chunks/chunk-OF45CXLB.js +2 -0
- package/dist/bin/chunks/chunk-PAD6GYRH.js +5 -0
- package/dist/bin/chunks/chunk-PJ7H3LY6.js +8 -0
- package/dist/bin/chunks/chunk-QD4WQ5KK.js +17 -0
- package/dist/bin/chunks/chunk-R2BBWDS3.js +2 -0
- package/dist/bin/chunks/chunk-SIDKYUUQ.js +7 -0
- package/dist/bin/chunks/chunk-TDOAJ4YU.js +3 -0
- package/dist/bin/chunks/chunk-U34CFKX2.js +13 -0
- package/dist/bin/chunks/chunk-U7TJRQHK.js +16 -0
- package/dist/bin/chunks/chunk-UIRJNX5Z.js +2 -0
- package/dist/bin/chunks/chunk-UKL6PNC2.js +63 -0
- package/dist/bin/chunks/chunk-UN3P7MOR.js +16 -0
- package/dist/bin/chunks/chunk-UQKQCSRP.js +16 -0
- package/dist/bin/chunks/chunk-UYAEZFQS.js +100 -0
- package/dist/bin/chunks/chunk-V7OGIT4K.js +3 -0
- package/dist/bin/chunks/chunk-VK4UPKZF.js +3 -0
- package/dist/bin/chunks/chunk-VUUGFF6A.js +9 -0
- package/dist/bin/chunks/chunk-WATFCWHB.js +12 -0
- package/dist/bin/chunks/chunk-WIJCOCAS.js +9 -0
- package/dist/bin/chunks/chunk-XSCMU2VT.js +19 -0
- package/dist/bin/chunks/chunk-XWJ3KFMY.js +287 -0
- package/dist/bin/chunks/chunk-Y6NUYQQX.js +84 -0
- package/dist/bin/chunks/chunk-YLIFZDMR.js +9 -0
- package/dist/bin/chunks/chunk-YQFW27YU.js +33 -0
- package/dist/bin/chunks/chunk-YXVJUBRG.js +5 -0
- package/dist/bin/chunks/chunk-Z6BNZUNQ.js +32 -0
- package/dist/bin/chunks/chunk-ZLGIFJBA.js +5 -0
- package/dist/bin/chunks/chunk-ZMMCLDDP.js +2 -0
- package/dist/bin/chunks/clear-FZZM6QD2.js +2 -0
- package/dist/bin/chunks/column-UCIEGSHJ.js +2 -0
- package/dist/bin/chunks/comm-WKYJTISA.js +2 -0
- package/dist/bin/chunks/cp-YSXTOMBS.js +2 -0
- package/dist/bin/chunks/curl-YFYJ2XNC.js +26 -0
- package/dist/bin/chunks/cut-2MSOLU4C.js +2 -0
- package/dist/bin/chunks/date-5LA42436.js +2 -0
- package/dist/bin/chunks/diff-4PEKV4XS.js +2 -0
- package/dist/bin/chunks/dirname-XXQNLCA4.js +2 -0
- package/dist/bin/chunks/du-IKBAW7PG.js +2 -0
- package/dist/bin/chunks/echo-DHVSEP57.js +2 -0
- package/dist/bin/chunks/env-A43LGO53.js +2 -0
- package/dist/bin/chunks/expand-L4NT2YFK.js +2 -0
- package/dist/bin/chunks/expansion-IB7ZIBIF.js +2 -0
- package/dist/bin/chunks/expr-BGBONRHV.js +2 -0
- package/dist/bin/chunks/file-DZRWWDPH.js +2 -0
- package/dist/bin/chunks/find-B6JV4QSG.js +2 -0
- package/dist/bin/chunks/flag-coverage-FTS7XXHM.js +2 -0
- package/dist/bin/chunks/fold-OVU7UR2E.js +2 -0
- package/dist/bin/chunks/grep-RG26XCUN.js +2 -0
- package/dist/bin/chunks/gzip-XZZL25AV.js +2 -0
- package/dist/bin/chunks/head-HT46A7YT.js +2 -0
- package/dist/bin/chunks/help-AOETY73Q.js +2 -0
- package/dist/bin/chunks/history-WO6CMWMT.js +2 -0
- package/dist/bin/chunks/hostname-4O6NEPL2.js +2 -0
- package/dist/bin/chunks/html-to-markdown-34LV4LFQ.js +2 -0
- package/dist/bin/chunks/join-6M3ARIFB.js +2 -0
- package/dist/bin/chunks/jq-HP7VLWBL.js +2 -0
- package/dist/bin/chunks/ln-2OLFXJYU.js +2 -0
- package/dist/bin/chunks/ls-LBW3TTPI.js +2 -0
- package/dist/bin/chunks/md5sum-GAWU76ZU.js +2 -0
- package/dist/bin/chunks/mkdir-UUOVKGHS.js +2 -0
- package/dist/bin/chunks/mv-7VY5OVAU.js +2 -0
- package/dist/bin/chunks/nl-34JIXDXD.js +2 -0
- package/dist/bin/chunks/od-IGVFBAFH.js +2 -0
- package/dist/bin/chunks/paste-Q23K6FU7.js +2 -0
- package/dist/bin/chunks/printf-CVEJOTYB.js +2 -0
- package/dist/bin/chunks/pwd-6OLMY3MQ.js +2 -0
- package/dist/bin/chunks/python3-VZL5HRHR.js +14 -0
- package/dist/bin/chunks/readlink-T4CDCG4Z.js +2 -0
- package/dist/bin/chunks/rev-O3PQMT23.js +2 -0
- package/dist/bin/chunks/rg-PQP4HTR3.js +2 -0
- package/dist/bin/chunks/rm-UMIY7ESO.js +2 -0
- package/dist/bin/chunks/rmdir-NJCSEPRP.js +2 -0
- package/dist/bin/chunks/sed-BZW7POX3.js +2 -0
- package/dist/bin/chunks/seq-3FRPQG5E.js +2 -0
- package/dist/bin/chunks/sha1sum-AOZWHFTU.js +2 -0
- package/dist/bin/chunks/sha256sum-EXJTAPU4.js +2 -0
- package/dist/bin/chunks/sleep-HDMKKRCV.js +2 -0
- package/dist/bin/chunks/sort-TO3IPXI2.js +2 -0
- package/dist/bin/chunks/split-JXCUP73P.js +2 -0
- package/dist/bin/chunks/sqlite3-K7LHCU76.js +2 -0
- package/dist/bin/chunks/stat-J5TUE4U5.js +2 -0
- package/dist/bin/chunks/strings-TDUSHGAB.js +2 -0
- package/dist/bin/chunks/tac-QXOHN3J4.js +2 -0
- package/dist/bin/chunks/tail-LOVA3SKT.js +2 -0
- package/dist/bin/chunks/tar-BAKR5OJO.js +2 -0
- package/dist/bin/chunks/tee-SREYEKO6.js +2 -0
- package/dist/bin/chunks/time-GS6SIFPK.js +2 -0
- package/dist/bin/chunks/timeout-XBYZ5LW5.js +2 -0
- package/dist/bin/chunks/touch-4ZSEFYEW.js +2 -0
- package/dist/bin/chunks/tr-ARR7JBLN.js +2 -0
- package/dist/bin/chunks/tree-7Y7H64VI.js +2 -0
- package/dist/bin/chunks/true-CKHNKYAT.js +2 -0
- package/dist/bin/chunks/unexpand-B4WHWJHL.js +2 -0
- package/dist/bin/chunks/uniq-I2KNCRR6.js +2 -0
- package/dist/bin/chunks/wc-TDIG4RIU.js +2 -0
- package/dist/bin/chunks/which-QMZ276XE.js +2 -0
- package/dist/bin/chunks/whoami-XYB47VCX.js +2 -0
- package/dist/bin/chunks/xan-STBKXZ5W.js +2 -0
- package/dist/bin/chunks/xan-view-BIT4WIPP.js +2 -0
- package/dist/bin/chunks/xargs-6K57XYD6.js +2 -0
- package/dist/bin/chunks/yes-7ZGUE2PX.js +2 -0
- package/dist/bin/chunks/yq-ZHYSTGN3.js +2 -0
- package/dist/bin/just-bash.js +320 -303
- package/dist/bin/shell/chunks/alias-MILMQPGR.js +2 -0
- package/dist/bin/shell/chunks/awk2-FB5MXVFV.js +2 -0
- package/dist/bin/shell/chunks/base64-NGAPXZAM.js +2 -0
- package/dist/bin/shell/chunks/basename-ZFBDKUVW.js +2 -0
- package/dist/bin/shell/chunks/bash-FQY3C37R.js +2 -0
- package/dist/bin/shell/chunks/cat-UO3ZDQHP.js +2 -0
- package/dist/bin/shell/chunks/chmod-GYXHDITN.js +2 -0
- package/dist/bin/shell/chunks/chunk-2FWUPGJH.js +6 -0
- package/dist/bin/shell/chunks/chunk-2JQKBSIH.js +14 -0
- package/dist/bin/shell/chunks/chunk-2MX7URRE.js +10 -0
- package/dist/bin/shell/chunks/chunk-3G7ONQFJ.js +11 -0
- package/dist/bin/shell/chunks/chunk-3KKXX5QY.js +13 -0
- package/dist/bin/shell/chunks/chunk-3SWITKTS.js +7 -0
- package/dist/bin/shell/chunks/chunk-3V7N5SEN.js +9 -0
- package/dist/bin/shell/chunks/chunk-45S6IACR.js +3 -0
- package/dist/bin/shell/chunks/chunk-4PDI7A54.js +20 -0
- package/dist/bin/shell/chunks/chunk-532RLOPK.js +14 -0
- package/dist/bin/shell/chunks/chunk-5B4HIQFQ.js +7 -0
- package/dist/bin/shell/chunks/chunk-5CTS5L3T.js +18 -0
- package/dist/bin/shell/chunks/chunk-5RANCCE2.js +6 -0
- package/dist/bin/shell/chunks/chunk-63FHXCEF.js +4 -0
- package/dist/bin/shell/chunks/chunk-64ICY43M.js +8 -0
- package/dist/bin/shell/chunks/chunk-6MJ6NBIG.js +8 -0
- package/dist/bin/shell/chunks/chunk-6N6IRP6G.js +6 -0
- package/dist/bin/shell/chunks/chunk-6VQWCKYE.js +2 -0
- package/dist/bin/shell/chunks/chunk-6WKRPHAZ.js +36 -0
- package/dist/bin/shell/chunks/chunk-73X3QWRT.js +80 -0
- package/dist/bin/shell/chunks/chunk-7FCHB2LT.js +14 -0
- package/dist/bin/shell/chunks/chunk-7FGPQVVJ.js +12 -0
- package/dist/bin/shell/chunks/chunk-7FUCLMNU.js +7 -0
- package/dist/bin/shell/chunks/chunk-7LGOLTRR.js +5 -0
- package/dist/bin/shell/chunks/chunk-7POGKC42.js +11 -0
- package/dist/bin/shell/chunks/chunk-A257OMG4.js +2 -0
- package/dist/bin/shell/chunks/chunk-BH4O34VZ.js +26 -0
- package/dist/bin/shell/chunks/chunk-BTCJZ7OY.js +10 -0
- package/dist/bin/shell/chunks/chunk-CEU7KGBV.js +24 -0
- package/dist/bin/shell/chunks/chunk-COM2NIBS.js +3 -0
- package/dist/bin/shell/chunks/chunk-CXEBUGVP.js +7 -0
- package/dist/bin/shell/chunks/chunk-CY4RP66Q.js +21 -0
- package/dist/bin/shell/chunks/chunk-DM55Q4EM.js +5 -0
- package/dist/bin/shell/chunks/chunk-DUBCYODB.js +11 -0
- package/dist/bin/shell/chunks/chunk-DUPNDZ3H.js +6 -0
- package/dist/bin/shell/chunks/chunk-EKD22SYR.js +23 -0
- package/dist/bin/shell/chunks/chunk-EOMAF5KQ.js +6 -0
- package/dist/bin/shell/chunks/chunk-EQOXJHK3.js +2 -0
- package/dist/bin/shell/chunks/chunk-EYZ62W3A.js +8 -0
- package/dist/bin/shell/chunks/chunk-FHWRQZ3L.js +9 -0
- package/dist/bin/shell/chunks/chunk-FUPQF256.js +10 -0
- package/dist/bin/shell/chunks/chunk-GNVKOWAD.js +7 -0
- package/dist/bin/shell/chunks/chunk-GZGWA6JM.js +3 -0
- package/dist/bin/shell/chunks/chunk-HMHPYX5K.js +9 -0
- package/dist/bin/shell/chunks/chunk-IA7QY73Z.js +9 -0
- package/dist/bin/shell/chunks/chunk-J7ARATA6.js +4 -0
- package/dist/bin/shell/chunks/chunk-JGKR7YR7.js +2 -0
- package/dist/bin/shell/chunks/chunk-JILAHEMU.js +2 -0
- package/dist/bin/shell/chunks/chunk-JKVUWQVK.js +12 -0
- package/dist/bin/shell/chunks/chunk-JVUFZWPW.js +3 -0
- package/dist/bin/shell/chunks/chunk-JYZZJOWW.js +2 -0
- package/dist/bin/shell/chunks/chunk-KSXVXC3N.js +2 -0
- package/dist/bin/shell/chunks/chunk-KTGY5SRV.js +2 -0
- package/dist/bin/shell/chunks/chunk-KTZIEG4R.js +13 -0
- package/dist/bin/shell/chunks/chunk-LNAXROAQ.js +5 -0
- package/dist/bin/shell/chunks/chunk-LV3CC7SU.js +7 -0
- package/dist/bin/shell/chunks/chunk-LVWII44I.js +23 -0
- package/dist/bin/shell/chunks/chunk-LZC6DGAO.js +8 -0
- package/dist/bin/shell/chunks/chunk-M3JG3HYB.js +14 -0
- package/dist/bin/shell/chunks/chunk-MJODCFGH.js +140 -0
- package/dist/bin/shell/chunks/chunk-MJTA3OJF.js +7 -0
- package/dist/bin/shell/chunks/chunk-N7YAMUQG.js +34 -0
- package/dist/bin/shell/chunks/chunk-OF45CXLB.js +2 -0
- package/dist/bin/shell/chunks/chunk-PAD6GYRH.js +5 -0
- package/dist/bin/shell/chunks/chunk-PJ7H3LY6.js +8 -0
- package/dist/bin/shell/chunks/chunk-QD4WQ5KK.js +17 -0
- package/dist/bin/shell/chunks/chunk-R2BBWDS3.js +2 -0
- package/dist/bin/shell/chunks/chunk-SIDKYUUQ.js +7 -0
- package/dist/bin/shell/chunks/chunk-TDOAJ4YU.js +3 -0
- package/dist/bin/shell/chunks/chunk-U34CFKX2.js +13 -0
- package/dist/bin/shell/chunks/chunk-U7TJRQHK.js +16 -0
- package/dist/bin/shell/chunks/chunk-UIRJNX5Z.js +2 -0
- package/dist/bin/shell/chunks/chunk-UKL6PNC2.js +63 -0
- package/dist/bin/shell/chunks/chunk-UN3P7MOR.js +16 -0
- package/dist/bin/shell/chunks/chunk-UQKQCSRP.js +16 -0
- package/dist/bin/shell/chunks/chunk-UYAEZFQS.js +100 -0
- package/dist/bin/shell/chunks/chunk-V7OGIT4K.js +3 -0
- package/dist/bin/shell/chunks/chunk-VK4UPKZF.js +3 -0
- package/dist/bin/shell/chunks/chunk-VUUGFF6A.js +9 -0
- package/dist/bin/shell/chunks/chunk-WATFCWHB.js +12 -0
- package/dist/bin/shell/chunks/chunk-WIJCOCAS.js +9 -0
- package/dist/bin/shell/chunks/chunk-XSCMU2VT.js +19 -0
- package/dist/bin/shell/chunks/chunk-XWJ3KFMY.js +287 -0
- package/dist/bin/shell/chunks/chunk-Y6NUYQQX.js +84 -0
- package/dist/bin/shell/chunks/chunk-YLIFZDMR.js +9 -0
- package/dist/bin/shell/chunks/chunk-YQFW27YU.js +33 -0
- package/dist/bin/shell/chunks/chunk-YXVJUBRG.js +5 -0
- package/dist/bin/shell/chunks/chunk-Z6BNZUNQ.js +32 -0
- package/dist/bin/shell/chunks/chunk-ZLGIFJBA.js +5 -0
- package/dist/bin/shell/chunks/chunk-ZMMCLDDP.js +2 -0
- package/dist/bin/shell/chunks/clear-FZZM6QD2.js +2 -0
- package/dist/bin/shell/chunks/column-UCIEGSHJ.js +2 -0
- package/dist/bin/shell/chunks/comm-WKYJTISA.js +2 -0
- package/dist/bin/shell/chunks/cp-YSXTOMBS.js +2 -0
- package/dist/bin/shell/chunks/curl-YFYJ2XNC.js +26 -0
- package/dist/bin/shell/chunks/cut-2MSOLU4C.js +2 -0
- package/dist/bin/shell/chunks/date-5LA42436.js +2 -0
- package/dist/bin/shell/chunks/diff-4PEKV4XS.js +2 -0
- package/dist/bin/shell/chunks/dirname-XXQNLCA4.js +2 -0
- package/dist/bin/shell/chunks/du-IKBAW7PG.js +2 -0
- package/dist/bin/shell/chunks/echo-DHVSEP57.js +2 -0
- package/dist/bin/shell/chunks/env-A43LGO53.js +2 -0
- package/dist/bin/shell/chunks/expand-L4NT2YFK.js +2 -0
- package/dist/bin/shell/chunks/expansion-IB7ZIBIF.js +2 -0
- package/dist/bin/shell/chunks/expr-BGBONRHV.js +2 -0
- package/dist/bin/shell/chunks/file-DZRWWDPH.js +2 -0
- package/dist/bin/shell/chunks/find-B6JV4QSG.js +2 -0
- package/dist/bin/shell/chunks/flag-coverage-FTS7XXHM.js +2 -0
- package/dist/bin/shell/chunks/fold-OVU7UR2E.js +2 -0
- package/dist/bin/shell/chunks/grep-RG26XCUN.js +2 -0
- package/dist/bin/shell/chunks/gzip-XZZL25AV.js +2 -0
- package/dist/bin/shell/chunks/head-HT46A7YT.js +2 -0
- package/dist/bin/shell/chunks/help-AOETY73Q.js +2 -0
- package/dist/bin/shell/chunks/history-WO6CMWMT.js +2 -0
- package/dist/bin/shell/chunks/hostname-4O6NEPL2.js +2 -0
- package/dist/bin/shell/chunks/html-to-markdown-34LV4LFQ.js +2 -0
- package/dist/bin/shell/chunks/join-6M3ARIFB.js +2 -0
- package/dist/bin/shell/chunks/jq-HP7VLWBL.js +2 -0
- package/dist/bin/shell/chunks/ln-2OLFXJYU.js +2 -0
- package/dist/bin/shell/chunks/ls-LBW3TTPI.js +2 -0
- package/dist/bin/shell/chunks/md5sum-GAWU76ZU.js +2 -0
- package/dist/bin/shell/chunks/mkdir-UUOVKGHS.js +2 -0
- package/dist/bin/shell/chunks/mv-7VY5OVAU.js +2 -0
- package/dist/bin/shell/chunks/nl-34JIXDXD.js +2 -0
- package/dist/bin/shell/chunks/od-IGVFBAFH.js +2 -0
- package/dist/bin/shell/chunks/paste-Q23K6FU7.js +2 -0
- package/dist/bin/shell/chunks/printf-CVEJOTYB.js +2 -0
- package/dist/bin/shell/chunks/pwd-6OLMY3MQ.js +2 -0
- package/dist/bin/shell/chunks/python3-VZL5HRHR.js +14 -0
- package/dist/bin/shell/chunks/readlink-T4CDCG4Z.js +2 -0
- package/dist/bin/shell/chunks/rev-O3PQMT23.js +2 -0
- package/dist/bin/shell/chunks/rg-PQP4HTR3.js +2 -0
- package/dist/bin/shell/chunks/rm-UMIY7ESO.js +2 -0
- package/dist/bin/shell/chunks/rmdir-NJCSEPRP.js +2 -0
- package/dist/bin/shell/chunks/sed-BZW7POX3.js +2 -0
- package/dist/bin/shell/chunks/seq-3FRPQG5E.js +2 -0
- package/dist/bin/shell/chunks/sha1sum-AOZWHFTU.js +2 -0
- package/dist/bin/shell/chunks/sha256sum-EXJTAPU4.js +2 -0
- package/dist/bin/shell/chunks/sleep-HDMKKRCV.js +2 -0
- package/dist/bin/shell/chunks/sort-TO3IPXI2.js +2 -0
- package/dist/bin/shell/chunks/split-JXCUP73P.js +2 -0
- package/dist/bin/shell/chunks/sqlite3-K7LHCU76.js +2 -0
- package/dist/bin/shell/chunks/stat-J5TUE4U5.js +2 -0
- package/dist/bin/shell/chunks/strings-TDUSHGAB.js +2 -0
- package/dist/bin/shell/chunks/tac-QXOHN3J4.js +2 -0
- package/dist/bin/shell/chunks/tail-LOVA3SKT.js +2 -0
- package/dist/bin/shell/chunks/tar-BAKR5OJO.js +2 -0
- package/dist/bin/shell/chunks/tee-SREYEKO6.js +2 -0
- package/dist/bin/shell/chunks/time-GS6SIFPK.js +2 -0
- package/dist/bin/shell/chunks/timeout-XBYZ5LW5.js +2 -0
- package/dist/bin/shell/chunks/touch-4ZSEFYEW.js +2 -0
- package/dist/bin/shell/chunks/tr-ARR7JBLN.js +2 -0
- package/dist/bin/shell/chunks/tree-7Y7H64VI.js +2 -0
- package/dist/bin/shell/chunks/true-CKHNKYAT.js +2 -0
- package/dist/bin/shell/chunks/unexpand-B4WHWJHL.js +2 -0
- package/dist/bin/shell/chunks/uniq-I2KNCRR6.js +2 -0
- package/dist/bin/shell/chunks/wc-TDIG4RIU.js +2 -0
- package/dist/bin/shell/chunks/which-QMZ276XE.js +2 -0
- package/dist/bin/shell/chunks/whoami-XYB47VCX.js +2 -0
- package/dist/bin/shell/chunks/xan-STBKXZ5W.js +2 -0
- package/dist/bin/shell/chunks/xan-view-BIT4WIPP.js +2 -0
- package/dist/bin/shell/chunks/xargs-6K57XYD6.js +2 -0
- package/dist/bin/shell/chunks/yes-7ZGUE2PX.js +2 -0
- package/dist/bin/shell/chunks/yq-ZHYSTGN3.js +2 -0
- package/dist/bin/shell/shell.js +325 -308
- package/dist/browser.d.ts +4 -0
- package/dist/bundle/browser.js +875 -854
- package/dist/bundle/chunks/alias-CIPN5HGG.js +1 -0
- package/dist/bundle/chunks/awk2-RAKURI6M.js +1 -0
- package/dist/bundle/chunks/base64-4GSA7KNI.js +1 -0
- package/dist/bundle/chunks/basename-Q7SIX77Q.js +1 -0
- package/dist/bundle/chunks/bash-HKSQMKKV.js +1 -0
- package/dist/bundle/chunks/cat-L3YELBYM.js +1 -0
- package/dist/bundle/chunks/chmod-IJMA7OGQ.js +1 -0
- package/dist/bundle/chunks/chunk-23R5HQHH.js +22 -0
- package/dist/bundle/chunks/chunk-2C5744E3.js +16 -0
- package/dist/bundle/chunks/chunk-2UAAXNHX.js +1 -0
- package/dist/bundle/chunks/chunk-3JEPB2CL.js +10 -0
- package/dist/bundle/chunks/chunk-4NRX5HFD.js +2 -0
- package/dist/bundle/chunks/chunk-4YUPFOYA.js +1 -0
- package/dist/bundle/chunks/chunk-5JHQRYUS.js +5 -0
- package/dist/bundle/chunks/chunk-6B44NYQO.js +8 -0
- package/dist/bundle/chunks/chunk-6D5UCV65.js +23 -0
- package/dist/bundle/chunks/chunk-6TAOLIZ7.js +13 -0
- package/dist/bundle/chunks/chunk-734O2UB7.js +9 -0
- package/dist/bundle/chunks/chunk-7B7AWU7X.js +2 -0
- package/dist/bundle/chunks/chunk-7KFBK6FW.js +1 -0
- package/dist/bundle/chunks/chunk-7ROHLV74.js +31 -0
- package/dist/bundle/chunks/chunk-7SQ2RTI2.js +139 -0
- package/dist/bundle/chunks/chunk-7UPROJVF.js +4 -0
- package/dist/bundle/chunks/chunk-7Z65ZFBM.js +10 -0
- package/dist/bundle/chunks/chunk-A5FEGJHF.js +4 -0
- package/dist/bundle/chunks/chunk-AAVEDJ2B.js +4 -0
- package/dist/bundle/chunks/chunk-AFEP7ZTB.js +4 -0
- package/dist/bundle/chunks/chunk-ALZ5CSTK.js +9 -0
- package/dist/bundle/chunks/chunk-ANMMLK7G.js +2 -0
- package/dist/bundle/chunks/chunk-AXMBAF6A.js +5 -0
- package/dist/bundle/chunks/chunk-BX5K34KY.js +1 -0
- package/dist/bundle/chunks/chunk-BZXBFTL2.js +4 -0
- package/dist/bundle/chunks/chunk-C4UC4TPC.js +8 -0
- package/dist/bundle/chunks/chunk-CNBBFQPC.js +1 -0
- package/dist/bundle/chunks/chunk-CVM2MFM3.js +2 -0
- package/dist/bundle/chunks/chunk-DL5GRV7N.js +5 -0
- package/dist/bundle/chunks/chunk-DS5ORKKQ.js +3 -0
- package/dist/bundle/chunks/chunk-ESLB4XKL.js +15 -0
- package/dist/bundle/chunks/chunk-FPJIAK37.js +8 -0
- package/dist/bundle/chunks/chunk-GBVVD7OP.js +12 -0
- package/dist/bundle/chunks/chunk-GJQGDOOO.js +8 -0
- package/dist/bundle/chunks/chunk-GZRZD5YF.js +4 -0
- package/dist/bundle/chunks/chunk-HDHI347R.js +6 -0
- package/dist/bundle/chunks/chunk-HKMBFRTV.js +2 -0
- package/dist/bundle/chunks/chunk-HMRLLHZE.js +7 -0
- package/dist/bundle/chunks/chunk-HVMFTOQY.js +1 -0
- package/dist/bundle/chunks/chunk-IVTIGXSE.js +11 -0
- package/dist/bundle/chunks/chunk-IXPY5PYY.js +13 -0
- package/dist/bundle/chunks/chunk-J2BTXVXN.js +6 -0
- package/dist/bundle/chunks/chunk-J2GAF4HH.js +15 -0
- package/dist/bundle/chunks/chunk-JJXSCNTG.js +5 -0
- package/dist/bundle/chunks/chunk-JZLKE4XX.js +23 -0
- package/dist/bundle/chunks/chunk-KL7SL7ES.js +1 -0
- package/dist/bundle/chunks/chunk-KLSVVM53.js +6 -0
- package/dist/bundle/chunks/chunk-KMDWD5I5.js +8 -0
- package/dist/bundle/chunks/chunk-KMFEA7OG.js +2 -0
- package/dist/bundle/chunks/chunk-KXZALX7Z.js +7 -0
- package/dist/bundle/chunks/chunk-MQY52TBM.js +7 -0
- package/dist/bundle/chunks/chunk-N552BMHP.js +1 -0
- package/dist/bundle/chunks/chunk-NCNBSBGV.js +286 -0
- package/dist/bundle/chunks/chunk-OBYDR4XV.js +4 -0
- package/dist/bundle/chunks/chunk-OGUNWUEY.js +17 -0
- package/dist/bundle/chunks/chunk-ORNEVHL4.js +99 -0
- package/dist/bundle/chunks/chunk-P3THD7GM.js +6 -0
- package/dist/bundle/chunks/chunk-PEEBONF2.js +2 -0
- package/dist/bundle/chunks/chunk-PMGKXEU7.js +13 -0
- package/dist/bundle/chunks/chunk-PVCFRKJJ.js +13 -0
- package/dist/bundle/chunks/chunk-QFO6LPNQ.js +7 -0
- package/dist/bundle/chunks/chunk-QMUDG3KU.js +12 -0
- package/dist/bundle/chunks/chunk-QWZOR6OX.js +5 -0
- package/dist/bundle/chunks/chunk-R42D4RK2.js +15 -0
- package/dist/bundle/chunks/chunk-S6UKQQAB.js +79 -0
- package/dist/bundle/chunks/chunk-SRQ7BXVR.js +1 -0
- package/dist/bundle/chunks/chunk-SXA5BV42.js +20 -0
- package/dist/bundle/chunks/chunk-TL7ILCBE.js +6 -0
- package/dist/bundle/chunks/chunk-TMW4OG4N.js +6 -0
- package/dist/bundle/chunks/chunk-UPLN3OMW.js +11 -0
- package/dist/bundle/chunks/chunk-UPUUONKD.js +6 -0
- package/dist/bundle/chunks/chunk-USPQ6LOW.js +10 -0
- package/dist/bundle/chunks/chunk-UY2R54E5.js +8 -0
- package/dist/bundle/chunks/chunk-V6WGFVZA.js +6 -0
- package/dist/bundle/chunks/chunk-VAEB4OUK.js +1 -0
- package/dist/bundle/chunks/chunk-VEE747JZ.js +6 -0
- package/dist/bundle/chunks/chunk-WBPZNWSY.js +35 -0
- package/dist/bundle/chunks/chunk-WPPIJX5K.js +22 -0
- package/dist/bundle/chunks/chunk-X7M472ST.js +32 -0
- package/dist/bundle/chunks/chunk-XAYT3L2B.js +1 -0
- package/dist/bundle/chunks/chunk-XCI3COKM.js +12 -0
- package/dist/bundle/chunks/chunk-XDY76TEA.js +19 -0
- package/dist/bundle/chunks/chunk-XEKBP4I4.js +62 -0
- package/dist/bundle/chunks/chunk-XGMYS2QC.js +3 -0
- package/dist/bundle/chunks/chunk-XYWNAVNS.js +33 -0
- package/dist/bundle/chunks/chunk-YIIBJSJS.js +11 -0
- package/dist/bundle/chunks/chunk-YMPJSDL2.js +7 -0
- package/dist/bundle/chunks/chunk-YU2FN4NA.js +8 -0
- package/dist/bundle/chunks/chunk-YZSDCIXP.js +9 -0
- package/dist/bundle/chunks/chunk-ZLBJV2VD.js +1 -0
- package/dist/bundle/chunks/clear-J6WBUIX6.js +1 -0
- package/dist/bundle/chunks/column-N7MHP5SX.js +1 -0
- package/dist/bundle/chunks/comm-X7VETT2U.js +1 -0
- package/dist/bundle/chunks/cp-73PGBEPL.js +1 -0
- package/dist/bundle/chunks/curl-MGBYKD7U.js +25 -0
- package/dist/bundle/chunks/cut-7I6UA67F.js +1 -0
- package/dist/bundle/chunks/date-MOZRIQXR.js +1 -0
- package/dist/bundle/chunks/diff-O5NFSBS5.js +1 -0
- package/dist/bundle/chunks/dirname-2TM4IG7K.js +1 -0
- package/dist/bundle/chunks/du-KTUJVIGD.js +1 -0
- package/dist/bundle/chunks/echo-PC3TVS6B.js +1 -0
- package/dist/bundle/chunks/env-MFQH47JH.js +1 -0
- package/dist/bundle/chunks/expand-OYPZZOZC.js +1 -0
- package/dist/bundle/chunks/expansion-QM4WQBBG.js +1 -0
- package/dist/bundle/chunks/expr-4PIUWNB7.js +1 -0
- package/dist/bundle/chunks/file-DZRW6GNH.js +1 -0
- package/dist/bundle/chunks/find-DESNHKKS.js +1 -0
- package/dist/bundle/chunks/flag-coverage-QMBN7WOW.js +1 -0
- package/dist/bundle/chunks/fold-5VRJN4CL.js +1 -0
- package/dist/bundle/chunks/grep-7RC5DPOS.js +1 -0
- package/dist/bundle/chunks/gzip-WH2JWAWT.js +1 -0
- package/dist/bundle/chunks/head-EFRLGDOE.js +1 -0
- package/dist/bundle/chunks/help-3XYFOR43.js +1 -0
- package/dist/bundle/chunks/history-J3C24VIU.js +1 -0
- package/dist/bundle/chunks/hostname-D54LLZ5I.js +1 -0
- package/dist/bundle/chunks/html-to-markdown-TFBDHAZZ.js +1 -0
- package/dist/bundle/chunks/join-36QXZEGR.js +1 -0
- package/dist/bundle/chunks/jq-5KN27BBY.js +1 -0
- package/dist/bundle/chunks/ln-SHI7B5FY.js +1 -0
- package/dist/bundle/chunks/ls-7JNJXADY.js +1 -0
- package/dist/bundle/chunks/md5sum-J7XPNTQZ.js +1 -0
- package/dist/bundle/chunks/mkdir-NM4BUUUC.js +1 -0
- package/dist/bundle/chunks/mv-VDGF4VTT.js +1 -0
- package/dist/bundle/chunks/nl-PD7BPFUB.js +1 -0
- package/dist/bundle/chunks/od-D6RO3GJE.js +1 -0
- package/dist/bundle/chunks/paste-HD4NKO4X.js +1 -0
- package/dist/bundle/chunks/printf-6XMXHDAE.js +1 -0
- package/dist/bundle/chunks/pwd-KKLARPNT.js +1 -0
- package/dist/bundle/chunks/python3-KPG6SQQV.js +13 -0
- package/dist/bundle/chunks/readlink-6XCFQQJH.js +1 -0
- package/dist/bundle/chunks/rev-NJ2ZPNAT.js +1 -0
- package/dist/bundle/chunks/rg-NIW2Q5SV.js +1 -0
- package/dist/bundle/chunks/rm-7ERREV4V.js +1 -0
- package/dist/bundle/chunks/rmdir-Z4ZRV32S.js +1 -0
- package/dist/bundle/chunks/sed-VLSHT4XR.js +1 -0
- package/dist/bundle/chunks/seq-RCBD3IYO.js +1 -0
- package/dist/bundle/chunks/sha1sum-RMRQ75AE.js +1 -0
- package/dist/bundle/chunks/sha256sum-TGW5BMJR.js +1 -0
- package/dist/bundle/chunks/sleep-SAQIXUFW.js +1 -0
- package/dist/bundle/chunks/sort-KCG2A34N.js +1 -0
- package/dist/bundle/chunks/split-EVSSQ6VR.js +1 -0
- package/dist/bundle/chunks/sqlite3-M6BXLMYI.js +1 -0
- package/dist/bundle/chunks/stat-Z22X56GM.js +1 -0
- package/dist/bundle/chunks/strings-EKWOLUFJ.js +1 -0
- package/dist/bundle/chunks/tac-RSIVIUEI.js +1 -0
- package/dist/bundle/chunks/tail-TULUAGKH.js +1 -0
- package/dist/bundle/chunks/tar-KQPQPRTZ.js +1 -0
- package/dist/bundle/chunks/tee-DPV6AVMH.js +1 -0
- package/dist/bundle/chunks/time-RXWT5RNC.js +1 -0
- package/dist/bundle/chunks/timeout-YRSN3MWF.js +1 -0
- package/dist/bundle/chunks/touch-PC42E2OS.js +1 -0
- package/dist/bundle/chunks/tr-F7JZV44S.js +1 -0
- package/dist/bundle/chunks/tree-SVRMFKLQ.js +1 -0
- package/dist/bundle/chunks/true-T4XKISHJ.js +1 -0
- package/dist/bundle/chunks/unexpand-KAIAW5TX.js +1 -0
- package/dist/bundle/chunks/uniq-7HD4DCMD.js +1 -0
- package/dist/bundle/chunks/wc-U424DF7O.js +1 -0
- package/dist/bundle/chunks/which-OY73BBGP.js +1 -0
- package/dist/bundle/chunks/whoami-KUZQQOVR.js +1 -0
- package/dist/bundle/chunks/xan-N66EXZFT.js +1 -0
- package/dist/bundle/chunks/xan-view-RLM3746X.js +1 -0
- package/dist/bundle/chunks/xargs-SWPLSROG.js +1 -0
- package/dist/bundle/chunks/yes-5BWAW2VY.js +1 -0
- package/dist/bundle/chunks/yq-URX6MHLP.js +1 -0
- package/dist/bundle/index.js +313 -296
- package/dist/commands/search-engine/index.d.ts +1 -1
- package/dist/commands/search-engine/stream-matcher.d.ts +13 -0
- package/dist/index.d.ts +4 -0
- package/dist/interpreter/builtins/break.d.ts +1 -1
- package/dist/interpreter/builtins/continue.d.ts +1 -1
- package/dist/interpreter/builtins/exit.d.ts +1 -1
- package/dist/interpreter/builtins/index.d.ts +3 -0
- package/dist/interpreter/builtins/jobs.d.ts +5 -0
- package/dist/interpreter/builtins/kill.d.ts +3 -0
- package/dist/interpreter/builtins/set.d.ts +1 -1
- package/dist/interpreter/builtins/shift.d.ts +1 -1
- package/dist/interpreter/builtins/wait.d.ts +3 -0
- package/dist/interpreter/errors.d.ts +45 -26
- package/dist/interpreter/functions.d.ts +1 -1
- package/dist/interpreter/helpers/condition.d.ts +1 -1
- package/dist/interpreter/helpers/loop.d.ts +1 -6
- package/dist/interpreter/helpers/readonly.d.ts +1 -1
- package/dist/interpreter/helpers/result.d.ts +1 -1
- package/dist/interpreter/helpers/statements.d.ts +2 -5
- package/dist/interpreter/index.d.ts +1 -1
- package/dist/interpreter/interpreter.d.ts +12 -2
- package/dist/interpreter/output-channels.d.ts +50 -0
- package/dist/interpreter/redirect-channels.d.ts +34 -0
- package/dist/interpreter/redirections.d.ts +22 -27
- package/dist/interpreter/types.d.ts +20 -6
- package/dist/limits.d.ts +2 -0
- package/dist/process/process-table.d.ts +92 -0
- package/dist/sandbox/Command.d.ts +15 -2
- package/dist/sandbox/Sandbox.d.ts +5 -0
- package/dist/types.d.ts +13 -1
- package/dist/utils/abort.d.ts +12 -0
- package/dist/utils/stream.d.ts +5 -0
- package/package.json +2 -1
- package/dist/bin/chunks/alias-DRSSCAUM.js +0 -2
- package/dist/bin/chunks/awk2-GM5WBRLU.js +0 -2
- package/dist/bin/chunks/base64-KLZ4B6VS.js +0 -2
- package/dist/bin/chunks/basename-XCXGYZPS.js +0 -2
- package/dist/bin/chunks/bash-U2E2FSIE.js +0 -2
- package/dist/bin/chunks/cat-D4E4FTXJ.js +0 -2
- package/dist/bin/chunks/chmod-OY5CP5QF.js +0 -2
- package/dist/bin/chunks/chunk-23CC4423.js +0 -287
- package/dist/bin/chunks/chunk-23EV7RYO.js +0 -10
- package/dist/bin/chunks/chunk-2IOUIOWE.js +0 -12
- package/dist/bin/chunks/chunk-3IJEW4BN.js +0 -9
- package/dist/bin/chunks/chunk-3VDZW42W.js +0 -5
- package/dist/bin/chunks/chunk-444WPTN5.js +0 -8
- package/dist/bin/chunks/chunk-446TXLPR.js +0 -9
- package/dist/bin/chunks/chunk-44ROJVH3.js +0 -6
- package/dist/bin/chunks/chunk-4VVLCPRH.js +0 -8
- package/dist/bin/chunks/chunk-4W52T6KS.js +0 -63
- package/dist/bin/chunks/chunk-4Y3GINAY.js +0 -33
- package/dist/bin/chunks/chunk-5IL5CXJC.js +0 -3
- package/dist/bin/chunks/chunk-5KQNIOZS.js +0 -84
- package/dist/bin/chunks/chunk-66PXNTAV.js +0 -2
- package/dist/bin/chunks/chunk-67SBKZZD.js +0 -9
- package/dist/bin/chunks/chunk-6U6CK6V4.js +0 -16
- package/dist/bin/chunks/chunk-7J7OY2YE.js +0 -12
- package/dist/bin/chunks/chunk-7VWUKGDV.js +0 -4
- package/dist/bin/chunks/chunk-7YOACDUK.js +0 -140
- package/dist/bin/chunks/chunk-AN2KBMAK.js +0 -12
- package/dist/bin/chunks/chunk-ASU2EQWZ.js +0 -32
- package/dist/bin/chunks/chunk-AZQ66C5R.js +0 -14
- package/dist/bin/chunks/chunk-B4GXMUCA.js +0 -20
- package/dist/bin/chunks/chunk-BXOX2H2G.js +0 -22
- package/dist/bin/chunks/chunk-CD3NCHIB.js +0 -7
- package/dist/bin/chunks/chunk-CE2ILL65.js +0 -9
- package/dist/bin/chunks/chunk-D34QBGQ3.js +0 -7
- package/dist/bin/chunks/chunk-D44C6YVE.js +0 -6
- package/dist/bin/chunks/chunk-DFAHK2EQ.js +0 -23
- package/dist/bin/chunks/chunk-DMTOGHTU.js +0 -6
- package/dist/bin/chunks/chunk-EHJW6FCX.js +0 -36
- package/dist/bin/chunks/chunk-EXCMJ23H.js +0 -100
- package/dist/bin/chunks/chunk-FVFLR7NF.js +0 -21
- package/dist/bin/chunks/chunk-GIFF636B.js +0 -2
- package/dist/bin/chunks/chunk-GIVPKQT5.js +0 -16
- package/dist/bin/chunks/chunk-GUZJZK5O.js +0 -2
- package/dist/bin/chunks/chunk-H7TGYILF.js +0 -3
- package/dist/bin/chunks/chunk-HEO6EBJ2.js +0 -14
- package/dist/bin/chunks/chunk-HY6WUGWS.js +0 -10
- package/dist/bin/chunks/chunk-HZM5PBQF.js +0 -8
- package/dist/bin/chunks/chunk-I2N72LXH.js +0 -9
- package/dist/bin/chunks/chunk-IAUA3FL7.js +0 -8
- package/dist/bin/chunks/chunk-IPWJZ22H.js +0 -14
- package/dist/bin/chunks/chunk-IQY3I4OH.js +0 -2
- package/dist/bin/chunks/chunk-JU5KTPFP.js +0 -17
- package/dist/bin/chunks/chunk-KAWPUEQM.js +0 -3
- package/dist/bin/chunks/chunk-L2KFCEBW.js +0 -13
- package/dist/bin/chunks/chunk-LVSKOXVG.js +0 -5
- package/dist/bin/chunks/chunk-MPX22C7Y.js +0 -5
- package/dist/bin/chunks/chunk-N7P3SUNH.js +0 -6
- package/dist/bin/chunks/chunk-NNVWOCET.js +0 -2
- package/dist/bin/chunks/chunk-NSSLXYEG.js +0 -8
- package/dist/bin/chunks/chunk-OH3VVXF7.js +0 -3
- package/dist/bin/chunks/chunk-PKKBPSVJ.js +0 -7
- package/dist/bin/chunks/chunk-PRQYRYWV.js +0 -3
- package/dist/bin/chunks/chunk-PZ46XEZ4.js +0 -2
- package/dist/bin/chunks/chunk-Q2BKN6MV.js +0 -11
- package/dist/bin/chunks/chunk-QFPJQSDK.js +0 -7
- package/dist/bin/chunks/chunk-QKQUVK53.js +0 -10
- package/dist/bin/chunks/chunk-QXOUI5BS.js +0 -11
- package/dist/bin/chunks/chunk-RAL2LVDX.js +0 -7
- package/dist/bin/chunks/chunk-RAUBS6MJ.js +0 -2
- package/dist/bin/chunks/chunk-RFIBBYTO.js +0 -6
- package/dist/bin/chunks/chunk-RIV3HSPK.js +0 -19
- package/dist/bin/chunks/chunk-RMG637UR.js +0 -26
- package/dist/bin/chunks/chunk-RUNWFUUE.js +0 -7
- package/dist/bin/chunks/chunk-RX4PT2U7.js +0 -9
- package/dist/bin/chunks/chunk-RZ6FAJ25.js +0 -18
- package/dist/bin/chunks/chunk-SDTTNNEH.js +0 -23
- package/dist/bin/chunks/chunk-SE4C7FJY.js +0 -33
- package/dist/bin/chunks/chunk-SL4D2YES.js +0 -4
- package/dist/bin/chunks/chunk-SZM4GZ4H.js +0 -2
- package/dist/bin/chunks/chunk-U4LP6WPJ.js +0 -11
- package/dist/bin/chunks/chunk-UAZICDKU.js +0 -5
- package/dist/bin/chunks/chunk-V3N6H3L5.js +0 -9
- package/dist/bin/chunks/chunk-VWJBSJYM.js +0 -2
- package/dist/bin/chunks/chunk-WXI44VNZ.js +0 -5
- package/dist/bin/chunks/chunk-X7PEK6W7.js +0 -13
- package/dist/bin/chunks/chunk-XB426ZI7.js +0 -3
- package/dist/bin/chunks/chunk-XILOLP4K.js +0 -8
- package/dist/bin/chunks/chunk-XRZNW2KP.js +0 -7
- package/dist/bin/chunks/chunk-XSBNCA43.js +0 -7
- package/dist/bin/chunks/chunk-YER5PEKD.js +0 -2
- package/dist/bin/chunks/chunk-YG67AAKF.js +0 -5
- package/dist/bin/chunks/chunk-YGAHXCGB.js +0 -13
- package/dist/bin/chunks/chunk-YJFLWG5Q.js +0 -73
- package/dist/bin/chunks/chunk-Z72PSRMX.js +0 -3
- package/dist/bin/chunks/chunk-Z73LISDU.js +0 -16
- package/dist/bin/chunks/chunk-ZZPPBMHW.js +0 -14
- package/dist/bin/chunks/clear-P5EG7Z6I.js +0 -2
- package/dist/bin/chunks/column-5CUPANJY.js +0 -2
- package/dist/bin/chunks/comm-LMDA7QZC.js +0 -2
- package/dist/bin/chunks/cp-7TMSGOID.js +0 -2
- package/dist/bin/chunks/curl-P6DHVAKR.js +0 -26
- package/dist/bin/chunks/cut-P6LPALWP.js +0 -2
- package/dist/bin/chunks/date-P3YMHSRG.js +0 -2
- package/dist/bin/chunks/diff-SGBANTKE.js +0 -2
- package/dist/bin/chunks/dirname-3LHNBKNB.js +0 -2
- package/dist/bin/chunks/du-DEYTW2KI.js +0 -2
- package/dist/bin/chunks/echo-5EBIR54T.js +0 -2
- package/dist/bin/chunks/env-PWRJFDWL.js +0 -2
- package/dist/bin/chunks/expand-672ZQYZF.js +0 -2
- package/dist/bin/chunks/expansion-OPTOOC4Q.js +0 -2
- package/dist/bin/chunks/expr-SWYNZXDP.js +0 -2
- package/dist/bin/chunks/file-MIXTZ4NP.js +0 -2
- package/dist/bin/chunks/find-BXGQE44U.js +0 -2
- package/dist/bin/chunks/flag-coverage-JA424IHF.js +0 -2
- package/dist/bin/chunks/fold-SK55D7OX.js +0 -2
- package/dist/bin/chunks/grep-6OXCYWRV.js +0 -2
- package/dist/bin/chunks/gzip-AKQBQW7Y.js +0 -2
- package/dist/bin/chunks/head-YZQN4BHR.js +0 -2
- package/dist/bin/chunks/help-R7JNUPU2.js +0 -2
- package/dist/bin/chunks/history-W57S3E3C.js +0 -2
- package/dist/bin/chunks/hostname-NPAYFT3O.js +0 -2
- package/dist/bin/chunks/html-to-markdown-2AHE4ET2.js +0 -2
- package/dist/bin/chunks/join-ZK67SMQ3.js +0 -2
- package/dist/bin/chunks/jq-2BGA6KZ3.js +0 -2
- package/dist/bin/chunks/ln-PZ7JHGH2.js +0 -2
- package/dist/bin/chunks/ls-SLO257WP.js +0 -2
- package/dist/bin/chunks/md5sum-WYOOUOWI.js +0 -2
- package/dist/bin/chunks/mkdir-EOATYYLD.js +0 -2
- package/dist/bin/chunks/mv-QUAFQDCT.js +0 -2
- package/dist/bin/chunks/nl-WZC4GKMG.js +0 -2
- package/dist/bin/chunks/od-IMVAQQIR.js +0 -2
- package/dist/bin/chunks/paste-6XYPZQXQ.js +0 -2
- package/dist/bin/chunks/printf-OCMANWQ5.js +0 -2
- package/dist/bin/chunks/pwd-PQGDLYLZ.js +0 -2
- package/dist/bin/chunks/python3-HNLPOBYQ.js +0 -14
- package/dist/bin/chunks/readlink-F66ORZVY.js +0 -2
- package/dist/bin/chunks/rev-67WGH7WN.js +0 -2
- package/dist/bin/chunks/rg-LTQYHOCO.js +0 -2
- package/dist/bin/chunks/rm-BZWDOVUX.js +0 -2
- package/dist/bin/chunks/rmdir-5MNK2AUK.js +0 -2
- package/dist/bin/chunks/sed-HN3E3YFB.js +0 -2
- package/dist/bin/chunks/seq-IDAAUGIL.js +0 -2
- package/dist/bin/chunks/sha1sum-Y2J25KOM.js +0 -2
- package/dist/bin/chunks/sha256sum-NFAAGL44.js +0 -2
- package/dist/bin/chunks/sleep-CPJ3WJE7.js +0 -2
- package/dist/bin/chunks/sort-FT4OVPSS.js +0 -2
- package/dist/bin/chunks/split-AXXLODUK.js +0 -2
- package/dist/bin/chunks/sqlite3-DUARNSNG.js +0 -2
- package/dist/bin/chunks/stat-6QXPS4BF.js +0 -2
- package/dist/bin/chunks/strings-7CJI5ESD.js +0 -2
- package/dist/bin/chunks/tac-Q5VNKVXE.js +0 -2
- package/dist/bin/chunks/tail-EI24LQBP.js +0 -2
- package/dist/bin/chunks/tar-M7QCUJ4B.js +0 -2
- package/dist/bin/chunks/tee-6TEQ3DXN.js +0 -2
- package/dist/bin/chunks/time-GJWZLHLN.js +0 -2
- package/dist/bin/chunks/timeout-LPVVIBNB.js +0 -2
- package/dist/bin/chunks/touch-J6X4OW3P.js +0 -2
- package/dist/bin/chunks/tr-2C3Q77EZ.js +0 -2
- package/dist/bin/chunks/tree-RLXLQJVI.js +0 -2
- package/dist/bin/chunks/true-ZPDUMWHQ.js +0 -2
- package/dist/bin/chunks/unexpand-AUQHJMGI.js +0 -2
- package/dist/bin/chunks/uniq-C3ZUQTF4.js +0 -2
- package/dist/bin/chunks/wc-NNQHXBLM.js +0 -2
- package/dist/bin/chunks/which-QKNHOQPQ.js +0 -2
- package/dist/bin/chunks/whoami-KIB3RVBF.js +0 -2
- package/dist/bin/chunks/xan-BGDVQKRZ.js +0 -2
- package/dist/bin/chunks/xan-view-GTANKIPW.js +0 -2
- package/dist/bin/chunks/xargs-I7QRUR36.js +0 -2
- package/dist/bin/chunks/yes-A2LPETVU.js +0 -2
- package/dist/bin/chunks/yq-W7OKSS7Z.js +0 -2
- package/dist/bin/shell/chunks/alias-DRSSCAUM.js +0 -2
- package/dist/bin/shell/chunks/awk2-GM5WBRLU.js +0 -2
- package/dist/bin/shell/chunks/base64-KLZ4B6VS.js +0 -2
- package/dist/bin/shell/chunks/basename-XCXGYZPS.js +0 -2
- package/dist/bin/shell/chunks/bash-U2E2FSIE.js +0 -2
- package/dist/bin/shell/chunks/cat-D4E4FTXJ.js +0 -2
- package/dist/bin/shell/chunks/chmod-OY5CP5QF.js +0 -2
- package/dist/bin/shell/chunks/chunk-23CC4423.js +0 -287
- package/dist/bin/shell/chunks/chunk-23EV7RYO.js +0 -10
- package/dist/bin/shell/chunks/chunk-2IOUIOWE.js +0 -12
- package/dist/bin/shell/chunks/chunk-3IJEW4BN.js +0 -9
- package/dist/bin/shell/chunks/chunk-3VDZW42W.js +0 -5
- package/dist/bin/shell/chunks/chunk-444WPTN5.js +0 -8
- package/dist/bin/shell/chunks/chunk-446TXLPR.js +0 -9
- package/dist/bin/shell/chunks/chunk-44ROJVH3.js +0 -6
- package/dist/bin/shell/chunks/chunk-4VVLCPRH.js +0 -8
- package/dist/bin/shell/chunks/chunk-4W52T6KS.js +0 -63
- package/dist/bin/shell/chunks/chunk-4Y3GINAY.js +0 -33
- package/dist/bin/shell/chunks/chunk-5IL5CXJC.js +0 -3
- package/dist/bin/shell/chunks/chunk-5KQNIOZS.js +0 -84
- package/dist/bin/shell/chunks/chunk-66PXNTAV.js +0 -2
- package/dist/bin/shell/chunks/chunk-67SBKZZD.js +0 -9
- package/dist/bin/shell/chunks/chunk-6U6CK6V4.js +0 -16
- package/dist/bin/shell/chunks/chunk-7J7OY2YE.js +0 -12
- package/dist/bin/shell/chunks/chunk-7VWUKGDV.js +0 -4
- package/dist/bin/shell/chunks/chunk-7YOACDUK.js +0 -140
- package/dist/bin/shell/chunks/chunk-AN2KBMAK.js +0 -12
- package/dist/bin/shell/chunks/chunk-ASU2EQWZ.js +0 -32
- package/dist/bin/shell/chunks/chunk-AZQ66C5R.js +0 -14
- package/dist/bin/shell/chunks/chunk-B4GXMUCA.js +0 -20
- package/dist/bin/shell/chunks/chunk-BXOX2H2G.js +0 -22
- package/dist/bin/shell/chunks/chunk-CD3NCHIB.js +0 -7
- package/dist/bin/shell/chunks/chunk-CE2ILL65.js +0 -9
- package/dist/bin/shell/chunks/chunk-D34QBGQ3.js +0 -7
- package/dist/bin/shell/chunks/chunk-D44C6YVE.js +0 -6
- package/dist/bin/shell/chunks/chunk-DFAHK2EQ.js +0 -23
- package/dist/bin/shell/chunks/chunk-DMTOGHTU.js +0 -6
- package/dist/bin/shell/chunks/chunk-EHJW6FCX.js +0 -36
- package/dist/bin/shell/chunks/chunk-EXCMJ23H.js +0 -100
- package/dist/bin/shell/chunks/chunk-FVFLR7NF.js +0 -21
- package/dist/bin/shell/chunks/chunk-GIFF636B.js +0 -2
- package/dist/bin/shell/chunks/chunk-GIVPKQT5.js +0 -16
- package/dist/bin/shell/chunks/chunk-GUZJZK5O.js +0 -2
- package/dist/bin/shell/chunks/chunk-H7TGYILF.js +0 -3
- package/dist/bin/shell/chunks/chunk-HEO6EBJ2.js +0 -14
- package/dist/bin/shell/chunks/chunk-HY6WUGWS.js +0 -10
- package/dist/bin/shell/chunks/chunk-HZM5PBQF.js +0 -8
- package/dist/bin/shell/chunks/chunk-I2N72LXH.js +0 -9
- package/dist/bin/shell/chunks/chunk-IAUA3FL7.js +0 -8
- package/dist/bin/shell/chunks/chunk-IPWJZ22H.js +0 -14
- package/dist/bin/shell/chunks/chunk-IQY3I4OH.js +0 -2
- package/dist/bin/shell/chunks/chunk-JU5KTPFP.js +0 -17
- package/dist/bin/shell/chunks/chunk-KAWPUEQM.js +0 -3
- package/dist/bin/shell/chunks/chunk-L2KFCEBW.js +0 -13
- package/dist/bin/shell/chunks/chunk-LVSKOXVG.js +0 -5
- package/dist/bin/shell/chunks/chunk-MPX22C7Y.js +0 -5
- package/dist/bin/shell/chunks/chunk-N7P3SUNH.js +0 -6
- package/dist/bin/shell/chunks/chunk-NNVWOCET.js +0 -2
- package/dist/bin/shell/chunks/chunk-NSSLXYEG.js +0 -8
- package/dist/bin/shell/chunks/chunk-OH3VVXF7.js +0 -3
- package/dist/bin/shell/chunks/chunk-PKKBPSVJ.js +0 -7
- package/dist/bin/shell/chunks/chunk-PRQYRYWV.js +0 -3
- package/dist/bin/shell/chunks/chunk-PZ46XEZ4.js +0 -2
- package/dist/bin/shell/chunks/chunk-Q2BKN6MV.js +0 -11
- package/dist/bin/shell/chunks/chunk-QFPJQSDK.js +0 -7
- package/dist/bin/shell/chunks/chunk-QKQUVK53.js +0 -10
- package/dist/bin/shell/chunks/chunk-QXOUI5BS.js +0 -11
- package/dist/bin/shell/chunks/chunk-RAL2LVDX.js +0 -7
- package/dist/bin/shell/chunks/chunk-RAUBS6MJ.js +0 -2
- package/dist/bin/shell/chunks/chunk-RFIBBYTO.js +0 -6
- package/dist/bin/shell/chunks/chunk-RIV3HSPK.js +0 -19
- package/dist/bin/shell/chunks/chunk-RMG637UR.js +0 -26
- package/dist/bin/shell/chunks/chunk-RUNWFUUE.js +0 -7
- package/dist/bin/shell/chunks/chunk-RX4PT2U7.js +0 -9
- package/dist/bin/shell/chunks/chunk-RZ6FAJ25.js +0 -18
- package/dist/bin/shell/chunks/chunk-SDTTNNEH.js +0 -23
- package/dist/bin/shell/chunks/chunk-SE4C7FJY.js +0 -33
- package/dist/bin/shell/chunks/chunk-SL4D2YES.js +0 -4
- package/dist/bin/shell/chunks/chunk-SZM4GZ4H.js +0 -2
- package/dist/bin/shell/chunks/chunk-U4LP6WPJ.js +0 -11
- package/dist/bin/shell/chunks/chunk-UAZICDKU.js +0 -5
- package/dist/bin/shell/chunks/chunk-V3N6H3L5.js +0 -9
- package/dist/bin/shell/chunks/chunk-VWJBSJYM.js +0 -2
- package/dist/bin/shell/chunks/chunk-WXI44VNZ.js +0 -5
- package/dist/bin/shell/chunks/chunk-X7PEK6W7.js +0 -13
- package/dist/bin/shell/chunks/chunk-XB426ZI7.js +0 -3
- package/dist/bin/shell/chunks/chunk-XILOLP4K.js +0 -8
- package/dist/bin/shell/chunks/chunk-XRZNW2KP.js +0 -7
- package/dist/bin/shell/chunks/chunk-XSBNCA43.js +0 -7
- package/dist/bin/shell/chunks/chunk-YER5PEKD.js +0 -2
- package/dist/bin/shell/chunks/chunk-YG67AAKF.js +0 -5
- package/dist/bin/shell/chunks/chunk-YGAHXCGB.js +0 -13
- package/dist/bin/shell/chunks/chunk-YJFLWG5Q.js +0 -73
- package/dist/bin/shell/chunks/chunk-Z72PSRMX.js +0 -3
- package/dist/bin/shell/chunks/chunk-Z73LISDU.js +0 -16
- package/dist/bin/shell/chunks/chunk-ZZPPBMHW.js +0 -14
- package/dist/bin/shell/chunks/clear-P5EG7Z6I.js +0 -2
- package/dist/bin/shell/chunks/column-5CUPANJY.js +0 -2
- package/dist/bin/shell/chunks/comm-LMDA7QZC.js +0 -2
- package/dist/bin/shell/chunks/cp-7TMSGOID.js +0 -2
- package/dist/bin/shell/chunks/curl-P6DHVAKR.js +0 -26
- package/dist/bin/shell/chunks/cut-P6LPALWP.js +0 -2
- package/dist/bin/shell/chunks/date-P3YMHSRG.js +0 -2
- package/dist/bin/shell/chunks/diff-SGBANTKE.js +0 -2
- package/dist/bin/shell/chunks/dirname-3LHNBKNB.js +0 -2
- package/dist/bin/shell/chunks/du-DEYTW2KI.js +0 -2
- package/dist/bin/shell/chunks/echo-5EBIR54T.js +0 -2
- package/dist/bin/shell/chunks/env-PWRJFDWL.js +0 -2
- package/dist/bin/shell/chunks/expand-672ZQYZF.js +0 -2
- package/dist/bin/shell/chunks/expansion-OPTOOC4Q.js +0 -2
- package/dist/bin/shell/chunks/expr-SWYNZXDP.js +0 -2
- package/dist/bin/shell/chunks/file-MIXTZ4NP.js +0 -2
- package/dist/bin/shell/chunks/find-BXGQE44U.js +0 -2
- package/dist/bin/shell/chunks/flag-coverage-JA424IHF.js +0 -2
- package/dist/bin/shell/chunks/fold-SK55D7OX.js +0 -2
- package/dist/bin/shell/chunks/grep-6OXCYWRV.js +0 -2
- package/dist/bin/shell/chunks/gzip-AKQBQW7Y.js +0 -2
- package/dist/bin/shell/chunks/head-YZQN4BHR.js +0 -2
- package/dist/bin/shell/chunks/help-R7JNUPU2.js +0 -2
- package/dist/bin/shell/chunks/history-W57S3E3C.js +0 -2
- package/dist/bin/shell/chunks/hostname-NPAYFT3O.js +0 -2
- package/dist/bin/shell/chunks/html-to-markdown-2AHE4ET2.js +0 -2
- package/dist/bin/shell/chunks/join-ZK67SMQ3.js +0 -2
- package/dist/bin/shell/chunks/jq-2BGA6KZ3.js +0 -2
- package/dist/bin/shell/chunks/ln-PZ7JHGH2.js +0 -2
- package/dist/bin/shell/chunks/ls-SLO257WP.js +0 -2
- package/dist/bin/shell/chunks/md5sum-WYOOUOWI.js +0 -2
- package/dist/bin/shell/chunks/mkdir-EOATYYLD.js +0 -2
- package/dist/bin/shell/chunks/mv-QUAFQDCT.js +0 -2
- package/dist/bin/shell/chunks/nl-WZC4GKMG.js +0 -2
- package/dist/bin/shell/chunks/od-IMVAQQIR.js +0 -2
- package/dist/bin/shell/chunks/paste-6XYPZQXQ.js +0 -2
- package/dist/bin/shell/chunks/printf-OCMANWQ5.js +0 -2
- package/dist/bin/shell/chunks/pwd-PQGDLYLZ.js +0 -2
- package/dist/bin/shell/chunks/python3-HNLPOBYQ.js +0 -14
- package/dist/bin/shell/chunks/readlink-F66ORZVY.js +0 -2
- package/dist/bin/shell/chunks/rev-67WGH7WN.js +0 -2
- package/dist/bin/shell/chunks/rg-LTQYHOCO.js +0 -2
- package/dist/bin/shell/chunks/rm-BZWDOVUX.js +0 -2
- package/dist/bin/shell/chunks/rmdir-5MNK2AUK.js +0 -2
- package/dist/bin/shell/chunks/sed-HN3E3YFB.js +0 -2
- package/dist/bin/shell/chunks/seq-IDAAUGIL.js +0 -2
- package/dist/bin/shell/chunks/sha1sum-Y2J25KOM.js +0 -2
- package/dist/bin/shell/chunks/sha256sum-NFAAGL44.js +0 -2
- package/dist/bin/shell/chunks/sleep-CPJ3WJE7.js +0 -2
- package/dist/bin/shell/chunks/sort-FT4OVPSS.js +0 -2
- package/dist/bin/shell/chunks/split-AXXLODUK.js +0 -2
- package/dist/bin/shell/chunks/sqlite3-DUARNSNG.js +0 -2
- package/dist/bin/shell/chunks/stat-6QXPS4BF.js +0 -2
- package/dist/bin/shell/chunks/strings-7CJI5ESD.js +0 -2
- package/dist/bin/shell/chunks/tac-Q5VNKVXE.js +0 -2
- package/dist/bin/shell/chunks/tail-EI24LQBP.js +0 -2
- package/dist/bin/shell/chunks/tar-M7QCUJ4B.js +0 -2
- package/dist/bin/shell/chunks/tee-6TEQ3DXN.js +0 -2
- package/dist/bin/shell/chunks/time-GJWZLHLN.js +0 -2
- package/dist/bin/shell/chunks/timeout-LPVVIBNB.js +0 -2
- package/dist/bin/shell/chunks/touch-J6X4OW3P.js +0 -2
- package/dist/bin/shell/chunks/tr-2C3Q77EZ.js +0 -2
- package/dist/bin/shell/chunks/tree-RLXLQJVI.js +0 -2
- package/dist/bin/shell/chunks/true-ZPDUMWHQ.js +0 -2
- package/dist/bin/shell/chunks/unexpand-AUQHJMGI.js +0 -2
- package/dist/bin/shell/chunks/uniq-C3ZUQTF4.js +0 -2
- package/dist/bin/shell/chunks/wc-NNQHXBLM.js +0 -2
- package/dist/bin/shell/chunks/which-QKNHOQPQ.js +0 -2
- package/dist/bin/shell/chunks/whoami-KIB3RVBF.js +0 -2
- package/dist/bin/shell/chunks/xan-BGDVQKRZ.js +0 -2
- package/dist/bin/shell/chunks/xan-view-GTANKIPW.js +0 -2
- package/dist/bin/shell/chunks/xargs-I7QRUR36.js +0 -2
- package/dist/bin/shell/chunks/yes-A2LPETVU.js +0 -2
- package/dist/bin/shell/chunks/yq-W7OKSS7Z.js +0 -2
- package/dist/bundle/chunks/alias-JHV3WNPA.js +0 -1
- package/dist/bundle/chunks/awk2-LA5EZ6UJ.js +0 -1
- package/dist/bundle/chunks/base64-DP3BVL7J.js +0 -1
- package/dist/bundle/chunks/basename-NCIQLNXY.js +0 -1
- package/dist/bundle/chunks/bash-CN3UUJ3N.js +0 -1
- package/dist/bundle/chunks/cat-KHANCARN.js +0 -1
- package/dist/bundle/chunks/chmod-A3HCFC4L.js +0 -1
- package/dist/bundle/chunks/chunk-26DNZXYZ.js +0 -23
- package/dist/bundle/chunks/chunk-26VNLF3H.js +0 -6
- package/dist/bundle/chunks/chunk-2AMXQD57.js +0 -11
- package/dist/bundle/chunks/chunk-2OIUNVMP.js +0 -10
- package/dist/bundle/chunks/chunk-2V4QPJXQ.js +0 -19
- package/dist/bundle/chunks/chunk-2WN53CVO.js +0 -15
- package/dist/bundle/chunks/chunk-3ANOKDIL.js +0 -5
- package/dist/bundle/chunks/chunk-3P5XOPF6.js +0 -1
- package/dist/bundle/chunks/chunk-44V5AOJ4.js +0 -8
- package/dist/bundle/chunks/chunk-4PFDHMBC.js +0 -8
- package/dist/bundle/chunks/chunk-53I2XH4A.js +0 -9
- package/dist/bundle/chunks/chunk-5BF5Z7CI.js +0 -1
- package/dist/bundle/chunks/chunk-5J57FRET.js +0 -4
- package/dist/bundle/chunks/chunk-5PIFIDMP.js +0 -13
- package/dist/bundle/chunks/chunk-5PV2QBWC.js +0 -5
- package/dist/bundle/chunks/chunk-6RAG3BOS.js +0 -2
- package/dist/bundle/chunks/chunk-6V537K6X.js +0 -1
- package/dist/bundle/chunks/chunk-72YPFG2Z.js +0 -5
- package/dist/bundle/chunks/chunk-7USKQKOT.js +0 -1
- package/dist/bundle/chunks/chunk-ATPJVO6F.js +0 -8
- package/dist/bundle/chunks/chunk-BJQMZYH3.js +0 -22
- package/dist/bundle/chunks/chunk-BQFHZOZH.js +0 -99
- package/dist/bundle/chunks/chunk-BTTTDUMD.js +0 -1
- package/dist/bundle/chunks/chunk-BXVXYDEI.js +0 -286
- package/dist/bundle/chunks/chunk-C325X4RB.js +0 -7
- package/dist/bundle/chunks/chunk-C44B5265.js +0 -2
- package/dist/bundle/chunks/chunk-D3IE6KOV.js +0 -21
- package/dist/bundle/chunks/chunk-D4LWWAJ2.js +0 -6
- package/dist/bundle/chunks/chunk-DNPCEBCN.js +0 -2
- package/dist/bundle/chunks/chunk-EHRCEDXN.js +0 -13
- package/dist/bundle/chunks/chunk-EHY6GWKP.js +0 -8
- package/dist/bundle/chunks/chunk-F77E6PCM.js +0 -7
- package/dist/bundle/chunks/chunk-GET3OC3O.js +0 -8
- package/dist/bundle/chunks/chunk-GMCBEP44.js +0 -16
- package/dist/bundle/chunks/chunk-GNXHG75U.js +0 -1
- package/dist/bundle/chunks/chunk-GQSJJXDG.js +0 -3
- package/dist/bundle/chunks/chunk-H5X25CTO.js +0 -6
- package/dist/bundle/chunks/chunk-IAFRFK2O.js +0 -9
- package/dist/bundle/chunks/chunk-IJXFPKNC.js +0 -1
- package/dist/bundle/chunks/chunk-INJTM5VR.js +0 -5
- package/dist/bundle/chunks/chunk-J7YL5K5B.js +0 -2
- package/dist/bundle/chunks/chunk-JJ5E4XJI.js +0 -13
- package/dist/bundle/chunks/chunk-JMFP263D.js +0 -1
- package/dist/bundle/chunks/chunk-JSLN56GJ.js +0 -7
- package/dist/bundle/chunks/chunk-K374E7Q4.js +0 -8
- package/dist/bundle/chunks/chunk-K7ZRPFN6.js +0 -6
- package/dist/bundle/chunks/chunk-KBCEHRTU.js +0 -4
- package/dist/bundle/chunks/chunk-KRXVUD4L.js +0 -4
- package/dist/bundle/chunks/chunk-LBJIRX7Z.js +0 -6
- package/dist/bundle/chunks/chunk-M5Z2PSET.js +0 -31
- package/dist/bundle/chunks/chunk-MOCB6GPI.js +0 -62
- package/dist/bundle/chunks/chunk-NDPSDM3Q.js +0 -32
- package/dist/bundle/chunks/chunk-OZ76IUC5.js +0 -10
- package/dist/bundle/chunks/chunk-PEPBD26Q.js +0 -2
- package/dist/bundle/chunks/chunk-PES2WOIM.js +0 -15
- package/dist/bundle/chunks/chunk-PLMPLLOW.js +0 -12
- package/dist/bundle/chunks/chunk-PQPG4QOY.js +0 -22
- package/dist/bundle/chunks/chunk-PUUP54QP.js +0 -9
- package/dist/bundle/chunks/chunk-Q5XZ24VX.js +0 -6
- package/dist/bundle/chunks/chunk-QOFUETQV.js +0 -4
- package/dist/bundle/chunks/chunk-QPHABKP3.js +0 -11
- package/dist/bundle/chunks/chunk-R7SSLDTN.js +0 -6
- package/dist/bundle/chunks/chunk-RTGKIAVM.js +0 -6
- package/dist/bundle/chunks/chunk-RZ4GSKWY.js +0 -7
- package/dist/bundle/chunks/chunk-SF2462OV.js +0 -3
- package/dist/bundle/chunks/chunk-SJ7F47VW.js +0 -6
- package/dist/bundle/chunks/chunk-SMOO4IXI.js +0 -1
- package/dist/bundle/chunks/chunk-SYTEZ2Y4.js +0 -5
- package/dist/bundle/chunks/chunk-TOK4OQFP.js +0 -13
- package/dist/bundle/chunks/chunk-U5Z7TJRO.js +0 -11
- package/dist/bundle/chunks/chunk-U6GF4IJH.js +0 -72
- package/dist/bundle/chunks/chunk-ULK572PS.js +0 -7
- package/dist/bundle/chunks/chunk-URMOT4S7.js +0 -4
- package/dist/bundle/chunks/chunk-USGCTFXK.js +0 -2
- package/dist/bundle/chunks/chunk-VKPVP3LD.js +0 -4
- package/dist/bundle/chunks/chunk-W4YQKIRV.js +0 -35
- package/dist/bundle/chunks/chunk-WMCZEPWH.js +0 -8
- package/dist/bundle/chunks/chunk-WTT2UCIA.js +0 -20
- package/dist/bundle/chunks/chunk-WVUVOYGQ.js +0 -10
- package/dist/bundle/chunks/chunk-XXS34VJC.js +0 -12
- package/dist/bundle/chunks/chunk-XZMBEDQL.js +0 -7
- package/dist/bundle/chunks/chunk-XZZ3XIZH.js +0 -15
- package/dist/bundle/chunks/chunk-YJHMB6QD.js +0 -17
- package/dist/bundle/chunks/chunk-YNYSPYQ5.js +0 -32
- package/dist/bundle/chunks/chunk-YR4NQYT4.js +0 -1
- package/dist/bundle/chunks/chunk-YZPQ2W3A.js +0 -139
- package/dist/bundle/chunks/chunk-Z6DABRIE.js +0 -12
- package/dist/bundle/chunks/chunk-ZEHOKNGQ.js +0 -2
- package/dist/bundle/chunks/chunk-ZILSBZZ6.js +0 -4
- package/dist/bundle/chunks/clear-7SIFUXVD.js +0 -1
- package/dist/bundle/chunks/column-OUJRIWLX.js +0 -1
- package/dist/bundle/chunks/comm-47FVEMHB.js +0 -1
- package/dist/bundle/chunks/cp-FD6I3O6B.js +0 -1
- package/dist/bundle/chunks/curl-3MHMRKXA.js +0 -25
- package/dist/bundle/chunks/cut-LQZW2NZP.js +0 -1
- package/dist/bundle/chunks/date-4I2XIKHX.js +0 -1
- package/dist/bundle/chunks/diff-7ZYMEVUP.js +0 -1
- package/dist/bundle/chunks/dirname-IVA4YYRE.js +0 -1
- package/dist/bundle/chunks/du-H4GJHM4R.js +0 -1
- package/dist/bundle/chunks/echo-ZPFMTGPQ.js +0 -1
- package/dist/bundle/chunks/env-ZCKP6263.js +0 -1
- package/dist/bundle/chunks/expand-Y7EMR5BJ.js +0 -1
- package/dist/bundle/chunks/expansion-GYIQOAHW.js +0 -1
- package/dist/bundle/chunks/expr-WDFXVU43.js +0 -1
- package/dist/bundle/chunks/file-7WSECN2B.js +0 -1
- package/dist/bundle/chunks/find-BYG3GTNV.js +0 -1
- package/dist/bundle/chunks/flag-coverage-IEYW6QK2.js +0 -1
- package/dist/bundle/chunks/fold-6O4H3AW4.js +0 -1
- package/dist/bundle/chunks/grep-KLQ4A2OH.js +0 -1
- package/dist/bundle/chunks/gzip-BYGAV4XY.js +0 -1
- package/dist/bundle/chunks/head-CIKXFGO5.js +0 -1
- package/dist/bundle/chunks/help-B2UCSYQN.js +0 -1
- package/dist/bundle/chunks/history-N2VRLHEO.js +0 -1
- package/dist/bundle/chunks/hostname-W7U3GOEK.js +0 -1
- package/dist/bundle/chunks/html-to-markdown-ZDG5GHHM.js +0 -1
- package/dist/bundle/chunks/join-CFMKSF44.js +0 -1
- package/dist/bundle/chunks/jq-BE76GAFF.js +0 -1
- package/dist/bundle/chunks/ln-N3OWFM3J.js +0 -1
- package/dist/bundle/chunks/ls-JAO4QNWZ.js +0 -1
- package/dist/bundle/chunks/md5sum-ZK2D5HMO.js +0 -1
- package/dist/bundle/chunks/mkdir-O74MZREV.js +0 -1
- package/dist/bundle/chunks/mv-66ALAQRO.js +0 -1
- package/dist/bundle/chunks/nl-JSPXHHOM.js +0 -1
- package/dist/bundle/chunks/od-NUINXLUX.js +0 -1
- package/dist/bundle/chunks/paste-Y7CG4TKC.js +0 -1
- package/dist/bundle/chunks/printf-223LFYZL.js +0 -1
- package/dist/bundle/chunks/pwd-BP6H5JPD.js +0 -1
- package/dist/bundle/chunks/python3-2KEMASKS.js +0 -13
- package/dist/bundle/chunks/readlink-JL7TKP5U.js +0 -1
- package/dist/bundle/chunks/rev-UN4ZHPP5.js +0 -1
- package/dist/bundle/chunks/rg-RA3U4BVJ.js +0 -1
- package/dist/bundle/chunks/rm-NIZVTCU7.js +0 -1
- package/dist/bundle/chunks/rmdir-LGJXG7S3.js +0 -1
- package/dist/bundle/chunks/sed-JJ3WRWYT.js +0 -1
- package/dist/bundle/chunks/seq-SXS6YKWX.js +0 -1
- package/dist/bundle/chunks/sha1sum-BB464H3H.js +0 -1
- package/dist/bundle/chunks/sha256sum-PPJUHZ6A.js +0 -1
- package/dist/bundle/chunks/sleep-YQMDXMVK.js +0 -1
- package/dist/bundle/chunks/sort-BNPU2P3T.js +0 -1
- package/dist/bundle/chunks/split-SVMZIFGF.js +0 -1
- package/dist/bundle/chunks/sqlite3-PZGLI6XB.js +0 -1
- package/dist/bundle/chunks/stat-2CKLARLN.js +0 -1
- package/dist/bundle/chunks/strings-LG7URPXR.js +0 -1
- package/dist/bundle/chunks/tac-NXGTFB5T.js +0 -1
- package/dist/bundle/chunks/tail-GJ536HFQ.js +0 -1
- package/dist/bundle/chunks/tar-3KCFO6WZ.js +0 -1
- package/dist/bundle/chunks/tee-PJ6B6JJF.js +0 -1
- package/dist/bundle/chunks/time-IENYNVU4.js +0 -1
- package/dist/bundle/chunks/timeout-SXUKTL7R.js +0 -1
- package/dist/bundle/chunks/touch-7BNOFP74.js +0 -1
- package/dist/bundle/chunks/tr-TB6CSIUV.js +0 -1
- package/dist/bundle/chunks/tree-4XRVONUX.js +0 -1
- package/dist/bundle/chunks/true-4UI5ZW75.js +0 -1
- package/dist/bundle/chunks/unexpand-LDC3OTY4.js +0 -1
- package/dist/bundle/chunks/uniq-ZHYLWEFM.js +0 -1
- package/dist/bundle/chunks/wc-PWYVRT3X.js +0 -1
- package/dist/bundle/chunks/which-EIT2IJGG.js +0 -1
- package/dist/bundle/chunks/whoami-QZJHAL2R.js +0 -1
- package/dist/bundle/chunks/xan-JDD2TEQH.js +0 -1
- package/dist/bundle/chunks/xan-view-WKPGEZFG.js +0 -1
- package/dist/bundle/chunks/xargs-CB3LOKW5.js +0 -1
- package/dist/bundle/chunks/yes-2J55KNKF.js +0 -1
- package/dist/bundle/chunks/yq-JFXSVU6G.js +0 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as x}from"./chunk-CAXM2HMK.js";import{b as n,f as a,i as c}from"./chunk-6VQWCKYE.js";import{k as h}from"./chunk-463VWH7H.js";var M={name:"time",async execute(d,r){let s=h(d),l="%e %M",m=null,u=!1,p=!1,t=0;for(;t<s.length;){let e=s[t];if(e==="-f"||e==="--format"){if(t++,t>=s.length)return{stdout:n(),stderr:a(`time: missing argument to '-f'
|
|
3
|
+
`),exitCode:1};l=s[t],t++}else if(e==="-o"||e==="--output"){if(t++,t>=s.length)return{stdout:n(),stderr:a(`time: missing argument to '-o'
|
|
4
|
+
`),exitCode:1};m=s[t],t++}else if(e==="-a"||e==="--append")u=!0,t++;else if(e==="-v"||e==="--verbose")l=`Command being timed: %C
|
|
5
|
+
Elapsed (wall clock) time: %e seconds
|
|
6
|
+
Maximum resident set size (kbytes): %M`,t++;else if(e==="-p"||e==="--portability")p=!0,t++;else if(e==="--"){t++;break}else if(e.startsWith("-"))t++;else break}let g=s.slice(t);if(g.length===0)return{stdout:n(),stderr:n(),exitCode:0};let C=performance.now(),w=g.join(" "),i;try{if(!r.exec)return{stdout:n(),stderr:a(`time: exec not available
|
|
7
|
+
`),exitCode:1};i=await r.exec(w,{env:x(r.env),cwd:r.cwd})}catch(e){i={stdout:n(),stderr:a(`time: ${e.message}
|
|
8
|
+
`),exitCode:127}}let f=(performance.now()-C)/1e3,o;if(p?o=`real ${f.toFixed(2)}
|
|
9
|
+
user 0.00
|
|
10
|
+
sys 0.00
|
|
11
|
+
`:(o=l.replace(/%e/g,f.toFixed(2)).replace(/%E/g,S(f)).replace(/%M/g,"0").replace(/%S/g,"0.00").replace(/%U/g,"0.00").replace(/%P/g,"0%").replace(/%C/g,w),o.endsWith(`
|
|
12
|
+
`)||(o+=`
|
|
13
|
+
`)),m)try{let e=r.fs.resolvePath(r.cwd,m);if(u&&await r.fs.exists(e)){let F=await r.fs.readFileText(e);await r.fs.writeFile(e,F+o)}else await r.fs.writeFile(e,o)}catch(e){return{stdout:i.stdout,stderr:c(i.stderr,a(`time: cannot write to '${m}': ${e.message}
|
|
14
|
+
`)),exitCode:i.exitCode}}else i={...i,stderr:c(i.stderr,a(o))};return i}};function S(d){let r=Math.floor(d/3600),s=Math.floor(d%3600/60),l=d%60;return r>0?`${r}:${s.toString().padStart(2,"0")}:${l.toFixed(2).padStart(5,"0")}`:`${s}:${l.toFixed(2).padStart(5,"0")}`}var T={name:"time",flags:[{flag:"-p",type:"boolean"}],needsArgs:!0};export{M as a,T as b};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as P}from"./chunk-J7ARATA6.js";import{a as $,b as w}from"./chunk-EKD22SYR.js";import{f as D}from"./chunk-6VQWCKYE.js";import{k as g}from"./chunk-463VWH7H.js";var T={name:"tree",summary:"list contents of directories in a tree-like format",usage:"tree [OPTION]... [DIRECTORY]...",options:["-a include hidden files","-d list directories only","-L LEVEL limit depth of directory tree","-f print full path prefix for each file"," --help display this help and exit"]},H={showHidden:{short:"a",type:"boolean"},directoriesOnly:{short:"d",type:"boolean"},fullPath:{short:"f",type:"boolean"},maxDepth:{short:"L",type:"number"}},N={name:"tree",async execute(o,u){let n=g(o);if(w(n))return $(T);let l=P("tree",n,H);if(!l.ok)return l.error;let m={showHidden:l.result.flags.showHidden,directoriesOnly:l.result.flags.directoriesOnly,maxDepth:l.result.flags.maxDepth??null,fullPath:l.result.flags.fullPath},e=l.result.positional;e.length===0&&e.push(".");let i="",c="",s=0,t=0;for(let r of e){let a=await W(u,r,m,"",0);i+=a.output,c+=a.stderr,s+=a.dirCount,t+=a.fileCount}return i+=`
|
|
3
|
+
${s} director${s===1?"y":"ies"}`,m.directoriesOnly||(i+=`, ${t} file${t===1?"":"s"}`),i+=`
|
|
4
|
+
`,{stdout:D(i),stderr:D(c),exitCode:c?1:0}}};async function W(o,u,n,l,m){let e={output:"",stderr:"",dirCount:0,fileCount:0},i=o.fs.resolvePath(o.cwd,u);try{if(!(await o.fs.stat(i)).isDirectory)return e.output=`${u}
|
|
5
|
+
`,e.fileCount=1,e}catch{return e.stderr=`tree: ${u}: No such file or directory
|
|
6
|
+
`,e}if(e.output=`${u}
|
|
7
|
+
`,n.maxDepth!==null&&m>=n.maxDepth)return e;try{let c=[];if(o.fs.readdirWithFileTypes)c=(await o.fs.readdirWithFileTypes(i)).map(r=>({name:r.name,isDirectory:r.isDirectory}));else{let t=await o.fs.readdir(i);for(let r=0;r<t.length;r+=100){let a=t.slice(r,r+100),f=await Promise.all(a.map(async d=>{let y=i==="/"?`/${d}`:`${i}/${d}`;try{let h=await o.fs.stat(y);return{name:d,isDirectory:h.isDirectory}}catch{return null}}));c.push(...f.filter(d=>d!==null))}}let s=c.filter(t=>!(!n.showHidden&&t.name.startsWith(".")||n.directoriesOnly&&!t.isDirectory));s.sort((t,r)=>t.name.localeCompare(r.name));for(let t=0;t<s.length;t++){let r=s[t],a=i==="/"?`/${r.name}`:`${i}/${r.name}`,f=t===s.length-1,d=f?"`-- ":"|-- ",y=l+(f?" ":"| ");if(r.isDirectory){e.dirCount++;let h=n.fullPath?a:r.name;if(e.output+=`${l+d+h}
|
|
8
|
+
`,n.maxDepth===null||m+1<n.maxDepth){let C=await b(o,a,n,y,m+1);e.output+=C.output,e.dirCount+=C.dirCount,e.fileCount+=C.fileCount}}else{e.fileCount++;let h=n.fullPath?a:r.name;e.output+=`${l+d+h}
|
|
9
|
+
`}}}catch{e.stderr=`tree: ${u}: Permission denied
|
|
10
|
+
`}return e}async function b(o,u,n,l,m){let e={output:"",stderr:"",dirCount:0,fileCount:0};if(n.maxDepth!==null&&m>=n.maxDepth)return e;try{let i=[];if(o.fs.readdirWithFileTypes)i=(await o.fs.readdirWithFileTypes(u)).map(t=>({name:t.name,isDirectory:t.isDirectory}));else{let s=await o.fs.readdir(u);for(let t=0;t<s.length;t+=100){let r=s.slice(t,t+100),a=await Promise.all(r.map(async f=>{let d=u==="/"?`/${f}`:`${u}/${f}`;try{let y=await o.fs.stat(d);return{name:f,isDirectory:y.isDirectory}}catch{return null}}));i.push(...a.filter(f=>f!==null))}}let c=i.filter(s=>!(!n.showHidden&&s.name.startsWith(".")||n.directoriesOnly&&!s.isDirectory));c.sort((s,t)=>s.name.localeCompare(t.name));for(let s=0;s<c.length;s++){let t=c[s],r=u==="/"?`/${t.name}`:`${u}/${t.name}`,a=s===c.length-1,f=a?"`-- ":"|-- ",d=l+(a?" ":"| ");if(t.isDirectory){e.dirCount++;let y=n.fullPath?r:t.name;e.output+=`${l+f+y}
|
|
11
|
+
`;let h=await b(o,r,n,d,m+1);e.output+=h.output,e.dirCount+=h.dirCount,e.fileCount+=h.fileCount}else{e.fileCount++;let y=n.fullPath?r:t.name;e.output+=`${l+f+y}
|
|
12
|
+
`}}}catch{}return e}var R={name:"tree",flags:[{flag:"-a",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-L",type:"value",valueHint:"number"}],needsFiles:!0};export{N as a,R as b};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as N}from"./chunk-4VDEBYW7.js";import{c as g}from"./chunk-EKD22SYR.js";import{b as f,f as d}from"./chunk-6VQWCKYE.js";import{k as p}from"./chunk-463VWH7H.js";function b(h){let s=h.replace(/\//g,"-"),t=new Date(s);if(!Number.isNaN(t.getTime()))return t;let o=s.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(o){let[,i,u,l]=o;if(t=new Date(Number.parseInt(i,10),Number.parseInt(u,10)-1,Number.parseInt(l,10)),!Number.isNaN(t.getTime()))return t}let a=s.match(/^(\d{4})-(\d{2})-(\d{2})\s+(\d{2}):(\d{2}):(\d{2})$/);if(a){let[,i,u,l,m,r,e]=a;if(t=new Date(Number.parseInt(i,10),Number.parseInt(u,10)-1,Number.parseInt(l,10),Number.parseInt(m,10),Number.parseInt(r,10),Number.parseInt(e,10)),!Number.isNaN(t.getTime()))return t}return null}var C={name:"touch",async execute(h,s){let t=p(h),o=[],a=null,i=!1;for(let r=0;r<t.length;r++){let e=t[r];if(e==="--"){o.push(...t.slice(r+1));break}else if(e==="-d"||e==="--date"){if(r+1>=t.length)return{stdout:f(),stderr:d(`touch: option requires an argument -- 'd'
|
|
3
|
+
`),exitCode:1};a=t[++r]}else if(e.startsWith("--date="))a=e.slice(7);else if(e==="-c"||e==="--no-create")i=!0;else if(e==="-a"||e==="-m"||e==="-r"||e==="-t")(e==="-r"||e==="-t")&&r++;else{if(e.startsWith("--"))return g("touch",e);if(e.startsWith("-")&&e.length>1){let c=!1;for(let n of e.slice(1))if(n==="c")i=!0;else if(!(n==="a"||n==="m"))if(n==="d"){if(r+1>=t.length)return{stdout:f(),stderr:d(`touch: option requires an argument -- 'd'
|
|
4
|
+
`),exitCode:1};a=t[++r],c=!0;break}else if(n==="r"||n==="t"){r++,c=!0;break}else return g("touch",`-${n}`);if(c)continue}else o.push(e)}}if(o.length===0)return{stdout:f(),stderr:d(`touch: missing file operand
|
|
5
|
+
`),exitCode:1};let u=null;if(a!==null&&(u=b(a),u===null))return{stdout:f(),stderr:d(`touch: invalid date format '${a}'
|
|
6
|
+
`),exitCode:1};let l="",m=0;for(let r of o)try{let e=s.fs.resolvePath(s.cwd,r);if(!await s.fs.exists(e)){if(i)continue;await s.fs.writeFile(e,"")}let n=u??new Date;await s.fs.utimes(e,n,n)}catch(e){l+=`touch: cannot touch '${r}': ${N(e)}
|
|
7
|
+
`,m=1}return{stdout:f(),stderr:d(l),exitCode:m}}},$={name:"touch",flags:[{flag:"-c",type:"boolean"},{flag:"-a",type:"boolean"},{flag:"-m",type:"boolean"},{flag:"-d",type:"value",valueHint:"string"}],needsArgs:!0};export{C as a,$ as b};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as l,b as d}from"./chunk-EKD22SYR.js";import{b as n,f as r}from"./chunk-6VQWCKYE.js";import{k as m}from"./chunk-463VWH7H.js";var c={name:"dirname",summary:"strip last component from file name",usage:"dirname [OPTION] NAME...",options:[" --help display this help and exit"]},g={name:"dirname",async execute(p,f){let o=m(p);if(d(o))return l(c);let a=o.filter(t=>!t.startsWith("-"));if(a.length===0)return{stdout:n(),stderr:r(`dirname: missing operand
|
|
3
|
+
`),exitCode:1};let e=[];for(let t of a){let i=t.replace(/\/+$/,""),s=i.lastIndexOf("/");s===-1?e.push("."):s===0?e.push("/"):e.push(i.slice(0,s))}return{stdout:r(`${e.join(`
|
|
4
|
+
`)}
|
|
5
|
+
`),stderr:n(),exitCode:0}}},y={name:"dirname",flags:[],needsArgs:!0};export{g as a,y as b};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as C,b as k,c as w}from"./chunk-EKD22SYR.js";import{b as d,f as p,h as v}from"./chunk-6VQWCKYE.js";import{k as b}from"./chunk-463VWH7H.js";var T={name:"unexpand",summary:"convert spaces to tabs",usage:"unexpand [OPTION]... [FILE]...",description:"Convert blanks in each FILE to TABs, writing to standard output. If no FILE is specified, standard input is read.",options:["-t N Use N spaces per tab (default: 8)","-t LIST Use comma-separated list of tab stops","-a Convert all sequences of blanks (not just leading)"],examples:["unexpand file.txt # Convert leading spaces to tabs","unexpand -a file.txt # Convert all space sequences","unexpand -t 4 file.txt # Use 4-space tabs"]};function h(o){let a=o.split(",").map(n=>n.trim()),e=[];for(let n of a){let r=parseInt(n,10);if(Number.isNaN(r)||r<1)return null;e.push(r)}for(let n=1;n<e.length;n++)if(e[n]<=e[n-1])return null;return e}function L(o,a){if(a.length===1){let e=a[0];return o+(e-o%e)}for(let e of a)if(e>o)return e;if(a.length>=2){let e=a[a.length-1]-a[a.length-2],n=a[a.length-1],r=Math.floor((o-n)/e)+1;return n+r*e}return-1}function y(o,a){let{tabStops:e,allBlanks:n}=a,r="",s=0,l="",t=0,i=!0,f=()=>{if(l.length===0)return;let u=t+l.length;if(!n&&!i){r+=l,l="";return}let c=t,x="";for(;c<u;){let g=L(c,e);if(g<=u&&g>c)x+=" ",c=g;else break}let m=u-c;m>0&&(x+=" ".repeat(m)),r+=x,l=""};for(let u of o)u===" "?(l.length===0&&(t=s),l+=u,s++):u===" "?(f(),r+=u,s=L(s,e)):(f(),r+=u,s++,i=!1);return f(),r}function N(o,a){if(o==="")return"";let e=o.split(`
|
|
3
|
+
`),n=o.endsWith(`
|
|
4
|
+
`)&&e[e.length-1]==="";return n&&e.pop(),e.map(s=>y(s,a)).join(`
|
|
5
|
+
`)+(n?`
|
|
6
|
+
`:"")}var z={name:"unexpand",execute:async(o,a)=>{let e=b(o);if(k(e))return C(T);let n={tabStops:[8],allBlanks:!1},r=[],s=0;for(;s<e.length;){let t=e[s];if(t==="-t"&&s+1<e.length){let i=h(e[s+1]);if(!i)return{exitCode:1,stdout:d(),stderr:p(`unexpand: invalid tab size: '${e[s+1]}'
|
|
7
|
+
`)};n.tabStops=i,s+=2}else if(t.startsWith("-t")&&t.length>2){let i=h(t.slice(2));if(!i)return{exitCode:1,stdout:d(),stderr:p(`unexpand: invalid tab size: '${t.slice(2)}'
|
|
8
|
+
`)};n.tabStops=i,s++}else if(t==="--tabs"&&s+1<e.length){let i=h(e[s+1]);if(!i)return{exitCode:1,stdout:d(),stderr:p(`unexpand: invalid tab size: '${e[s+1]}'
|
|
9
|
+
`)};n.tabStops=i,s+=2}else if(t.startsWith("--tabs=")){let i=h(t.slice(7));if(!i)return{exitCode:1,stdout:d(),stderr:p(`unexpand: invalid tab size: '${t.slice(7)}'
|
|
10
|
+
`)};n.tabStops=i,s++}else if(t==="-a"||t==="--all")n.allBlanks=!0,s++;else if(t==="--"){r.push(...e.slice(s+1));break}else{if(t.startsWith("-")&&t!=="-")return w("unexpand",t);r.push(t),s++}}let l="";if(r.length===0){let t=await v(a.stdin);l=N(t,n)}else for(let t of r){let i=a.fs.resolvePath(a.cwd,t),f;try{f=await a.fs.readFileText(i)}catch{return{exitCode:1,stdout:p(l),stderr:p(`unexpand: ${t}: No such file or directory
|
|
11
|
+
`)}}l+=N(f,n)}return{exitCode:0,stdout:p(l),stderr:d()}}},B={name:"unexpand",flags:[{flag:"-t",type:"value",valueHint:"number"},{flag:"-a",type:"boolean"}],stdinType:"text",needsFiles:!0};export{z as a,B as b};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var s=class extends Error{},n=class extends s{levels;name="BreakError";constructor(t=1){super("break"),this.levels=t}},o=class extends s{levels;name="ContinueError";constructor(t=1){super("continue"),this.levels=t}},c=class extends s{exitCode;name="ReturnError";constructor(t=0){super("return"),this.exitCode=t}},x=class extends s{exitCode;name="ErrexitError";constructor(t){super(`errexit: command exited with status ${t}`),this.exitCode=t}},u=class extends s{varName;name="NounsetError";constructor(t){super(`${t}: unbound variable`),this.varName=t}},p=class extends s{exitCode;name="ExitError";constructor(t){super("exit"),this.exitCode=t}},d=class extends s{reportDiagnostic;name="ArithmeticError";fatal;constructor(t,r=!1,C=!0){super(t),this.reportDiagnostic=C,this.fatal=r}},l=class extends s{name="BadSubstitutionError"},m=class extends s{pattern;name="GlobError";constructor(t){super(`no match: ${t}`),this.pattern=t}},h=class extends s{name="BraceExpansionError"},i=class extends s{limitType;name="ExecutionLimitError";static EXIT_CODE=126;constructor(t,r){super(t),this.limitType=r}};function E(e){if(e instanceof DOMException&&e.name==="TimeoutError")return 124;if(typeof e=="number"&&Number.isInteger(e)&&e>0&&e<128)return 128+e;switch(e){case"SIGINT":return 130;case"SIGKILL":return 137;case"SIGTERM":return 143;default:return 143}}var a=class extends i{name="AbortExecutionError";exitCode;constructor(t){super("execution aborted","aborted"),this.exitCode=E(t)}};function I(e){if(e?.aborted)throw new a(e.reason)}var f=class extends s{name="SubshellExitError";constructor(){super("subshell exit")}};function v(e){return e instanceof n||e instanceof o||e instanceof c}var b=class extends s{exitCode;name="PosixFatalError";constructor(t){super("posix fatal error"),this.exitCode=t}};export{n as a,o as b,c,x as d,u as e,p as f,d as g,l as h,m as i,h as j,i as k,E as l,a as m,I as n,f as o,v as p,b as q};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as Y}from"./chunk-J7ARATA6.js";import{a as V,b as X}from"./chunk-EKD22SYR.js";import{b as P,f as v,h as C}from"./chunk-6VQWCKYE.js";import{k as K}from"./chunk-463VWH7H.js";var q=(n,t,e)=>{let s=n instanceof RegExp?Q(n,e):n,r=t instanceof RegExp?Q(t,e):t,i=s!==null&&r!=null&&bt(s,r,e);return i&&{start:i[0],end:i[1],pre:e.slice(0,i[0]),body:e.slice(i[0]+s.length,i[1]),post:e.slice(i[1]+r.length)}},Q=(n,t)=>{let e=t.match(n);return e?e[0]:null},bt=(n,t,e)=>{let s,r,i,o,a,h=e.indexOf(n),f=e.indexOf(t,h+1),u=h;if(h>=0&&f>0){if(n===t)return[h,f];for(s=[],i=e.length;u>=0&&!a;){if(u===h)s.push(u),h=e.indexOf(n,u+1);else if(s.length===1){let d=s.pop();d!==void 0&&(a=[d,f])}else r=s.pop(),r!==void 0&&r<i&&(i=r,o=f),f=e.indexOf(t,u+1);u=h<f&&h>=0?h:f}s.length&&o!==void 0&&(a=[i,o])}return a};var tt="\0SLASH"+Math.random()+"\0",et="\0OPEN"+Math.random()+"\0",I="\0CLOSE"+Math.random()+"\0",st="\0COMMA"+Math.random()+"\0",nt="\0PERIOD"+Math.random()+"\0",Et=new RegExp(tt,"g"),At=new RegExp(et,"g"),Tt=new RegExp(I,"g"),Mt=new RegExp(st,"g"),vt=new RegExp(nt,"g"),Pt=/\\\\/g,Nt=/\\{/g,Ot=/\\}/g,zt=/\\,/g,Ct=/\\./g;function H(n){return isNaN(n)?n.charCodeAt(0):parseInt(n,10)}function Dt(n){return n.replace(Pt,tt).replace(Nt,et).replace(Ot,I).replace(zt,st).replace(Ct,nt)}function Rt(n){return n.replace(Et,"\\").replace(At,"{").replace(Tt,"}").replace(Mt,",").replace(vt,".")}function it(n){if(!n)return[""];let t=[],e=q("{","}",n);if(!e)return n.split(",");let{pre:s,body:r,post:i}=e,o=s.split(",");o[o.length-1]+="{"+r+"}";let a=it(i);return i.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),t.push.apply(t,o),t}function rt(n){return n?(n.slice(0,2)==="{}"&&(n="\\{\\}"+n.slice(2)),j(Dt(n),!0).map(Rt)):[]}function Wt(n){return"{"+n+"}"}function jt(n){return/^-?0\d/.test(n)}function Lt(n,t){return n<=t}function kt(n,t){return n>=t}function j(n,t){let e=[],s=q("{","}",n);if(!s)return[n];let r=s.pre,i=s.post.length?j(s.post,!1):[""];if(/\$$/.test(s.pre))for(let o=0;o<i.length;o++){let a=r+"{"+s.body+"}"+i[o];e.push(a)}else{let o=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),a=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),h=o||a,f=s.body.indexOf(",")>=0;if(!h&&!f)return s.post.match(/,(?!,).*\}/)?(n=s.pre+"{"+s.body+I+s.post,j(n)):[n];let u;if(h)u=s.body.split(/\.\./);else if(u=it(s.body),u.length===1&&u[0]!==void 0&&(u=j(u[0],!1).map(Wt),u.length===1))return i.map(l=>s.pre+u[0]+l);let d;if(h&&u[0]!==void 0&&u[1]!==void 0){let l=H(u[0]),c=H(u[1]),p=Math.max(u[0].length,u[1].length),g=u.length===3&&u[2]!==void 0?Math.abs(H(u[2])):1,w=Lt;c<l&&(g*=-1,w=kt);let x=u.some(jt);d=[];for(let y=l;w(y,c);y+=g){let m;if(a)m=String.fromCharCode(y),m==="\\"&&(m="");else if(m=String(y),x){let $=p-m.length;if($>0){let b=new Array($+1).join("0");y<0?m="-"+b+m.slice(1):m=b+m}}d.push(m)}}else{d=[];for(let l=0;l<u.length;l++)d.push.apply(d,j(u[l],!1))}for(let l=0;l<d.length;l++)for(let c=0;c<i.length;c++){let p=r+d[l]+i[c];(!t||h||p)&&e.push(p)}}return e}var L=n=>{if(typeof n!="string")throw new TypeError("invalid pattern");if(n.length>65536)throw new TypeError("pattern is too long")};var Ft={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},k=n=>n.replace(/[[\]\\-]/g,"\\$&"),Gt=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),ot=n=>n.join(""),at=(n,t)=>{let e=t;if(n.charAt(e)!=="[")throw new Error("not in a brace expression");let s=[],r=[],i=e+1,o=!1,a=!1,h=!1,f=!1,u=e,d="";t:for(;i<n.length;){let g=n.charAt(i);if((g==="!"||g==="^")&&i===e+1){f=!0,i++;continue}if(g==="]"&&o&&!h){u=i+1;break}if(o=!0,g==="\\"&&!h){h=!0,i++;continue}if(g==="["&&!h){for(let[w,[S,x,y]]of Object.entries(Ft))if(n.startsWith(w,i)){if(d)return["$.",!1,n.length-e,!0];i+=w.length,y?r.push(S):s.push(S),a=a||x;continue t}}if(h=!1,d){g>d?s.push(k(d)+"-"+k(g)):g===d&&s.push(k(g)),d="",i++;continue}if(n.startsWith("-]",i+1)){s.push(k(g+"-")),i+=2;continue}if(n.startsWith("-",i+1)){d=g,i+=2;continue}s.push(k(g)),i++}if(u<i)return["",!1,0,!1];if(!s.length&&!r.length)return["$.",!1,n.length-e,!0];if(r.length===0&&s.length===1&&/^\\?.$/.test(s[0])&&!f){let g=s[0].length===2?s[0].slice(-1):s[0];return[Gt(g),!1,u-e,!1]}let l="["+(f?"^":"")+ot(s)+"]",c="["+(f?"":"^")+ot(r)+"]";return[s.length&&r.length?"("+l+"|"+c+")":s.length?l:c,a,u-e,!0]};var N=(n,{windowsPathsNoEscape:t=!1,magicalBraces:e=!0}={})=>e?t?n.replace(/\[([^\/\\])\]/g,"$1"):n.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"):t?n.replace(/\[([^\/\\{}])\]/g,"$1"):n.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1");var Bt=new Set(["!","?","+","*","@"]),lt=n=>Bt.has(n),_t="(?!(?:^|/)\\.\\.?(?:$|/))",F="(?!\\.)",qt=new Set(["[","."]),Ht=new Set(["..","."]),It=new Set("().*{}+?[]^$\\!"),Jt=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),J="[^/]",ct=J+"*?",ht=J+"+?",D=class n{type;#s;#n;#r=!1;#t=[];#e;#o;#l;#a=!1;#i;#c;#u=!1;constructor(t,e,s={}){this.type=t,t&&(this.#n=!0),this.#e=e,this.#s=this.#e?this.#e.#s:this,this.#i=this.#s===this?s:this.#s.#i,this.#l=this.#s===this?[]:this.#s.#l,t==="!"&&!this.#s.#a&&this.#l.push(this),this.#o=this.#e?this.#e.#t.length:0}get hasMagic(){if(this.#n!==void 0)return this.#n;for(let t of this.#t)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#n=!0;return this.#n}toString(){return this.#c!==void 0?this.#c:this.type?this.#c=this.type+"("+this.#t.map(t=>String(t)).join("|")+")":this.#c=this.#t.map(t=>String(t)).join("")}#p(){if(this!==this.#s)throw new Error("should only call on root");if(this.#a)return this;this.toString(),this.#a=!0;let t;for(;t=this.#l.pop();){if(t.type!=="!")continue;let e=t,s=e.#e;for(;s;){for(let r=e.#o+1;!s.type&&r<s.#t.length;r++)for(let i of t.#t){if(typeof i=="string")throw new Error("string part in extglob AST??");i.copyIn(s.#t[r])}e=s,s=e.#e}}return this}push(...t){for(let e of t)if(e!==""){if(typeof e!="string"&&!(e instanceof n&&e.#e===this))throw new Error("invalid part: "+e);this.#t.push(e)}}toJSON(){let t=this.type===null?this.#t.slice().map(e=>typeof e=="string"?e:e.toJSON()):[this.type,...this.#t.map(e=>e.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#s||this.#s.#a&&this.#e?.type==="!")&&t.push({}),t}isStart(){if(this.#s===this)return!0;if(!this.#e?.isStart())return!1;if(this.#o===0)return!0;let t=this.#e;for(let e=0;e<this.#o;e++){let s=t.#t[e];if(!(s instanceof n&&s.type==="!"))return!1}return!0}isEnd(){if(this.#s===this||this.#e?.type==="!")return!0;if(!this.#e?.isEnd())return!1;if(!this.type)return this.#e?.isEnd();let t=this.#e?this.#e.#t.length:0;return this.#o===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let e=new n(this.type,t);for(let s of this.#t)e.copyIn(s);return e}static#h(t,e,s,r){let i=!1,o=!1,a=-1,h=!1;if(e.type===null){let c=s,p="";for(;c<t.length;){let g=t.charAt(c++);if(i||g==="\\"){i=!i,p+=g;continue}if(o){c===a+1?(g==="^"||g==="!")&&(h=!0):g==="]"&&!(c===a+2&&h)&&(o=!1),p+=g;continue}else if(g==="["){o=!0,a=c,h=!1,p+=g;continue}if(!r.noext&<(g)&&t.charAt(c)==="("){e.push(p),p="";let w=new n(g,e);c=n.#h(t,w,c,r),e.push(w);continue}p+=g}return e.push(p),c}let f=s+1,u=new n(null,e),d=[],l="";for(;f<t.length;){let c=t.charAt(f++);if(i||c==="\\"){i=!i,l+=c;continue}if(o){f===a+1?(c==="^"||c==="!")&&(h=!0):c==="]"&&!(f===a+2&&h)&&(o=!1),l+=c;continue}else if(c==="["){o=!0,a=f,h=!1,l+=c;continue}if(lt(c)&&t.charAt(f)==="("){u.push(l),l="";let p=new n(c,u);u.push(p),f=n.#h(t,p,f,r);continue}if(c==="|"){u.push(l),l="",d.push(u),u=new n(null,e);continue}if(c===")")return l===""&&e.#t.length===0&&(e.#u=!0),u.push(l),l="",e.push(...d,u),f;l+=c}return e.type=null,e.#n=void 0,e.#t=[t.substring(s-1)],f}static fromGlob(t,e={}){let s=new n(null,void 0,e);return n.#h(t,s,0,e),s}toMMPattern(){if(this!==this.#s)return this.#s.toMMPattern();let t=this.toString(),[e,s,r,i]=this.toRegExpSource();if(!(r||this.#n||this.#i.nocase&&!this.#i.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return s;let a=(this.#i.nocase?"i":"")+(i?"u":"");return Object.assign(new RegExp(`^${e}$`,a),{_src:e,_glob:t})}get options(){return this.#i}toRegExpSource(t){let e=t??!!this.#i.dot;if(this.#s===this&&this.#p(),!this.type){let h=this.isStart()&&this.isEnd()&&!this.#t.some(c=>typeof c!="string"),f=this.#t.map(c=>{let[p,g,w,S]=typeof c=="string"?n.#d(c,this.#n,h):c.toRegExpSource(t);return this.#n=this.#n||w,this.#r=this.#r||S,p}).join(""),u="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&Ht.has(this.#t[0]))){let p=qt,g=e&&p.has(f.charAt(0))||f.startsWith("\\.")&&p.has(f.charAt(2))||f.startsWith("\\.\\.")&&p.has(f.charAt(4)),w=!e&&!t&&p.has(f.charAt(0));u=g?_t:w?F:""}let d="";return this.isEnd()&&this.#s.#a&&this.#e?.type==="!"&&(d="(?:$|\\/)"),[u+f+d,N(f),this.#n=!!this.#n,this.#r]}let s=this.type==="*"||this.type==="+",r=this.type==="!"?"(?:(?!(?:":"(?:",i=this.#f(e);if(this.isStart()&&this.isEnd()&&!i&&this.type!=="!"){let h=this.toString();return this.#t=[h],this.type=null,this.#n=void 0,[h,N(this.toString()),!1,!1]}let o=!s||t||e||!F?"":this.#f(!0);o===i&&(o=""),o&&(i=`(?:${i})(?:${o})*?`);let a="";if(this.type==="!"&&this.#u)a=(this.isStart()&&!e?F:"")+ht;else{let h=this.type==="!"?"))"+(this.isStart()&&!e&&!t?F:"")+ct+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=r+i+h}return[a,N(i),this.#n=!!this.#n,this.#r]}#f(t){return this.#t.map(e=>{if(typeof e=="string")throw new Error("string type in extglob ast??");let[s,r,i,o]=e.toRegExpSource(t);return this.#r=this.#r||o,s}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join("|")}static#d(t,e,s=!1){let r=!1,i="",o=!1;for(let a=0;a<t.length;a++){let h=t.charAt(a);if(r){r=!1,i+=(It.has(h)?"\\":"")+h;continue}if(h==="\\"){a===t.length-1?i+="\\\\":r=!0;continue}if(h==="["){let[f,u,d,l]=at(t,a);if(d){i+=f,o=o||u,a+=d-1,e=e||l;continue}}if(h==="*"){i+=s&&t==="*"?ht:ct,e=!0;continue}if(h==="?"){i+=J,e=!0;continue}i+=Jt(h)}return[i,N(t),!!e,o]}};var U=(n,{windowsPathsNoEscape:t=!1,magicalBraces:e=!1}={})=>e?t?n.replace(/[?*()[\]{}]/g,"[$&]"):n.replace(/[?*()[\]\\{}]/g,"\\$&"):t?n.replace(/[?*()[\]]/g,"[$&]"):n.replace(/[?*()[\]\\]/g,"\\$&");var E=(n,t,e={})=>(L(t),!e.nocomment&&t.charAt(0)==="#"?!1:new R(t,e).match(n)),Ut=/^\*+([^+@!?\*\[\(]*)$/,Zt=n=>t=>!t.startsWith(".")&&t.endsWith(n),Kt=n=>t=>t.endsWith(n),Vt=n=>(n=n.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(n)),Xt=n=>(n=n.toLowerCase(),t=>t.toLowerCase().endsWith(n)),Yt=/^\*+\.\*+$/,Qt=n=>!n.startsWith(".")&&n.includes("."),te=n=>n!=="."&&n!==".."&&n.includes("."),ee=/^\.\*+$/,se=n=>n!=="."&&n!==".."&&n.startsWith("."),ne=/^\*+$/,ie=n=>n.length!==0&&!n.startsWith("."),re=n=>n.length!==0&&n!=="."&&n!=="..",oe=/^\?+([^+@!?\*\[\(]*)?$/,ae=([n,t=""])=>{let e=pt([n]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},le=([n,t=""])=>{let e=dt([n]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},ce=([n,t=""])=>{let e=dt([n]);return t?s=>e(s)&&s.endsWith(t):e},he=([n,t=""])=>{let e=pt([n]);return t?s=>e(s)&&s.endsWith(t):e},pt=([n])=>{let t=n.length;return e=>e.length===t&&!e.startsWith(".")},dt=([n])=>{let t=n.length;return e=>e.length===t&&e!=="."&&e!==".."},gt=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",ut={win32:{sep:"\\"},posix:{sep:"/"}},ue=gt==="win32"?ut.win32.sep:ut.posix.sep;E.sep=ue;var M=Symbol("globstar **");E.GLOBSTAR=M;var fe="[^/]",pe=fe+"*?",de="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",ge="(?:(?!(?:\\/|^)\\.).)*?",me=(n,t={})=>e=>E(e,n,t);E.filter=me;var T=(n,t={})=>Object.assign({},n,t),ye=n=>{if(!n||typeof n!="object"||!Object.keys(n).length)return E;let t=E;return Object.assign((s,r,i={})=>t(s,r,T(n,i)),{Minimatch:class extends t.Minimatch{constructor(r,i={}){super(r,T(n,i))}static defaults(r){return t.defaults(T(n,r)).Minimatch}},AST:class extends t.AST{constructor(r,i,o={}){super(r,i,T(n,o))}static fromGlob(r,i={}){return t.AST.fromGlob(r,T(n,i))}},unescape:(s,r={})=>t.unescape(s,T(n,r)),escape:(s,r={})=>t.escape(s,T(n,r)),filter:(s,r={})=>t.filter(s,T(n,r)),defaults:s=>t.defaults(T(n,s)),makeRe:(s,r={})=>t.makeRe(s,T(n,r)),braceExpand:(s,r={})=>t.braceExpand(s,T(n,r)),match:(s,r,i={})=>t.match(s,r,T(n,i)),sep:t.sep,GLOBSTAR:M})};E.defaults=ye;var mt=(n,t={})=>(L(n),t.nobrace||!/\{(?:(?!\{).)*\}/.test(n)?[n]:rt(n));E.braceExpand=mt;var we=(n,t={})=>new R(n,t).makeRe();E.makeRe=we;var Se=(n,t,e={})=>{let s=new R(t,e);return n=n.filter(r=>s.match(r)),s.options.nonull&&!n.length&&n.push(t),n};E.match=Se;var ft=/[?*]|[+@!]\(.*?\)|\[|\]/,xe=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),R=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,e={}){L(t),e=e||{},this.options=e,this.pattern=t,this.platform=e.platform||gt,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=e.windowsNoMagicRoot!==void 0?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let e of t)if(typeof e!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=(...i)=>console.error(...i)),this.debug(this.pattern,this.globSet);let s=this.globSet.map(i=>this.slashSplit(i));this.globParts=this.preprocess(s),this.debug(this.pattern,this.globParts);let r=this.globParts.map((i,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let h=i[0]===""&&i[1]===""&&(i[2]==="?"||!ft.test(i[2]))&&!ft.test(i[3]),f=/^[a-z]:/i.test(i[0]);if(h)return[...i.slice(0,4),...i.slice(4).map(u=>this.parse(u))];if(f)return[i[0],...i.slice(1).map(u=>this.parse(u))]}return i.map(h=>this.parse(h))});if(this.debug(this.pattern,r),this.set=r.filter(i=>i.indexOf(!1)===-1),this.isWindows)for(let i=0;i<this.set.length;i++){let o=this.set[i];o[0]===""&&o[1]===""&&this.globParts[i][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let s=0;s<t.length;s++)for(let r=0;r<t[s].length;r++)t[s][r]==="**"&&(t[s][r]="*");let{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):e>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(e=>{let s=-1;for(;(s=e.indexOf("**",s+1))!==-1;){let r=s;for(;e[r+1]==="**";)r++;r!==s&&e.splice(s,r-s)}return e})}levelOneOptimize(t){return t.map(e=>(e=e.reduce((s,r)=>{let i=s[s.length-1];return r==="**"&&i==="**"?s:r===".."&&i&&i!==".."&&i!=="."&&i!=="**"?(s.pop(),s):(s.push(r),s)},[]),e.length===0?[""]:e))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let r=1;r<t.length-1;r++){let i=t[r];r===1&&i===""&&t[0]===""||(i==="."||i==="")&&(e=!0,t.splice(r,1),r--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(e=!0,t.pop())}let s=0;for(;(s=t.indexOf("..",s+1))!==-1;){let r=t[s-1];r&&r!=="."&&r!==".."&&r!=="**"&&(e=!0,t.splice(s-1,2),s-=2)}}while(e);return t.length===0?[""]:t}firstPhasePreProcess(t){let e=!1;do{e=!1;for(let s of t){let r=-1;for(;(r=s.indexOf("**",r+1))!==-1;){let o=r;for(;s[o+1]==="**";)o++;o>r&&s.splice(r+1,o-r);let a=s[r+1],h=s[r+2],f=s[r+3];if(a!==".."||!h||h==="."||h===".."||!f||f==="."||f==="..")continue;e=!0,s.splice(r,1);let u=s.slice(0);u[r]="**",t.push(u),r--}if(!this.preserveMultipleSlashes){for(let o=1;o<s.length-1;o++){let a=s[o];o===1&&a===""&&s[0]===""||(a==="."||a==="")&&(e=!0,s.splice(o,1),o--)}s[0]==="."&&s.length===2&&(s[1]==="."||s[1]==="")&&(e=!0,s.pop())}let i=0;for(;(i=s.indexOf("..",i+1))!==-1;){let o=s[i-1];if(o&&o!=="."&&o!==".."&&o!=="**"){e=!0;let h=i===1&&s[i+1]==="**"?["."]:[];s.splice(i-1,2,...h),s.length===0&&s.push(""),i-=2}}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++)for(let s=e+1;s<t.length;s++){let r=this.partsMatch(t[e],t[s],!this.preserveMultipleSlashes);if(r){t[e]=[],t[s]=r;break}}return t.filter(e=>e.length)}partsMatch(t,e,s=!1){let r=0,i=0,o=[],a="";for(;r<t.length&&i<e.length;)if(t[r]===e[i])o.push(a==="b"?e[i]:t[r]),r++,i++;else if(s&&t[r]==="**"&&e[i]===t[r+1])o.push(t[r]),r++;else if(s&&e[i]==="**"&&t[r]===e[i+1])o.push(e[i]),i++;else if(t[r]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(a==="b")return!1;a="a",o.push(t[r]),r++,i++}else if(e[i]==="*"&&t[r]&&(this.options.dot||!t[r].startsWith("."))&&t[r]!=="**"){if(a==="a")return!1;a="b",o.push(e[i]),r++,i++}else return!1;return t.length===e.length&&o}parseNegate(){if(this.nonegate)return;let t=this.pattern,e=!1,s=0;for(let r=0;r<t.length&&t.charAt(r)==="!";r++)e=!e,s++;s&&(this.pattern=t.slice(s)),this.negate=e}matchOne(t,e,s=!1){let r=this.options;if(this.isWindows){let g=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),w=!g&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),S=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),x=!S&&e[0]===""&&e[1]===""&&e[2]==="?"&&typeof e[3]=="string"&&/^[a-z]:$/i.test(e[3]),y=w?3:g?0:void 0,m=x?3:S?0:void 0;if(typeof y=="number"&&typeof m=="number"){let[$,b]=[t[y],e[m]];$.toLowerCase()===b.toLowerCase()&&(e[m]=$,m>y?e=e.slice(m):y>m&&(t=t.slice(y)))}}let{optimizationLevel:i=1}=this.options;i>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var o=0,a=0,h=t.length,f=e.length;o<h&&a<f;o++,a++){this.debug("matchOne loop");var u=e[a],d=t[o];if(this.debug(e,u,d),u===!1)return!1;if(u===M){this.debug("GLOBSTAR",[e,u,d]);var l=o,c=a+1;if(c===f){for(this.debug("** at the end");o<h;o++)if(t[o]==="."||t[o]===".."||!r.dot&&t[o].charAt(0)===".")return!1;return!0}for(;l<h;){var p=t[l];if(this.debug(`
|
|
3
|
+
globstar while`,t,l,e,c,p),this.matchOne(t.slice(l),e.slice(c),s))return this.debug("globstar found match!",l,h,p),!0;if(p==="."||p===".."||!r.dot&&p.charAt(0)==="."){this.debug("dot detected!",t,l,e,c);break}this.debug("globstar swallow a segment, and continue"),l++}return!!(s&&(this.debug(`
|
|
4
|
+
>>> no match, partial?`,t,l,e,c),l===h))}let g;if(typeof u=="string"?(g=d===u,this.debug("string match",u,d,g)):(g=u.test(d),this.debug("pattern match",u,d,g)),!g)return!1}if(o===h&&a===f)return!0;if(o===h)return s;if(a===f)return o===h-1&&t[o]==="";throw new Error("wtf?")}braceExpand(){return mt(this.pattern,this.options)}parse(t){L(t);let e=this.options;if(t==="**")return M;if(t==="")return"";let s,r=null;(s=t.match(ne))?r=e.dot?re:ie:(s=t.match(Ut))?r=(e.nocase?e.dot?Xt:Vt:e.dot?Kt:Zt)(s[1]):(s=t.match(oe))?r=(e.nocase?e.dot?le:ae:e.dot?ce:he)(s):(s=t.match(Yt))?r=e.dot?te:Qt:(s=t.match(ee))&&(r=se);let i=D.fromGlob(t,this.options).toMMPattern();return r&&typeof i=="object"&&Reflect.defineProperty(i,"test",{value:r}),i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let e=this.options,s=e.noglobstar?pe:e.dot?de:ge,r=new Set(e.nocase?["i"]:[]),i=t.map(h=>{let f=h.map(d=>{if(d instanceof RegExp)for(let l of d.flags.split(""))r.add(l);return typeof d=="string"?xe(d):d===M?M:d._src});f.forEach((d,l)=>{let c=f[l+1],p=f[l-1];d!==M||p===M||(p===void 0?c!==void 0&&c!==M?f[l+1]="(?:\\/|"+s+"\\/)?"+c:f[l]=s:c===void 0?f[l-1]=p+"(?:\\/|\\/"+s+")?":c!==M&&(f[l-1]=p+"(?:\\/|\\/"+s+"\\/)"+c,f[l+1]=M))});let u=f.filter(d=>d!==M);if(this.partial&&u.length>=1){let d=[];for(let l=1;l<=u.length;l++)d.push(u.slice(0,l).join("/"));return"(?:"+d.join("|")+")"}return u.join("/")}).join("|"),[o,a]=t.length>1?["(?:",")"]:["",""];i="^"+o+i+a+"$",this.partial&&(i="^(?:\\/|"+o+i.slice(1,-1)+a+")$"),this.negate&&(i="^(?!"+i+").+$");try{this.regexp=new RegExp(i,[...r].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&e)return!0;let s=this.options;this.isWindows&&(t=t.split("\\").join("/"));let r=this.slashSplit(t);this.debug(this.pattern,"split",r);let i=this.set;this.debug(this.pattern,"set",i);let o=r[r.length-1];if(!o)for(let a=r.length-2;!o&&a>=0;a--)o=r[a];for(let a=0;a<i.length;a++){let h=i[a],f=r;if(s.matchBase&&h.length===1&&(f=[o]),this.matchOne(f,h,e))return s.flipNegate?!0:!this.negate}return s.flipNegate?!1:this.negate}static defaults(t){return E.defaults(t).Minimatch}};E.AST=D;E.Minimatch=R;E.escape=U;E.unescape=N;function G(n){if(n<1024)return String(n);if(n<1024*1024){let e=n/1024;return e<10?`${e.toFixed(1)}K`:`${Math.round(e)}K`}if(n<1024*1024*1024){let e=n/1048576;return e<10?`${e.toFixed(1)}M`:`${Math.round(e)}M`}let t=n/(1024*1024*1024);return t<10?`${t.toFixed(1)}G`:`${Math.round(t)}G`}function B(n){let e=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][n.getMonth()],s=String(n.getDate()).padStart(2," "),r=new Date,i=new Date(r.getTime()-4320*60*60*1e3);if(n>i){let a=String(n.getHours()).padStart(2,"0"),h=String(n.getMinutes()).padStart(2,"0");return`${e} ${s} ${a}:${h}`}let o=n.getFullYear();return`${e} ${s} ${o}`}var $e={name:"ls",summary:"list directory contents",usage:"ls [OPTION]... [FILE]...",options:["-a, --all do not ignore entries starting with .","-A, --almost-all do not list . and ..","-d, --directory list directories themselves, not their contents","-h, --human-readable with -l, print sizes like 1K 234M 2G etc.","-l use a long listing format","-r, --reverse reverse order while sorting","-R, --recursive list subdirectories recursively","-S sort by file size, largest first","-t sort by time, newest first","-1 list one file per line"," --help display this help and exit"]},be={showAll:{short:"a",long:"all",type:"boolean"},showAlmostAll:{short:"A",long:"almost-all",type:"boolean"},longFormat:{short:"l",type:"boolean"},humanReadable:{short:"h",long:"human-readable",type:"boolean"},recursive:{short:"R",long:"recursive",type:"boolean"},reverse:{short:"r",long:"reverse",type:"boolean"},sortBySize:{short:"S",type:"boolean"},directoryOnly:{short:"d",long:"directory",type:"boolean"},sortByTime:{short:"t",type:"boolean"},onePerLine:{short:"1",type:"boolean"}},Xe={name:"ls",async execute(n,t){let e=K(n);if(X(e))return V($e);let s=Y("ls",e,be);if(!s.ok)return s.error;let r=s.result.flags.showAll,i=s.result.flags.showAlmostAll,o=s.result.flags.longFormat,a=s.result.flags.humanReadable,h=s.result.flags.recursive,f=s.result.flags.reverse,u=s.result.flags.sortBySize,d=s.result.flags.directoryOnly,l=s.result.flags.sortByTime;s.result.flags.onePerLine;let c=s.result.positional;c.length===0&&c.push(".");let p="",g="",w=0;for(let S=0;S<c.length;S++){let x=c[S];if(S>0&&p&&!p.endsWith(`
|
|
5
|
+
|
|
6
|
+
`)&&(p+=`
|
|
7
|
+
`),d){let y=t.fs.resolvePath(t.cwd,x);try{let m=await t.fs.stat(y);if(o){let $=m.isDirectory?"drwxr-xr-x":"-rw-r--r--",b=m.isDirectory?"/":"",A=m.size??0,O=a?G(A).padStart(5):String(A).padStart(5),z=m.mtime??new Date(0),_=B(z);p+=`${$} 1 user user ${O} ${_} ${x}${b}
|
|
8
|
+
`}else p+=`${x}
|
|
9
|
+
`}catch{g+=`ls: cannot access '${x}': No such file or directory
|
|
10
|
+
`,w=2}continue}if(x.includes("*")||x.includes("?")||x.includes("[")){let y=await Ee(x,t,r,i,o,f,a,u);p+=await C(y.stdout),g+=await C(y.stderr),y.exitCode!==0&&(w=y.exitCode)}else{let y=await yt(x,t,r,i,o,h,c.length>1,f,a,u);p+=await C(y.stdout),g+=await C(y.stderr),y.exitCode!==0&&(w=y.exitCode)}}return{stdout:v(p),stderr:v(g),exitCode:w}}};async function Ee(n,t,e,s,r,i=!1,o=!1,a=!1){let h=e||s,f=t.fs.getAllPaths(),u=t.fs.resolvePath(t.cwd,"."),d=[];for(let l of f){let c=l.startsWith(u)&&l.slice(u.length+1)||l;if(E(c,n)||E(l,n)){let p=c.split("/").pop()||c;if(!h&&p.startsWith("."))continue;d.push(c||l)}}if(d.length===0)return{stdout:P(),stderr:v(`ls: ${n}: No such file or directory
|
|
11
|
+
`),exitCode:2};if(a){let l=[];for(let c of d){let p=t.fs.resolvePath(t.cwd,c);try{let g=await t.fs.stat(p);l.push({path:c,size:g.size??0})}catch{l.push({path:c,size:0})}}l.sort((c,p)=>p.size-c.size),d.length=0,d.push(...l.map(c=>c.path))}else d.sort();if(i&&d.reverse(),r){let l=[];for(let c of d){let p=t.fs.resolvePath(t.cwd,c);try{let g=await t.fs.stat(p),w=g.isDirectory?"drwxr-xr-x":"-rw-r--r--",S=g.isDirectory?"/":"",x=g.size??0,y=o?G(x).padStart(5):String(x).padStart(5),m=g.mtime??new Date(0),$=B(m);l.push(`${w} 1 user user ${y} ${$} ${c}${S}`)}catch{l.push(`-rw-r--r-- 1 user user 0 Jan 1 00:00 ${c}`)}}return{stdout:v(`${l.join(`
|
|
12
|
+
`)}
|
|
13
|
+
`),stderr:P(),exitCode:0}}return{stdout:v(`${d.join(`
|
|
14
|
+
`)}
|
|
15
|
+
`),stderr:P(),exitCode:0}}async function yt(n,t,e,s,r,i,o,a=!1,h=!1,f=!1,u=!1){let d=e||s,l=t.fs.resolvePath(t.cwd,n);try{let c=await t.fs.stat(l);if(!c.isDirectory){if(r){let w=c.size??0,S=h?G(w).padStart(5):String(w).padStart(5),x=c.mtime??new Date(0),y=B(x);return{stdout:v(`-rw-r--r-- 1 user user ${S} ${y} ${n}
|
|
16
|
+
`),stderr:P(),exitCode:0}}return{stdout:v(`${n}
|
|
17
|
+
`),stderr:P(),exitCode:0}}let p=await t.fs.readdir(l);if(d||(p=p.filter(w=>!w.startsWith("."))),f){let w=[];for(let S of p){let x=l==="/"?`/${S}`:`${l}/${S}`;try{let y=await t.fs.stat(x);w.push({name:S,size:y.size??0})}catch{w.push({name:S,size:0})}}w.sort((S,x)=>x.size-S.size),p=w.map(S=>S.name)}else p.sort();e&&(p=[".","..",...p]),a&&p.reverse();let g="";if((i||o)&&(g+=`${n}:
|
|
18
|
+
`),r){g+=`total ${p.length}
|
|
19
|
+
`;let w=p.filter(m=>m==="."||m===".."),S=p.filter(m=>m!=="."&&m!=="..");for(let m of w)g+=`drwxr-xr-x 1 user user 0 Jan 1 00:00 ${m}
|
|
20
|
+
`;let x=[];for(let m=0;m<S.length;m+=100){let $=S.slice(m,m+100),b=await Promise.all($.map(async A=>{let O=l==="/"?`/${A}`:`${l}/${A}`;try{let z=await t.fs.stat(O),_=z.isDirectory?"drwxr-xr-x":"-rw-r--r--",wt=z.isDirectory?"/":"",Z=z.size??0,St=h?G(Z).padStart(5):String(Z).padStart(5),xt=z.mtime??new Date(0),$t=B(xt);return{name:A,line:`${_} 1 user user ${St} ${$t} ${A}${wt}
|
|
21
|
+
`}}catch{return{name:A,line:`-rw-r--r-- 1 user user 0 Jan 1 00:00 ${A}
|
|
22
|
+
`}}}));x.push(...b)}let y=new Map(S.map((m,$)=>[m,$]));x.sort((m,$)=>(y.get(m.name)??0)-(y.get($.name)??0));for(let{line:m}of x)g+=m}else g+=p.join(`
|
|
23
|
+
`)+(p.length?`
|
|
24
|
+
`:"");if(i){let w=p.filter(y=>y!=="."&&y!==".."),S=[];if(t.fs.readdirWithFileTypes)S=(await t.fs.readdirWithFileTypes(l)).filter(m=>m.isDirectory&&w.includes(m.name)).map(m=>({name:m.name,isDirectory:!0}));else for(let y=0;y<w.length;y+=100){let m=w.slice(y,y+100),$=await Promise.all(m.map(async b=>{let A=l==="/"?`/${b}`:`${l}/${b}`;try{let O=await t.fs.stat(A);return{name:b,isDirectory:O.isDirectory}}catch{return{name:b,isDirectory:!1}}}));S.push(...$.filter(b=>b.isDirectory))}S.sort((y,m)=>y.name.localeCompare(m.name)),a&&S.reverse();let x=[];for(let y=0;y<S.length;y+=100){let m=S.slice(y,y+100),$=await Promise.all(m.map(async b=>{let A=n==="."?`./${b.name}`:`${n}/${b.name}`,O=await yt(A,t,e,s,r,i,!1,a,h,f,!0);return{name:b.name,result:O}}));x.push(...$)}x.sort((y,m)=>y.name.localeCompare(m.name)),a&&x.reverse();for(let{result:y}of x)g+=`
|
|
25
|
+
`,g+=await C(y.stdout)}return{stdout:v(g),stderr:P(),exitCode:0}}catch{return{stdout:P(),stderr:v(`ls: ${n}: No such file or directory
|
|
26
|
+
`),exitCode:2}}}var Ye={name:"ls",flags:[{flag:"-a",type:"boolean"},{flag:"-A",type:"boolean"},{flag:"-l",type:"boolean"},{flag:"-h",type:"boolean"},{flag:"-R",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-S",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-t",type:"boolean"},{flag:"-1",type:"boolean"}],needsFiles:!0};export{Xe as a,Ye as b};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{m as u,n as p}from"./chunk-A257OMG4.js";import{a as m,b as d}from"./chunk-EKD22SYR.js";import{b as o,f as i}from"./chunk-6VQWCKYE.js";import{k as l}from"./chunk-463VWH7H.js";var c={name:"sleep",summary:"delay for a specified amount of time",usage:"sleep NUMBER[SUFFIX]",description:`Pause for NUMBER seconds. SUFFIX may be:
|
|
3
|
+
s - seconds (default)
|
|
4
|
+
m - minutes
|
|
5
|
+
h - hours
|
|
6
|
+
d - days
|
|
7
|
+
|
|
8
|
+
NUMBER may be a decimal number.`,options:[" --help display this help and exit"]};function f(s){let e=s.match(/^(\d+\.?\d*)(s|m|h|d)?$/);if(!e)return null;let t=parseFloat(e[1]);switch(e[2]||"s"){case"s":return t*1e3;case"m":return t*60*1e3;case"h":return t*60*60*1e3;case"d":return t*24*60*60*1e3;default:return null}}function h(s,e){return new Promise((t,r)=>{if(e?.aborted){r(new u(e.reason));return}let n=()=>{clearTimeout(a),r(new u(e?.reason))},a=setTimeout(()=>{e?.removeEventListener("abort",n),t()},s);e?.addEventListener("abort",n,{once:!0})})}var w={name:"sleep",async execute(s,e){let t=l(s);if(d(t))return m(c);if(t.length===0)return{stdout:o(),stderr:i(`sleep: missing operand
|
|
9
|
+
`),exitCode:1};let r=0;for(let n of t){let a=f(n);if(a===null)return{stdout:o(),stderr:i(`sleep: invalid time interval '${n}'
|
|
10
|
+
`),exitCode:1};r+=a}return e.sleep?(await e.sleep(r,e.signal),p(e.signal)):await h(r,e.signal),{stdout:o(),stderr:o(),exitCode:0}}},E={name:"sleep",flags:[],needsArgs:!0};export{w as a,E as b};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as K}from"./chunk-N7YAMUQG.js";import{j as D,k as G}from"./chunk-6VQWCKYE.js";function q(t,n){return t.replace(/\$(&|\d+|<([^>]+)>)/g,(e,i,l)=>{if(i==="&")return n[0];if(l!==void 0)return n.groups?.[l]??"";let a=parseInt(i,10);return n[a]??""})}function W(t,n,e={}){let{invertMatch:i=!1,showLineNumbers:l=!1,countOnly:a=!1,countMatches:d=!1,filename:h="",onlyMatching:w=!1,beforeContext:M=0,afterContext:v=0,maxCount:g=0,contextSeparator:E="--",showColumn:O=!1,vimgrep:N=!1,showByteOffset:Z=!1,replace:P=null,passthru:T=!1,multiline:j=!1,kResetGroup:z}=e;if(j)return X(t,n,{invertMatch:i,showLineNumbers:l,countOnly:a,countMatches:d,filename:h,onlyMatching:w,beforeContext:M,afterContext:v,maxCount:g,contextSeparator:E,showColumn:O,showByteOffset:Z,replace:P,kResetGroup:z});let S=t.split(`
|
|
3
|
+
`),B=S.length,A=B>0&&S[B-1]===""?B-1:B;if(a||d){let f=0,m=(d||w)&&!i;for(let s=0;s<A;s++)if(n.lastIndex=0,m)for(let u=n.exec(S[s]);u!==null;u=n.exec(S[s]))f++,u[0].length===0&&n.lastIndex++;else n.test(S[s])!==i&&f++;return{output:`${h?`${h}:${f}`:String(f)}
|
|
4
|
+
`,matched:f>0,matchCount:f}}if(M===0&&v===0&&!T){let f=[],m=!1,c=0,s=0;for(let u=0;u<A&&!(g>0&&c>=g);u++){let C=S[u];if(n.lastIndex=0,n.test(C)!==i)if(m=!0,c++,w){n.lastIndex=0;for(let r=n.exec(C);r!==null;r=n.exec(C)){let b=z!==void 0?r[z]??"":r[0],U=P!==null?q(P,r):b,$=h?`${h}:`:"";Z&&($+=`${s+r.index}:`),l&&($+=`${u+1}:`),O&&($+=`${r.index+1}:`),f.push($+U),r[0].length===0&&n.lastIndex++}}else if(N){n.lastIndex=0;for(let r=n.exec(C);r!==null;r=n.exec(C)){let b=h?`${h}:`:"";Z&&(b+=`${s+r.index}:`),l&&(b+=`${u+1}:`),O&&(b+=`${r.index+1}:`),f.push(b+C),r[0].length===0&&n.lastIndex++}}else{n.lastIndex=0;let r=n.exec(C),b=r?r.index+1:1,U=C;P!==null&&(n.lastIndex=0,U=n.replace(C,(...L)=>{if(L[0].length===0)return"";let R=L,F=L[L.length-1];return typeof F=="object"&&F!==null?(R.groups=F,R.input=L[L.length-2],R.index=L[L.length-3]):(R.input=L[L.length-1],R.index=L[L.length-2]),q(P,R)}));let $=h?`${h}:`:"";Z&&($+=`${s+(r?r.index:0)}:`),l&&($+=`${u+1}:`),O&&($+=`${b}:`),f.push($+U)}s+=C.length+1}return{output:f.length>0?`${f.join(`
|
|
5
|
+
`)}
|
|
6
|
+
`:"",matched:m,matchCount:c}}if(T){let f=[],m=!1,c=0;for(let s=0;s<A;s++){let u=S[s];n.lastIndex=0;let I=n.test(u)!==i;I&&(m=!0,c++);let r=I?":":"-",b=h?`${h}${r}`:"";l&&(b+=`${s+1}${r}`),f.push(b+u)}return{output:f.length>0?`${f.join(`
|
|
7
|
+
`)}
|
|
8
|
+
`:"",matched:m,matchCount:c}}let k=[],p=0,x=new Set,y=-1,o=[];for(let f=0;f<A&&!(g>0&&p>=g);f++)n.lastIndex=0,n.test(S[f])!==i&&(o.push(f),p++);for(let f of o){let m=Math.max(0,f-M);y>=0&&m>y+1&&k.push(E);for(let s=m;s<f;s++)if(!x.has(s)){x.add(s),y=s;let u=S[s];l&&(u=`${s+1}-${u}`),h&&(u=`${h}-${u}`),k.push(u)}if(!x.has(f)){x.add(f),y=f;let s=S[f];if(w){n.lastIndex=0;for(let u=n.exec(s);u!==null;u=n.exec(s)){let C=z!==void 0?u[z]??"":u[0],I=P!==null?P:C,r=h?`${h}:`:"";l&&(r+=`${f+1}:`),O&&(r+=`${u.index+1}:`),k.push(r+I),u[0].length===0&&n.lastIndex++}}else{let u=s;l&&(u=`${f+1}:${u}`),h&&(u=`${h}:${u}`),k.push(u)}}let c=Math.min(A-1,f+v);for(let s=f+1;s<=c;s++)if(!x.has(s)){x.add(s),y=s;let u=S[s];l&&(u=`${s+1}-${u}`),h&&(u=`${h}-${u}`),k.push(u)}}return{output:k.length>0?`${k.join(`
|
|
9
|
+
`)}
|
|
10
|
+
`:"",matched:p>0,matchCount:p}}function X(t,n,e){let{invertMatch:i,showLineNumbers:l,countOnly:a,countMatches:d,filename:h,onlyMatching:w,beforeContext:M,afterContext:v,maxCount:g,contextSeparator:E,showColumn:O,showByteOffset:N,replace:Z,kResetGroup:P}=e,T=t.split(`
|
|
11
|
+
`),j=T.length,z=j>0&&T[j-1]===""?j-1:j,S=[0];for(let o=0;o<t.length;o++)t[o]===`
|
|
12
|
+
`&&S.push(o+1);let B=o=>{let f=0;for(let m=0;m<S.length&&!(S[m]>o);m++)f=m;return f},A=o=>{let f=B(o);return o-S[f]+1},k=[];n.lastIndex=0;for(let o=n.exec(t);o!==null&&!(g>0&&k.length>=g);o=n.exec(t)){let f=B(o.index),m=B(o.index+Math.max(0,o[0].length-1)),c=P!==void 0?o[P]??"":o[0];k.push({startLine:f,endLine:m,byteOffset:o.index,column:A(o.index),matchText:c}),o[0].length===0&&n.lastIndex++}if(a||d){let o;if(d)o=i?0:k.length;else{let m=new Set;for(let c of k)for(let s=c.startLine;s<=c.endLine;s++)m.add(s);o=i?z-m.size:m.size}return{output:`${h?`${h}:${o}`:String(o)}
|
|
13
|
+
`,matched:o>0,matchCount:o}}if(i){let o=new Set;for(let m of k)for(let c=m.startLine;c<=m.endLine;c++)o.add(c);let f=[];for(let m=0;m<z;m++)if(!o.has(m)){let c=T[m];l&&(c=`${m+1}:${c}`),h&&(c=`${h}:${c}`),f.push(c)}return{output:f.length>0?`${f.join(`
|
|
14
|
+
`)}
|
|
15
|
+
`:"",matched:f.length>0,matchCount:f.length}}if(k.length===0)return{output:"",matched:!1,matchCount:0};let p=new Set,x=-1,y=[];for(let o of k){let f=Math.max(0,o.startLine-M),m=Math.min(z-1,o.endLine+v);x>=0&&f>x+1&&y.push(E);for(let c=f;c<o.startLine;c++)if(!p.has(c)){p.add(c),x=c;let s=T[c];l&&(s=`${c+1}-${s}`),h&&(s=`${h}-${s}`),y.push(s)}if(w){let c=Z!==null?Z:o.matchText,s=h?`${h}:`:"";N&&(s+=`${o.byteOffset}:`),l&&(s+=`${o.startLine+1}:`),O&&(s+=`${o.column}:`),y.push(s+c);for(let u=o.startLine;u<=o.endLine;u++)p.add(u),x=u}else for(let c=o.startLine;c<=o.endLine&&c<z;c++)if(!p.has(c)){p.add(c),x=c;let s=T[c];Z!==null&&c===o.startLine&&(n.lastIndex=0,s=n.replace(s,Z));let u=h?`${h}:`:"";N&&c===o.startLine&&(u+=`${o.byteOffset}:`),l&&(u+=`${c+1}:`),O&&c===o.startLine&&(u+=`${o.column}:`),y.push(u+s)}for(let c=o.endLine+1;c<=m;c++)if(!p.has(c)){p.add(c),x=c;let s=T[c];l&&(s=`${c+1}-${s}`),h&&(s=`${h}-${s}`),y.push(s)}}return{output:y.length>0?`${y.join(`
|
|
16
|
+
`)}
|
|
17
|
+
`:"",matched:!0,matchCount:k.length}}var J=new Map([["alpha","a-zA-Z"],["digit","0-9"],["alnum","a-zA-Z0-9"],["lower","a-z"],["upper","A-Z"],["xdigit","0-9A-Fa-f"],["space"," \\t\\n\\r\\f\\v"],["blank"," \\t"],["punct","!-/:-@\\[-`{-~"],["graph","!-~"],["print"," -~"],["cntrl","\\x00-\\x1F\\x7F"],["ascii","\\x00-\\x7F"],["word","a-zA-Z0-9_"]]);function H(t){let n="",e=0;for(;e<t.length;){if(t.slice(e,e+7)==="[[:<:]]"){n+="\\b",e+=7;continue}if(t.slice(e,e+7)==="[[:>:]]"){n+="\\b",e+=7;continue}if(t[e]==="["){let i="[";for(e++,e<t.length&&(t[e]==="^"||t[e]==="!")&&(i+="^",e++),e<t.length&&t[e]==="]"&&(i+="\\]",e++);e<t.length&&t[e]!=="]";){if(t[e]==="["&&e+1<t.length&&t[e+1]===":"){let l=t.indexOf(":]",e+2);if(l!==-1){let a=t.slice(e+2,l),d=J.get(a);if(d){i+=d,e=l+2;continue}}}if(t[e]==="\\"&&e+1<t.length){i+=t[e]+t[e+1],e+=2;continue}i+=t[e],e++}e<t.length&&t[e]==="]"&&(i+="]",e++),n+=i;continue}if(t[e]==="\\"&&e+1<t.length){n+=t[e]+t[e+1],e+=2;continue}n+=t[e],e++}return n}function V(t,n){let e,i;switch(n.mode){case"fixed":e=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");break;case"extended":case"perl":{if(e=H(t),e=e.replace(/\(\?P<([^>]+)>/g,"(?<$1>"),n.mode==="perl"){e=Y(e),e=ee(e),e=te(e);let d=se(e);e=d.pattern,i=d.kResetGroup}break}default:e=H(t),e=ue(e);break}n.wholeWord&&(e=`\\b(?:${e})\\b`),n.lineRegexp&&(e=`^${e}$`);let l=/\\u\{[0-9A-Fa-f]+\}/.test(e),a="g"+(n.ignoreCase?"i":"")+(n.multiline?"m":"")+(n.multilineDotall?"s":"")+(l?"u":"");return{regex:K(e,a),kResetGroup:i}}function Y(t){let n="",e=0;for(;e<t.length;)if(t[e]==="\\"&&e+1<t.length&&t[e+1]==="Q"){e+=2;let i="";for(;e<t.length;){if(t[e]==="\\"&&e+1<t.length&&t[e+1]==="E"){e+=2;break}i+=t[e],e++}n+=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}else n+=t[e],e++;return n}function ee(t){return t.replace(/\\x\{([0-9A-Fa-f]+)\}/g,"\\u{$1}")}function te(t){let n="",e=0;for(;e<t.length;){if(t[e]==="("&&e+1<t.length&&t[e+1]==="?"){let i=t.slice(e).match(/^\(\?([imsx]*)(-[imsx]*)?(:|$|\))/);if(i){let l=i[1]||"",a=i[2]||"",d=i[3];if(d===":"){let h=e+i[0].length-1,w=ne(t,e);if(w!==-1){let M=t.slice(h+1,w),v=ie(M,l,a);n+=`(?:${v})`,e=w+1;continue}}else if(d===")"||d===""){e+=i[0].length;continue}}}n+=t[e],e++}return n}function ne(t,n){let e=0,i=n;for(;i<t.length;){if(t[i]==="\\"){i+=2;continue}if(t[i]==="["){for(i++;i<t.length&&t[i]!=="]";)t[i]==="\\"&&i++,i++;i++;continue}if(t[i]==="(")e++;else if(t[i]===")"&&(e--,e===0))return i;i++}return-1}function ie(t,n,e){let i=t;return n.includes("i")&&(i=le(i)),i}function le(t){let n="",e=0;for(;e<t.length;){let i=t[e];if(i==="\\"){e+1<t.length?(n+=i+t[e+1],e+=2):(n+=i,e++);continue}if(i==="["){n+=i,e++,e<t.length&&t[e]==="^"&&(n+=t[e],e++);let l=[];for(;e<t.length&&t[e]!=="]";)if(t[e]==="\\")l.push(t[e]),e++,e<t.length&&(l.push(t[e]),e++);else if(t[e]==="-"&&l.length>0&&e+1<t.length&&t[e+1]!=="]"){let a=l[l.length-1],d=t[e+1];l.push("-"),l.push(d),/[a-z]/.test(a)&&/[a-z]/.test(d)?(l.push(a.toUpperCase()),l.push("-"),l.push(d.toUpperCase())):/[A-Z]/.test(a)&&/[A-Z]/.test(d)&&(l.push(a.toLowerCase()),l.push("-"),l.push(d.toLowerCase())),e+=2}else{let a=t[e];if(l.push(a),/[a-zA-Z]/.test(a)){let d=a===a.toLowerCase()?a.toUpperCase():a.toLowerCase();l.includes(d)||l.push(d)}e++}n+=l.join(""),e<t.length&&(n+=t[e],e++);continue}if(/[a-zA-Z]/.test(i)){let l=i.toLowerCase(),a=i.toUpperCase();n+=`[${a}${l}]`}else n+=i;e++}return n}function se(t){let n=oe(t);if(n===-1)return{pattern:t};let e=t.slice(0,n),i=t.slice(n+2),l=ce(e);return{pattern:`(?:${e})(${i})`,kResetGroup:l+1}}function oe(t){let n=0;for(;n<t.length-1;)if(t[n]==="\\"){if(t[n+1]==="K"){let e=0,i=n-1;for(;i>=0&&t[i]==="\\";)e++,i--;if(e%2===0)return n}n+=2}else n++;return-1}function ce(t){let n=0,e=0;for(;e<t.length;){if(t[e]==="\\"){e+=2;continue}if(t[e]==="["){for(e++;e<t.length&&t[e]!=="]";)t[e]==="\\"&&e++,e++;e++;continue}if(t[e]==="(")if(e+1<t.length&&t[e+1]==="?"){if(e+2<t.length){let i=t[e+2];if(i===":"||i==="="||i==="!"){e++;continue}if(i==="<"&&e+3<t.length){let l=t[e+3];if(l==="="||l==="!"){e++;continue}n++,e++;continue}}}else n++;e++}return n}function fe(t){let n=t.replace(/\$\{0\}|\$0(?![0-9])/g,"$$&");return n=n.replace(/\$\{([^0-9}][^}]*)\}/g,"$$<$1>"),n=n.replace(/\$([a-zA-Z_][a-zA-Z0-9_]*)(?![>0-9])/g,"$$<$1>"),n}function ue(t){let n="",e=0,i=!0,l=0;for(;e<t.length;){let a=t[e];if(a==="["){for(n+=a,e++,e<t.length&&(t[e]==="^"||t[e]==="!")&&(n+=t[e],e++),e<t.length&&t[e]==="]"&&(n+=t[e],e++);e<t.length&&t[e]!=="]";)t[e]==="\\"&&e+1<t.length?(n+=t[e]+t[e+1],e+=2):(n+=t[e],e++);e<t.length&&t[e]==="]"&&(n+=t[e],e++),i=!1;continue}if(a==="\\"&&e+1<t.length){let d=t[e+1];if(d==="|"){n+="|",e+=2,i=!0;continue}if(d==="("){n+="(",e+=2,l++,i=!0;continue}if(d===")"){n+=")",e+=2,l=Math.max(0,l-1),i=!1;continue}if(d==="{"){let w=t.slice(e).match(/^\\{(\d+)(,(\d*)?)?\\}/);if(w){let M=w[1],v=w[2]!==void 0,g=w[3]||"";v?n+=`{${M},${g}}`:n+=`{${M}}`,e+=w[0].length,i=!1;continue}n+="\\{",e+=2,i=!1;continue}if(d==="}"){n+="\\}",e+=2,i=!1;continue}n+=a+d,e+=2,i=!1;continue}if(a==="*"&&i){n+="\\*",e++;continue}if(a==="^"){if(i){n+="^",e++;continue}n+="\\^",e++;continue}if(a==="$"){let d=e===t.length-1,h=e+2<t.length&&t[e+1]==="\\"&&t[e+2]===")";d||h?n+="$":n+="\\$",e++,i=!1;continue}a==="+"||a==="?"||a==="|"||a==="("||a===")"||a==="{"||a==="}"?n+=`\\${a}`:n+=a,e++,i=!1}return n}var ae=new TextEncoder;function he(t){return!t.multiline&&!t.vimgrep&&!t.showByteOffset}async function re(t,n){let e=n.literalAlternation;if(e!==null&&!e.every(l=>l.includes(`
|
|
18
|
+
`))){let l=e.filter(g=>!g.includes(`
|
|
19
|
+
`)),a=new TextDecoder,d=Math.max(...l.map(g=>g.length),1)-1,h="",w=!1;for await(let g of D(t)){let E=h+a.decode(g,{stream:!0});E.length>0&&(w=!0);let O=n.ignoreCase?E.toLowerCase():E;for(let N of l)if(O.includes(N))return!0;h=d>0?E.slice(-d):""}let M=h+a.decode();if(M.length>0&&(w=!0),!w)return!1;let v=n.ignoreCase?M.toLowerCase():M;return l.some(g=>v.includes(g))}let i=new TextDecoder;for await(let l of G(t))if(n.lastIndex=0,n.test(i.decode(l)))return!0;return!1}function de(t,n,e={}){let{invertMatch:i=!1,showLineNumbers:l=!1,countOnly:a=!1,countMatches:d=!1,filename:h="",onlyMatching:w=!1,beforeContext:M=0,afterContext:v=0,maxCount:g=0,contextSeparator:E="--",showColumn:O=!1,replace:N=null,passthru:Z=!1,kResetGroup:P}=e,T,j,z=new Promise(A=>{T=A}),S=new Promise(A=>{j=A});return{output:new ReadableStream({async start(A){let k=new TextDecoder,p=0,x=0,y=!1,o=[],f=0,m=0,c=h?`${h}:`:"",s=h?`${h}-`:"",u=(I,r,b)=>{let U=b?":":"-",$=h?b?c:s:"",L=l?`${r}${U}`:"";if(O&&b){n.lastIndex=0;let _=n.exec(I),R=_?_.index+1:0;return`${$}${L}${R}${U}${I}
|
|
20
|
+
`}return`${$}${L}${I}
|
|
21
|
+
`},C=I=>{I.length>0&&A.enqueue(ae.encode(I))};try{for await(let I of G(t)){p++;let r=k.decode(I);n.lastIndex=0;let b;if(d||w&&!i?(b=n.test(r),n.lastIndex=0):b=n.test(r),i&&(b=!b),b){if(y=!0,a){if(x++,g>0&&x>=g)break;continue}if(d){n.lastIndex=0;for(let $=n.exec(r);$!==null;$=n.exec(r))x++,$[0].length===0&&n.lastIndex++;continue}let U=o.length>0?o[0].n:p;(M>0||v>0)&&m>0&&U>m+1&&C(`${E}
|
|
22
|
+
`);for(let $ of o)C($.text),m=$.n;if(o.length=0,w){n.lastIndex=0;for(let $=n.exec(r);$!==null;$=n.exec(r)){let L=P!==void 0&&$[P]!==void 0?$[P]:$[0],_=N!==null?Q(N,$):L;C(u(_,p,!0)),x++,$[0].length===0&&n.lastIndex++}}else{let $=r;if(N!==null){n.lastIndex=0;let L=[],_=0,R=n.exec(r);for(;R!==null;)L.push(r.slice(_,R.index)),L.push(Q(N,R)),_=R.index+R[0].length,R[0].length===0&&n.lastIndex++,R=n.exec(r);L.push(r.slice(_)),$=L.join("")}C(u($,p,!0)),m=p,x++}f=v}else if(f>0){if(C(u(r,p,!1)),m=p,f--,f===0&&g>0&&x>=g)break}else if(Z)C(u(r,p,!1)),m=p;else if(M>0)for(o.push({n:p,text:u(r,p,!1)});o.length>M;)o.shift();if(g>0&&x>=g&&f===0)break}if(a){let I=h?`${h}:${x}`:String(x);C(`${I}
|
|
23
|
+
`)}else if(d){let I=h?`${h}:${x}`:String(x);C(`${I}
|
|
24
|
+
`)}A.close(),T(y),j(x)}catch(I){A.error(I),T(y),j(x)}}}),matched:z,matchCount:S}}function Q(t,n){return t.replace(/\$(&|\d+|<([^>]+)>)/g,(e,i,l)=>{if(i==="&")return n[0];if(l!==void 0)return n.groups?.[l]??"";let a=parseInt(i,10);return n[a]??""})}export{W as a,V as b,fe as c,he as d,re as e,de as f};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as c,b as p}from"./chunk-EKD22SYR.js";import{b as r,f as m}from"./chunk-6VQWCKYE.js";import{k as a,l,m as h}from"./chunk-463VWH7H.js";var S={name:"history",summary:"display command history",usage:"history [n]",options:["-c clear the history list"," --help display this help and exit"]},y="BASH_HISTORY",v={name:"history",async execute(d,s){let e=a(d);if(p(e))return c(S);let g=l(s.env,y,"[]"),t;try{t=JSON.parse(g)}catch{t=[]}if(e[0]==="-c")return h(s.env,y,"[]"),{stdout:r(),stderr:r(),exitCode:0};let n=t.length;e[0]&&/^\d+$/.test(e[0])&&(n=Math.min(parseInt(e[0],10),t.length));let u=t.length-n,i="";for(let o=u;o<t.length;o++){let f=(o+1).toString().padStart(5," ");i+=`${f} ${t[o]}
|
|
3
|
+
`}return{stdout:m(i),stderr:r(),exitCode:0}}},F={name:"history",flags:[{flag:"-c",type:"boolean"}]};export{v as a,F as b};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as P}from"./chunk-4VDEBYW7.js";import{a as C}from"./chunk-J7ARATA6.js";import{a as $,b as w}from"./chunk-EKD22SYR.js";import{b as p,f as s}from"./chunk-6VQWCKYE.js";import{k as y}from"./chunk-463VWH7H.js";var A={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"]},D={force:{short:"f",long:"force",type:"boolean"},noClobber:{short:"n",long:"no-clobber",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"}},H={name:"mv",async execute(E,t){let d=y(E);if(w(d))return $(A);let r=C("mv",d,D);if(!r.ok)return r.error;let g=r.result.flags.force,v=r.result.flags.noClobber,N=r.result.flags.verbose,f=r.result.positional;if(v&&(g=!1),f.length<2)return{stdout:p(),stderr:s(`mv: missing destination file operand
|
|
3
|
+
`),exitCode:1};let n=f.pop()??"",b=f,a=t.fs.resolvePath(t.cwd,n),u="",c="",h=0,i=!1;try{i=(await t.fs.stat(a)).isDirectory}catch{}if(b.length>1&&!i)return{stdout:p(),stderr:s(`mv: target '${n}' is not a directory
|
|
4
|
+
`),exitCode:1};for(let e of b)try{let m=t.fs.resolvePath(t.cwd,e),o=a;if(i){let l=e.split("/").pop()||e;o=a==="/"?`/${l}`:`${a}/${l}`}if(v)try{await t.fs.stat(o);continue}catch{}if(await t.fs.mv(m,o),N){let l=i?`${n}/${e.split("/").pop()||e}`:n;u+=`renamed '${e}' -> '${l}'
|
|
5
|
+
`}}catch(m){let o=P(m);o.includes("ENOENT")||o.includes("no such file")?c+=`mv: cannot stat '${e}': No such file or directory
|
|
6
|
+
`:c+=`mv: cannot move '${e}': ${o}
|
|
7
|
+
`,h=1}return{stdout:s(u),stderr:s(c),exitCode:h}}},z={name:"mv",flags:[{flag:"-f",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0,minArgs:2};export{H as a,z as b};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as he}from"./chunk-CAXM2HMK.js";import{a as A,b as _}from"./chunk-N7YAMUQG.js";import{k as b}from"./chunk-A257OMG4.js";import{a as le,b as ue,c as Z}from"./chunk-EKD22SYR.js";import{b as P,f as M,h as $}from"./chunk-6VQWCKYE.js";import{k as ce}from"./chunk-463VWH7H.js";var _e=1e4,Ge=100,xe=new _(/\s+/);function Y(e={}){let{fieldSep:t=xe,maxIterations:r=_e,maxRecursionDepth:i=Ge,maxOutputSize:s=0,fs:a,cwd:o,exec:c,coverage:l}=e;return{FS:" ",OFS:" ",ORS:`
|
|
3
|
+
`,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:r,maxRecursionDepth:i,maxOutputSize:s,currentRecursionDepth:0,exitCode:0,shouldExit:!1,shouldNext:!1,shouldNextFile:!1,loopBreak:!1,loopContinue:!1,hasReturn:!1,inEndBlock:!1,output:"",openedFiles:new Set,fs:a,cwd:o,exec:c,coverage:l}}function pe(e,t,r){switch(r){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 O(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 W(e,t){if(e.type==="regex")return e.pattern;let r=I(await t.evalExpr(e));return r.startsWith("/")&&r.endsWith("/")&&(r=r.slice(1,-1)),r}async function de(e,t){return e?e.type==="variable"?e.name:e.type==="field"?`$${Math.floor(O(await t.evalExpr(e.index)))}`:"$0":"$0"}function Ee(e,t){if(e==="$0")return t.line;if(e.startsWith("$")){let r=parseInt(e.slice(1),10)-1;return t.fields[r]||""}return I(t.vars[e]??"")}function Ne(e,t,r){if(e==="$0")r.line=t,r.fields=r.FS===" "?t.trim().split(/\s+/).filter(Boolean):r.fieldSep.split(t),r.NF=r.fields.length;else if(e.startsWith("$")){let i=parseInt(e.slice(1),10)-1;for(;r.fields.length<=i;)r.fields.push("");r.fields[i]=t,r.NF=r.fields.length,r.line=r.fields.join(r.OFS)}else r.vars[e]=t}async function De(e,t,r){return e.length===0?t.line.length:I(await r.evalExpr(e[0])).length}async function Ue(e,t,r){if(e.length<2)return"";let i=I(await r.evalExpr(e[0])),s=Math.floor(O(await r.evalExpr(e[1])))-1;if(e.length>=3){let a=Math.floor(O(await r.evalExpr(e[2])));return i.substr(Math.max(0,s),a)}return i.substr(Math.max(0,s))}async function Be(e,t,r){if(e.length<2)return 0;let i=I(await r.evalExpr(e[0])),s=I(await r.evalExpr(e[1])),a=i.indexOf(s);return a===-1?0:a+1}async function He(e,t,r){if(e.length<2)return 0;let i=I(await r.evalExpr(e[0])),s=e[1];if(s.type!=="variable")return 0;let a=s.name,o=t.FS;if(e.length>=3){let l=e[2];if(l.type==="regex")o=A(l.pattern);else{let N=I(await r.evalExpr(l));o=N===" "?A("\\s+"):N}}else t.FS===" "&&(o=A("\\s+"));let c=typeof o=="string"?i.split(o):o.split(i);t.arrays[a]=Object.create(null);for(let l=0;l<c.length;l++)t.arrays[a][String(l+1)]=c[l];return c.length}async function $e(e,t,r){if(e.length<2)return 0;let i=await W(e[0],r),s=I(await r.evalExpr(e[1])),a=await de(e[2],r),o=Ee(a,t);try{let l=A(i).replace(o,Se(s)),N=l!==o?1:0;return Ne(a,l,t),N}catch{return 0}}async function We(e,t,r){if(e.length<2)return 0;let i=await W(e[0],r),s=I(await r.evalExpr(e[1])),a=await de(e[2],r),o=Ee(a,t);try{let c=A(i,"g"),l=c.match(o),N=l?l.length:0,w=c.replace(o,Se(s));return Ne(a,w,t),N}catch{return 0}}function Se(e){return t=>{let r="",i=0;for(;i<e.length;)if(e[i]==="\\"&&i+1<e.length){let s=e[i+1];s==="&"?(r+="&",i+=2):s==="\\"?(r+="\\",i+=2):(r+=e[i+1],i+=2)}else e[i]==="&"?(r+=t,i++):(r+=e[i],i++);return r}}async function Ve(e,t,r){if(e.length<2)return t.RSTART=0,t.RLENGTH=-1,0;let i=I(await r.evalExpr(e[0])),s=await W(e[1],r);try{let o=A(s).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 Ke(e,t,r){if(e.length<3)return"";let i=await W(e[0],r),s=I(await r.evalExpr(e[1])),a=I(await r.evalExpr(e[2])),o=e.length>=4?I(await r.evalExpr(e[3])):t.line;try{let c=a.toLowerCase()==="g",l=c?0:parseInt(a,10)||1;if(c)return A(i,"g").replace(o,(w,...L)=>fe(s,w,L.slice(0,-2)));{let N=0;return A(i,"g").replace(o,(L,...y)=>(N++,N===l?fe(s,L,y.slice(0,-2)):L))}}catch{return o}}function fe(e,t,r){let i="",s=0;for(;s<e.length;)if(e[s]==="\\"&&s+1<e.length){let a=e[s+1];if(a==="&")i+="&",s+=2;else if(a==="0")i+=t,s+=2;else if(a>="1"&&a<="9"){let o=parseInt(a,10)-1;i+=r[o]||"",s+=2}else a==="n"?(i+=`
|
|
4
|
+
`,s+=2):a==="t"?(i+=" ",s+=2):(i+=a,s+=2)}else e[s]==="&"?(i+=t,s++):(i+=e[s],s++);return i}async function Xe(e,t,r){return e.length===0?"":I(await r.evalExpr(e[0])).toLowerCase()}async function je(e,t,r){return e.length===0?"":I(await r.evalExpr(e[0])).toUpperCase()}async function ze(e,t,r){if(e.length===0)return"";let i=I(await r.evalExpr(e[0])),s=[];for(let a=1;a<e.length;a++)s.push(await r.evalExpr(e[a]));return V(i,s)}async function Qe(e,t,r){return e.length===0?0:Math.floor(O(await r.evalExpr(e[0])))}async function qe(e,t,r){return e.length===0?0:Math.sqrt(O(await r.evalExpr(e[0])))}async function Je(e,t,r){return e.length===0?0:Math.sin(O(await r.evalExpr(e[0])))}async function Ze(e,t,r){return e.length===0?0:Math.cos(O(await r.evalExpr(e[0])))}async function Ye(e,t,r){let i=e.length>0?O(await r.evalExpr(e[0])):0,s=e.length>1?O(await r.evalExpr(e[1])):0;return Math.atan2(i,s)}async function et(e,t,r){return e.length===0?0:Math.log(O(await r.evalExpr(e[0])))}async function tt(e,t,r){return e.length===0?1:Math.exp(O(await r.evalExpr(e[0])))}function rt(e,t,r){return t.random?t.random():Math.random()}async function nt(e,t,r){let i=e.length>0?O(await r.evalExpr(e[0])):Date.now();return t.vars._srand_seed=i,i}function it(e,t){return()=>{throw new Error(`${e}() is not supported - ${t}`)}}function ee(e){return()=>{throw new Error(`function '${e}()' is not implemented`)}}var T=1e4;function V(e,t){let r=0,i="",s=0;for(;s<e.length;)if(e[s]==="%"&&s+1<e.length){let a=s+1,o="",c="",l="",N,w=a;for(;a<e.length&&/\d/.test(e[a]);)a++;a>w&&e[a]==="$"?(N=parseInt(e.substring(w,a),10)-1,a++):a=w;let L=()=>{if(a<e.length){if(a+1<e.length&&(e[a]==="h"&&e[a+1]==="h"||e[a]==="l"&&e[a+1]==="l")){a+=2;return}/[lzjh]/.test(e[a])&&a++}};for(;a<e.length&&/[-+ #0]/.test(e[a]);)o+=e[a++];if(e[a]==="*"){let E=t[r++],h=E!==void 0?Math.floor(Number(E)):0;h<0?(o+="-",c=String(Math.min(-h,T))):c=String(Math.min(h,T)),a++}else for(;a<e.length&&/\d/.test(e[a]);)c+=e[a++];if(c&&parseInt(c,10)>T&&(c=String(T)),e[a]==="."){if(a++,e[a]==="*"){let E=t[r++];l=String(Math.min(E!==void 0?Math.floor(Number(E)):0,T)),a++}else for(;a<e.length&&/\d/.test(e[a]);)l+=e[a++];l&&parseInt(l,10)>T&&(l=String(T))}L();let y=e[a],g=t[N!==void 0?N:r];switch(y){case"s":{let E=g!==void 0?String(g):"";if(l&&(E=E.substring(0,parseInt(l,10))),c){let h=parseInt(c,10);o.includes("-")?E=E.padEnd(h):E=E.padStart(h)}i+=E,N===void 0&&r++;break}case"d":case"i":{let E=g!==void 0?Math.floor(Number(g)):0;Number.isNaN(E)&&(E=0);let h=E<0,p=Math.abs(E).toString();if(l){let C=parseInt(l,10);p=p.padStart(C,"0")}let f="";h?f="-":o.includes("+")?f="+":o.includes(" ")&&(f=" ");let R=f+p;if(c){let C=parseInt(c,10);o.includes("-")?R=R.padEnd(C):o.includes("0")&&!l?R=f+p.padStart(C-f.length,"0"):R=R.padStart(C)}i+=R,N===void 0&&r++;break}case"f":{let E=g!==void 0?Number(g):0;Number.isNaN(E)&&(E=0);let h=l?parseInt(l,10):6,p=E.toFixed(h);if(c){let f=parseInt(c,10);o.includes("-")?p=p.padEnd(f):p=p.padStart(f)}i+=p,N===void 0&&r++;break}case"e":case"E":{let E=g!==void 0?Number(g):0;Number.isNaN(E)&&(E=0);let h=l?parseInt(l,10):6,p=E.toExponential(h);if(y==="E"&&(p=p.toUpperCase()),c){let f=parseInt(c,10);o.includes("-")?p=p.padEnd(f):p=p.padStart(f)}i+=p,N===void 0&&r++;break}case"g":case"G":{let E=g!==void 0?Number(g):0;Number.isNaN(E)&&(E=0);let h=l?parseInt(l,10):6,p=E!==0?Math.floor(Math.log10(Math.abs(E))):0,f;if(E===0?f="0":p<-4||p>=h?(f=E.toExponential(h-1),y==="G"&&(f=f.toUpperCase())):f=E.toPrecision(h),f.includes(".")&&(f=f.replace(/\.?0+$/,"").replace(/\.?0+e/,"e")),f.includes("e")&&(f=f.replace(/\.?0+e/,"e")),c){let R=parseInt(c,10);o.includes("-")?f=f.padEnd(R):f=f.padStart(R)}i+=f,N===void 0&&r++;break}case"x":case"X":{let E=g!==void 0?Math.floor(Number(g)):0;Number.isNaN(E)&&(E=0);let h=Math.abs(E).toString(16);if(y==="X"&&(h=h.toUpperCase()),l){let R=parseInt(l,10);h=h.padStart(R,"0")}let p=E<0?"-":"",f=p+h;if(c){let R=parseInt(c,10);o.includes("-")?f=f.padEnd(R):o.includes("0")&&!l?f=p+h.padStart(R-p.length,"0"):f=f.padStart(R)}i+=f,N===void 0&&r++;break}case"o":{let E=g!==void 0?Math.floor(Number(g)):0;Number.isNaN(E)&&(E=0);let h=Math.abs(E).toString(8);if(l){let R=parseInt(l,10);h=h.padStart(R,"0")}let p=E<0?"-":"",f=p+h;if(c){let R=parseInt(c,10);o.includes("-")?f=f.padEnd(R):o.includes("0")&&!l?f=p+h.padStart(R-p.length,"0"):f=f.padStart(R)}i+=f,N===void 0&&r++;break}case"c":{typeof g=="number"?i+=String.fromCharCode(g):i+=String(g??"").charAt(0)||"",N===void 0&&r++;break}case"%":i+="%";break;default:i+=e.substring(s,a+1)}s=a+1}else if(e[s]==="\\"&&s+1<e.length){let a=e[s+1];switch(a){case"n":i+=`
|
|
5
|
+
`;break;case"t":i+=" ";break;case"r":i+="\r";break;case"\\":i+="\\";break;default:i+=a}s+=2}else i+=e[s++];return i}var ye=new Map([["length",De],["substr",Ue],["index",Be],["split",He],["sub",$e],["gsub",We],["match",Ve],["gensub",Ke],["tolower",Xe],["toupper",je],["sprintf",ze],["int",Qe],["sqrt",qe],["sin",Je],["cos",Ze],["atan2",Ye],["log",et],["exp",tt],["rand",rt],["srand",nt],["system",it("system","shell execution not allowed in sandboxed environment")],["close",()=>0],["fflush",()=>0],["systime",ee("systime")],["mktime",ee("mktime")],["strftime",ee("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 te(e){if(typeof e=="number")return!0;let t=String(e).trim();return t===""?!1:!Number.isNaN(Number(t))}function U(e,t){try{return A(e).test(t)}catch{return!1}}function Re(e,t){return t===""?[]:e.FS===" "?t.trim().split(/\s+/).filter(Boolean):e.fieldSep.split(t)}function K(e,t){return t===0?e.line:t<0||t>e.fields.length?"":e.fields[t-1]??""}function re(e,t,r){if(t===0)e.line=S(r),e.fields=Re(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(r),e.NF=e.fields.length,e.line=e.fields.join(e.OFS)}}function G(e,t){e.line=t,e.fields=Re(e,t),e.NF=e.fields.length}function me(e,t){if(e.FS=t,t===" ")e.fieldSep=new _(/\s+/);else try{e.fieldSep=A(t)}catch{e.fieldSep=A(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))}}function X(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 x(e,t,r){switch(t){case"FS":me(e,S(r));return;case"OFS":e.OFS=S(r);return;case"ORS":e.ORS=S(r);return;case"OFMT":e.OFMT=S(r);return;case"NR":e.NR=Math.floor(m(r));return;case"NF":{let i=Math.floor(m(r));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(r));return;case"FILENAME":e.FILENAME=S(r);return;case"RSTART":e.RSTART=Math.floor(m(r));return;case"RLENGTH":e.RLENGTH=Math.floor(m(r));return;case"SUBSEP":e.SUBSEP=S(r);return}e.vars[t]=r}function B(e,t){let r=t,i=new Set,s=e.arrayAliases.get(r);for(;s!==void 0&&!i.has(r);)i.add(r),r=s,s=e.arrayAliases.get(r);return r}function j(e,t,r){if(t==="ARGV")return e.ARGV[r]??"";if(t==="ENVIRON")return e.ENVIRON[r]??"";let i=B(e,t);return e.arrays[i]?.[r]??""}function ne(e,t,r,i){let s=B(e,t);e.arrays[s]||(e.arrays[s]=Object.create(null)),e.arrays[s][r]=i}function Ae(e,t,r){if(t==="ARGV")return e.ARGV[r]!==void 0;if(t==="ENVIRON")return e.ENVIRON[r]!==void 0;let i=B(e,t);return e.arrays[i]?.[r]!==void 0}function ge(e,t,r){let i=B(e,t);e.arrays[i]&&delete e.arrays[i][r]}function we(e,t){let r=B(e,t);delete e.arrays[r]}var ie=null;function Ie(e){ie=e}async function d(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 U(t.pattern,e.line)?1:0;case"field":return st(e,t);case"variable":return X(e,t.name);case"array_access":return at(e,t);case"binary":return ot(e,t);case"unary":return ut(e,t);case"ternary":return v(await d(e,t.condition))?await d(e,t.consequent):await d(e,t.alternate);case"call":return ht(e,t.name,t.args);case"assignment":return ft(e,t);case"pre_increment":return dt(e,t.operand);case"pre_decrement":return Et(e,t.operand);case"post_increment":return Nt(e,t.operand);case"post_decrement":return St(e,t.operand);case"in":return yt(e,t.key,t.array);case"getline":return Rt(e,t.variable,t.file,t.command);case"tuple":return gt(e,t.elements);default:return""}}async function st(e,t){let r=Math.floor(m(await d(e,t.index)));return K(e,r)}async function at(e,t){let r=S(await d(e,t.key));return j(e,t.array,r)}async function ot(e,t){let r=t.operator;if(r==="||")return v(await d(e,t.left))||v(await d(e,t.right))?1:0;if(r==="&&")return v(await d(e,t.left))&&v(await d(e,t.right))?1:0;if(r==="~"){let c=await d(e,t.left);t.right.type==="regex"&&e.coverage?.hit("awk:expr:regex");let l=t.right.type==="regex"?t.right.pattern:S(await d(e,t.right));try{return A(l).test(S(c))?1:0}catch{return 0}}if(r==="!~"){let c=await d(e,t.left);t.right.type==="regex"&&e.coverage?.hit("awk:expr:regex");let l=t.right.type==="regex"?t.right.pattern:S(await d(e,t.right));try{return A(l).test(S(c))?0:1}catch{return 1}}let i=await d(e,t.left),s=await d(e,t.right);if(r===" "){let c=S(i)+S(s);if(e.maxOutputSize>0&&c.length>e.maxOutputSize)throw new b(`awk: string concatenation size limit exceeded (${e.maxOutputSize} bytes)`,"string_length");return c}if(ct(r))return lt(i,s,r);let a=m(i),o=m(s);return pe(a,o,r)}function ct(e){return["<","<=",">",">=","==","!="].includes(e)}function lt(e,t,r){let i=te(e),s=te(t);if(i&&s){let c=m(e),l=m(t);switch(r){case"<":return c<l?1:0;case"<=":return c<=l?1:0;case">":return c>l?1:0;case">=":return c>=l?1:0;case"==":return c===l?1:0;case"!=":return c!==l?1:0}}let a=S(e),o=S(t);switch(r){case"<":return a<o?1:0;case"<=":return a<=o?1:0;case">":return a>o?1:0;case">=":return a>=o?1:0;case"==":return a===o?1:0;case"!=":return a!==o?1:0}return 0}async function ut(e,t){let r=await d(e,t.operand);switch(t.operator){case"!":return v(r)?0:1;case"-":return-m(r);case"+":return+m(r);default:return r}}async function ht(e,t,r){let i=ye.get(t);if(i)return i(r,e,{evalExpr:a=>d(e,a)});let s=e.functions.get(t);return s?pt(e,s,r):""}async function pt(e,t,r){if(e.currentRecursionDepth++,e.currentRecursionDepth>e.maxRecursionDepth)throw e.currentRecursionDepth--,new b(`awk: recursion depth exceeded maximum (${e.maxRecursionDepth})`,"recursion");let i=Object.create(null);for(let o of t.params)i[o]=e.vars[o];let s=[];for(let o=0;o<t.params.length;o++){let c=t.params[o];if(o<r.length){let l=r[o];l.type==="variable"&&(e.arrayAliases.set(c,l.name),s.push(c));let N=await d(e,l);e.vars[c]=N}else e.vars[c]=""}e.hasReturn=!1,e.returnValue=void 0,ie&&await ie(e,t.body.statements);let a=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 s)e.arrayAliases.delete(o);return e.hasReturn=!1,e.returnValue=void 0,e.currentRecursionDepth--,a}async function ft(e,t){let r=await d(e,t.value),i=t.target,s=t.operator,a;if(s==="=")a=r;else{let o;if(i.type==="field"){let N=Math.floor(m(await d(e,i.index)));o=K(e,N)}else if(i.type==="variable")o=X(e,i.name);else{let N=S(await d(e,i.key));o=j(e,i.array,N)}let c=m(o),l=m(r);switch(s){case"+=":a=c+l;break;case"-=":a=c-l;break;case"*=":a=c*l;break;case"/=":a=l!==0?c/l:0;break;case"%=":a=l!==0?c%l:0;break;case"^=":a=c**l;break;default:a=r}}if(i.type==="field"){let o=Math.floor(m(await d(e,i.index)));re(e,o,a)}else if(i.type==="variable")x(e,i.name,a);else{let o=S(await d(e,i.key));ne(e,i.array,o,a)}return a}async function z(e,t,r,i){let s;if(t.type==="field"){let a=Math.floor(m(await d(e,t.index)));s=m(K(e,a)),re(e,a,s+r)}else if(t.type==="variable")s=m(X(e,t.name)),x(e,t.name,s+r);else{let a=S(await d(e,t.key));s=m(j(e,t.array,a)),ne(e,t.array,a,s+r)}return i?s+r:s}async function dt(e,t){return z(e,t,1,!0)}async function Et(e,t){return z(e,t,-1,!0)}async function Nt(e,t){return z(e,t,1,!1)}async function St(e,t){return z(e,t,-1,!1)}async function yt(e,t,r){let i;if(t.type==="tuple"){e.coverage?.hit("awk:expr:tuple");let s=[];for(let a of t.elements)s.push(S(await d(e,a)));i=s.join(e.SUBSEP)}else i=S(await d(e,t));return Ae(e,r,i)?1:0}async function Rt(e,t,r,i){if(i)return mt(e,t,i);if(r)return At(e,t,r);if(!e.lines||e.lineIndex===void 0)return-1;let s=e.lineIndex+1;if(s>=e.lines.length)return 0;let a=e.lines[s];return t?x(e,t,a):G(e,a),e.NR++,e.lineIndex=s,1}async function mt(e,t,r){if(!e.exec)return-1;let i=S(await d(e,r)),s=`__cmd_${i}`,a=`__cmdi_${i}`,o,c;if(e.vars[s]===void 0)try{o=(await e.exec(i)).stdout.split(`
|
|
6
|
+
`),o.length>0&&o[o.length-1]===""&&o.pop(),e.vars[s]=JSON.stringify(o),e.vars[a]=-1,c=-1}catch{return-1}else o=JSON.parse(e.vars[s]),c=e.vars[a];let l=c+1;if(l>=o.length)return 0;let N=o[l];return e.vars[a]=l,t?x(e,t,N):G(e,N),1}async function At(e,t,r){if(!e.fs||!e.cwd)return-1;let i=S(await d(e,r));if(i==="/dev/null")return 0;let s=e.fs.resolvePath(e.cwd,i),a=`__fc_${s}`,o=`__fi_${s}`,c,l;if(e.vars[a]===void 0)try{c=(await e.fs.readFile(s)).split(`
|
|
7
|
+
`),c.length>0&&c[c.length-1]===""&&c.pop(),e.vars[a]=JSON.stringify(c),e.vars[o]=-1,l=-1}catch{return-1}else c=JSON.parse(e.vars[a]),l=e.vars[o];let N=l+1;if(N>=c.length)return 0;let w=c[N];return e.vars[o]=N,t?x(e,t,w):G(e,w),1}async function gt(e,t){if(t.length===0)return"";for(let r=0;r<t.length-1;r++)await d(e,t[r]);return d(e,t[t.length-1])}Ie(D);function se(e){if(e.maxOutputSize>0&&e.output.length>e.maxOutputSize)throw new b(`awk: output size limit exceeded (${e.maxOutputSize} bytes)`,"string_length")}async function D(e,t){for(let r of t)if(await F(e,r),wt(e))break}function wt(e){return e.shouldExit||e.shouldNext||e.shouldNextFile||e.loopBreak||e.loopContinue||e.hasReturn}async function F(e,t){switch(e.coverage?.hit(`awk:stmt:${t.type}`),t.type){case"block":await D(e,t.statements);break;case"expr_stmt":await d(e,t.expression);break;case"print":await It(e,t.args,t.output);break;case"printf":await vt(e,t.format,t.args,t.output);break;case"if":await kt(e,t);break;case"while":await Ct(e,t);break;case"do_while":await Ot(e,t);break;case"for":await bt(e,t);break;case"for_in":await Lt(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 d(e,t.code))):0;break;case"return":e.hasReturn=!0,e.returnValue=t.value?await d(e,t.value):"";break;case"delete":await Mt(e,t.target);break}}async function It(e,t,r){let i=[];for(let a of t){let o=await d(e,a);typeof o=="number"?Number.isInteger(o)&&Math.abs(o)<Number.MAX_SAFE_INTEGER?i.push(String(o)):i.push(V(e.OFMT,[o])):i.push(S(o))}let s=i.join(e.OFS)+e.ORS;r?await ve(e,r.redirect,r.file,s):(e.output+=s,se(e))}async function vt(e,t,r,i){let s=S(await d(e,t)),a=[];for(let c of r)a.push(await d(e,c));let o=V(s,a);i?await ve(e,i.redirect,i.file,o):(e.output+=o,se(e))}async function ve(e,t,r,i){if(!e.fs||!e.cwd){e.output+=i,se(e);return}let s=S(await d(e,r)),a=e.fs.resolvePath(e.cwd,s);t===">"?e.openedFiles.has(a)?await e.fs.appendFile(a,i):(await e.fs.writeFile(a,i),e.openedFiles.add(a)):(e.openedFiles.has(a)||e.openedFiles.add(a),await e.fs.appendFile(a,i))}async function kt(e,t){v(await d(e,t.condition))?await F(e,t.consequent):t.alternate&&await F(e,t.alternate)}async function Ct(e,t){let r=0;for(;v(await d(e,t.condition));){if(r++,r>e.maxIterations)throw new b(`awk: while loop exceeded maximum iterations (${e.maxIterations})`,"iterations");if(e.loopContinue=!1,await F(e,t.body),e.loopBreak){e.loopBreak=!1;break}if(e.shouldExit||e.shouldNext||e.hasReturn)break}}async function Ot(e,t){let r=0;do{if(r++,r>e.maxIterations)throw new b(`awk: do-while loop exceeded maximum iterations (${e.maxIterations})`,"iterations");if(e.loopContinue=!1,await F(e,t.body),e.loopBreak){e.loopBreak=!1;break}if(e.shouldExit||e.shouldNext||e.hasReturn)break}while(v(await d(e,t.condition)))}async function bt(e,t){t.init&&await d(e,t.init);let r=0;for(;!t.condition||v(await d(e,t.condition));){if(r++,r>e.maxIterations)throw new b(`awk: for loop exceeded maximum iterations (${e.maxIterations})`,"iterations");if(e.loopContinue=!1,await F(e,t.body),e.loopBreak){e.loopBreak=!1;break}if(e.shouldExit||e.shouldNext||e.hasReturn)break;t.update&&await d(e,t.update)}}async function Lt(e,t){let r=e.arrays[t.array];if(r)for(let i of Object.keys(r)){if(e.vars[t.variable]=i,e.loopContinue=!1,await F(e,t.body),e.loopBreak){e.loopBreak=!1;break}if(e.shouldExit||e.shouldNext||e.hasReturn)break}}async function Mt(e,t){if(t.type==="array_access"){let r=S(await d(e,t.key));ge(e,t.array,r)}else t.type==="variable"&&we(e,t.name)}var H=class{ctx;program=null;rangeStates=[];constructor(t){this.ctx=t}execute(t){this.program=t,this.ctx.output="";for(let r of t.functions)this.ctx.functions.set(r.name,r);this.rangeStates=t.rules.map(()=>!1)}async executeBegin(){if(this.program){for(let t of this.program.rules)if(t.pattern?.type==="begin"&&(await D(this.ctx,t.action.statements),this.ctx.shouldExit))break}}async executeLine(t){if(!(!this.program||this.ctx.shouldExit)){G(this.ctx,t),this.ctx.NR++,this.ctx.FNR++,this.ctx.shouldNext=!1;for(let r=0;r<this.program.rules.length&&!(this.ctx.shouldExit||this.ctx.shouldNext||this.ctx.shouldNextFile);r++){let i=this.program.rules[r];i.pattern?.type==="begin"||i.pattern?.type==="end"||await this.matchesRule(i,r)&&await D(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 D(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,r){let i=t.pattern;if(!i)return!0;switch(i.type){case"begin":case"end":return!1;case"regex_pattern":return U(i.pattern,this.ctx.line);case"expr_pattern":return v(await d(this.ctx,i.expression));case"range":{let s=await this.matchPattern(i.start),a=await this.matchPattern(i.end);return this.rangeStates[r]?(a&&(this.rangeStates[r]=!1),!0):s?(this.rangeStates[r]=!0,a&&(this.rangeStates[r]=!1),!0):!1}default:return!1}}async matchPattern(t){switch(t.type){case"regex_pattern":return U(t.pattern,this.ctx.line);case"expr_pattern":return v(await d(this.ctx,t.expression));default:return!1}}};var n;(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"})(n||(n={}));var Pt=new Map([["BEGIN",n.BEGIN],["END",n.END],["if",n.IF],["else",n.ELSE],["while",n.WHILE],["do",n.DO],["for",n.FOR],["in",n.IN],["break",n.BREAK],["continue",n.CONTINUE],["next",n.NEXT],["nextfile",n.NEXTFILE],["exit",n.EXIT],["return",n.RETURN],["delete",n.DELETE],["function",n.FUNCTION],["print",n.PRINT],["printf",n.PRINTF],["getline",n.GETLINE]]);function Tt(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 Q=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 r=this.nextToken();r&&(t.push(r),this.lastTokenType=r.type)}return t.push(this.makeToken(n.EOF,"")),t}makeToken(t,r){return{type:t,value:r,line:this.line,column:this.column}}peek(t=0){return this.input[this.pos+t]||""}advance(){let t=this.input[this.pos++]||"";return t===`
|
|
8
|
+
`?(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)===`
|
|
9
|
+
`)this.advance(),this.advance();else break;else if(t==="#")for(;this.pos<this.input.length&&this.peek()!==`
|
|
10
|
+
`;)this.advance();else break}}nextToken(){if(this.skipWhitespace(),this.pos>=this.input.length)return null;let t=this.line,r=this.column,i=this.peek();return i===`
|
|
11
|
+
`?(this.advance(),{type:n.NEWLINE,value:`
|
|
12
|
+
`,line:t,column:r}):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,n.NEWLINE,n.SEMICOLON,n.LBRACE,n.RBRACE,n.LPAREN,n.LBRACKET,n.COMMA,n.ASSIGN,n.PLUS_ASSIGN,n.MINUS_ASSIGN,n.STAR_ASSIGN,n.SLASH_ASSIGN,n.PERCENT_ASSIGN,n.CARET_ASSIGN,n.AND,n.OR,n.NOT,n.MATCH,n.NOT_MATCH,n.QUESTION,n.COLON,n.LT,n.GT,n.LE,n.GE,n.EQ,n.NE,n.PLUS,n.MINUS,n.STAR,n.PERCENT,n.CARET,n.PRINT,n.PRINTF,n.IF,n.WHILE,n.DO,n.FOR,n.RETURN]).has(this.lastTokenType)}readString(){let t=this.line,r=this.column;this.advance();let i="";for(;this.pos<this.input.length&&this.peek()!=='"';)if(this.peek()==="\\"){this.advance();let s=this.advance();switch(s){case"n":i+=`
|
|
13
|
+
`;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 a="";for(;a.length<2&&/[0-9a-fA-F]/.test(this.peek());)a+=this.advance();a.length>0?i+=String.fromCharCode(parseInt(a,16)):i+="x";break}default:if(/[0-7]/.test(s)){let a=s;for(;a.length<3&&/[0-7]/.test(this.peek());)a+=this.advance();i+=String.fromCharCode(parseInt(a,8))}else i+=s}}else i+=this.advance();return this.peek()==='"'&&this.advance(),{type:n.STRING,value:i,line:t,column:r}}readRegex(){let t=this.line,r=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()===`
|
|
14
|
+
`)break;i+=this.advance()}return this.peek()==="/"&&this.advance(),i=Tt(i),{type:n.REGEX,value:i,line:t,column:r}}readNumber(){let t=this.line,r=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:n.NUMBER,value:parseFloat(i),line:t,column:r}}readIdentifier(){let t=this.line,r=this.column,i="";for(;this.isAlphaNumeric(this.peek())||this.peek()==="_";)i+=this.advance();let s=Pt.get(i);return s!==void 0?{type:s,value:i,line:t,column:r}:{type:n.IDENT,value:i,line:t,column:r}}readOperator(){let t=this.line,r=this.column,i=this.advance(),s=this.peek();switch(i){case"+":return s==="+"?(this.advance(),{type:n.INCREMENT,value:"++",line:t,column:r}):s==="="?(this.advance(),{type:n.PLUS_ASSIGN,value:"+=",line:t,column:r}):{type:n.PLUS,value:"+",line:t,column:r};case"-":return s==="-"?(this.advance(),{type:n.DECREMENT,value:"--",line:t,column:r}):s==="="?(this.advance(),{type:n.MINUS_ASSIGN,value:"-=",line:t,column:r}):{type:n.MINUS,value:"-",line:t,column:r};case"*":return s==="*"?(this.advance(),{type:n.CARET,value:"**",line:t,column:r}):s==="="?(this.advance(),{type:n.STAR_ASSIGN,value:"*=",line:t,column:r}):{type:n.STAR,value:"*",line:t,column:r};case"/":return s==="="?(this.advance(),{type:n.SLASH_ASSIGN,value:"/=",line:t,column:r}):{type:n.SLASH,value:"/",line:t,column:r};case"%":return s==="="?(this.advance(),{type:n.PERCENT_ASSIGN,value:"%=",line:t,column:r}):{type:n.PERCENT,value:"%",line:t,column:r};case"^":return s==="="?(this.advance(),{type:n.CARET_ASSIGN,value:"^=",line:t,column:r}):{type:n.CARET,value:"^",line:t,column:r};case"=":return s==="="?(this.advance(),{type:n.EQ,value:"==",line:t,column:r}):{type:n.ASSIGN,value:"=",line:t,column:r};case"!":return s==="="?(this.advance(),{type:n.NE,value:"!=",line:t,column:r}):s==="~"?(this.advance(),{type:n.NOT_MATCH,value:"!~",line:t,column:r}):{type:n.NOT,value:"!",line:t,column:r};case"<":return s==="="?(this.advance(),{type:n.LE,value:"<=",line:t,column:r}):{type:n.LT,value:"<",line:t,column:r};case">":return s==="="?(this.advance(),{type:n.GE,value:">=",line:t,column:r}):s===">"?(this.advance(),{type:n.APPEND,value:">>",line:t,column:r}):{type:n.GT,value:">",line:t,column:r};case"&":return s==="&"?(this.advance(),{type:n.AND,value:"&&",line:t,column:r}):{type:n.IDENT,value:"&",line:t,column:r};case"|":return s==="|"?(this.advance(),{type:n.OR,value:"||",line:t,column:r}):{type:n.PIPE,value:"|",line:t,column:r};case"~":return{type:n.MATCH,value:"~",line:t,column:r};case"?":return{type:n.QUESTION,value:"?",line:t,column:r};case":":return{type:n.COLON,value:":",line:t,column:r};case",":return{type:n.COMMA,value:",",line:t,column:r};case";":return{type:n.SEMICOLON,value:";",line:t,column:r};case"(":return{type:n.LPAREN,value:"(",line:t,column:r};case")":return{type:n.RPAREN,value:")",line:t,column:r};case"{":return{type:n.LBRACE,value:"{",line:t,column:r};case"}":return{type:n.RBRACE,value:"}",line:t,column:r};case"[":return{type:n.LBRACKET,value:"[",line:t,column:r};case"]":return{type:n.RBRACKET,value:"]",line:t,column:r};case"$":return{type:n.DOLLAR,value:"$",line:t,column:r};default:return{type:n.IDENT,value:i,line:t,column:r}}}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 u={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 Le(e){e.expect(u.PRINT);let t=[];if(e.check(u.NEWLINE)||e.check(u.SEMICOLON)||e.check(u.RBRACE)||e.check(u.PIPE)||e.check(u.GT)||e.check(u.APPEND))t.push({type:"field",index:{type:"number",value:0}});else for(t.push(q(e));e.check(u.COMMA);)e.advance(),t.push(q(e));let r;return e.check(u.GT)?(e.advance(),r={redirect:">",file:e.parsePrimary()}):e.check(u.APPEND)&&(e.advance(),r={redirect:">>",file:e.parsePrimary()}),{type:"print",args:t,output:r}}function q(e){return Ft(e)?ae(e,!0):ae(e,!1)}function ae(e,t){let r=t?e.parseTernary():_t(e);if(e.match(u.ASSIGN,u.PLUS_ASSIGN,u.MINUS_ASSIGN,u.STAR_ASSIGN,u.SLASH_ASSIGN,u.PERCENT_ASSIGN,u.CARET_ASSIGN)){let i=e.advance(),s=ae(e,t);if(r.type!=="variable"&&r.type!=="field"&&r.type!=="array_access")throw new Error("Invalid assignment target");return{type:"assignment",operator:new Map([["=","="],["+=","+="],["-=","-="],["*=","*="],["/=","/="],["%=","%="],["^=","^="]]).get(i.value)??"=",target:r,value:s}}return r}function Ft(e){let t=0,r=e.pos;for(;r<e.tokens.length;){let i=e.tokens[r];if(i.type===u.LPAREN&&t++,i.type===u.RPAREN&&t--,i.type===u.QUESTION&&t===0)return!0;if(i.type===u.NEWLINE||i.type===u.SEMICOLON||i.type===u.RBRACE||i.type===u.COMMA||i.type===u.PIPE)return!1;r++}return!1}function _t(e){let t=ke(e);for(;e.check(u.OR);){e.advance();let r=ke(e);t={type:"binary",operator:"||",left:t,right:r}}return t}function ke(e){let t=Ce(e);for(;e.check(u.AND);){e.advance();let r=Ce(e);t={type:"binary",operator:"&&",left:t,right:r}}return t}function Ce(e){let t=Gt(e);if(e.check(u.IN)){e.advance();let r=String(e.expect(u.IDENT).value);return{type:"in",key:t,array:r}}return t}function Gt(e){let t=Oe(e);for(;xt(e)&&!Dt(e);){let r=Oe(e);t={type:"binary",operator:" ",left:t,right:r}}return t}function Oe(e){let t=be(e);for(;e.match(u.MATCH,u.NOT_MATCH);){let r=e.advance().type===u.MATCH?"~":"!~",i=be(e);t={type:"binary",operator:r,left:t,right:i}}return t}function be(e){let t=e.parseAddSub();for(;e.match(u.LT,u.LE,u.GE,u.EQ,u.NE);){let r=e.advance(),i=e.parseAddSub();t={type:"binary",operator:new Map([["<","<"],["<=","<="],[">=",">="],["==","=="],["!=","!="]]).get(r.value)??"==",left:t,right:i}}return t}function xt(e){return e.match(u.NUMBER,u.STRING,u.IDENT,u.DOLLAR,u.LPAREN,u.NOT,u.MINUS,u.PLUS,u.INCREMENT,u.DECREMENT)}function Dt(e){return e.match(u.AND,u.OR,u.QUESTION,u.ASSIGN,u.PLUS_ASSIGN,u.MINUS_ASSIGN,u.STAR_ASSIGN,u.SLASH_ASSIGN,u.PERCENT_ASSIGN,u.CARET_ASSIGN,u.COMMA,u.SEMICOLON,u.NEWLINE,u.RBRACE,u.RPAREN,u.RBRACKET,u.COLON,u.PIPE,u.APPEND,u.GT,u.IN)}function Me(e){e.expect(u.PRINTF);let t=e.check(u.LPAREN);t&&(e.advance(),e.skipNewlines());let r=t?e.parseExpression():q(e),i=[];for(;e.check(u.COMMA);)e.advance(),t&&e.skipNewlines(),i.push(t?e.parseExpression():q(e));t&&(e.skipNewlines(),e.expect(u.RPAREN));let s;return e.check(u.GT)?(e.advance(),s={redirect:">",file:e.parsePrimary()}):e.check(u.APPEND)&&(e.advance(),s={redirect:">>",file:e.parsePrimary()}),{type:"printf",format:r,args:i,output:s}}var J=class{tokens=[];pos=0;parse(t){let r=new Q(t);return this.tokens=r.tokenize(),this.pos=0,this.parseProgram()}setPos(t){this.pos=t}current(){return this.tokens[this.pos]||{type:n.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,r){if(!this.check(t)){let i=this.current();throw new Error(r||`Expected ${t}, got ${i.type} at line ${i.line}:${i.column}`)}return this.advance()}skipNewlines(){for(;this.check(n.NEWLINE);)this.advance()}skipTerminators(){for(;this.check(n.NEWLINE)||this.check(n.SEMICOLON);)this.advance()}parseProgram(){let t=[],r=[];for(this.skipNewlines();!this.check(n.EOF)&&(this.skipNewlines(),!this.check(n.EOF));)this.check(n.FUNCTION)?t.push(this.parseFunction()):r.push(this.parseRule()),this.skipTerminators();return{functions:t,rules:r}}parseFunction(){this.expect(n.FUNCTION);let t=this.expect(n.IDENT).value;this.expect(n.LPAREN);let r=[];if(!this.check(n.RPAREN))for(r.push(this.expect(n.IDENT).value);this.check(n.COMMA);)this.advance(),r.push(this.expect(n.IDENT).value);this.expect(n.RPAREN),this.skipNewlines();let i=this.parseBlock();return{name:t,params:r,body:i}}parseRule(){let t;if(this.check(n.BEGIN))this.advance(),t={type:"begin"};else if(this.check(n.END))this.advance(),t={type:"end"};else if(this.check(n.LBRACE))t=void 0;else if(this.check(n.REGEX)){let i=this.advance();if(this.check(n.AND)||this.check(n.OR)){let s={type:"binary",operator:"~",left:{type:"field",index:{type:"number",value:0}},right:{type:"regex",pattern:i.value}};t={type:"expr_pattern",expression:this.parseLogicalOrRest(s)}}else{let s={type:"regex_pattern",pattern:i.value};if(this.check(n.COMMA)){this.advance();let a;this.check(n.REGEX)?a={type:"regex_pattern",pattern:this.advance().value}:a={type:"expr_pattern",expression:this.parseExpression()},t={type:"range",start:s,end:a}}else t=s}}else{let s={type:"expr_pattern",expression:this.parseExpression()};if(this.check(n.COMMA)){this.advance();let a;this.check(n.REGEX)?a={type:"regex_pattern",pattern:this.advance().value}:a={type:"expr_pattern",expression:this.parseExpression()},t={type:"range",start:s,end:a}}else t=s}this.skipNewlines();let r;return this.check(n.LBRACE)?r=this.parseBlock():r={type:"block",statements:[{type:"print",args:[{type:"field",index:{type:"number",value:0}}]}]},{pattern:t,action:r}}parseBlock(){this.expect(n.LBRACE),this.skipNewlines();let t=[];for(;!this.check(n.RBRACE)&&!this.check(n.EOF);)t.push(this.parseStatement()),this.skipTerminators();return this.expect(n.RBRACE),{type:"block",statements:t}}parseStatement(){if(this.check(n.SEMICOLON)||this.check(n.NEWLINE))return this.advance(),{type:"block",statements:[]};if(this.check(n.LBRACE))return this.parseBlock();if(this.check(n.IF))return this.parseIf();if(this.check(n.WHILE))return this.parseWhile();if(this.check(n.DO))return this.parseDoWhile();if(this.check(n.FOR))return this.parseFor();if(this.check(n.BREAK))return this.advance(),{type:"break"};if(this.check(n.CONTINUE))return this.advance(),{type:"continue"};if(this.check(n.NEXT))return this.advance(),{type:"next"};if(this.check(n.NEXTFILE))return this.advance(),{type:"nextfile"};if(this.check(n.EXIT)){this.advance();let r;return!this.check(n.NEWLINE)&&!this.check(n.SEMICOLON)&&!this.check(n.RBRACE)&&!this.check(n.EOF)&&(r=this.parseExpression()),{type:"exit",code:r}}if(this.check(n.RETURN)){this.advance();let r;return!this.check(n.NEWLINE)&&!this.check(n.SEMICOLON)&&!this.check(n.RBRACE)&&!this.check(n.EOF)&&(r=this.parseExpression()),{type:"return",value:r}}if(this.check(n.DELETE)){this.advance();let r=this.parsePrimary();if(r.type!=="array_access"&&r.type!=="variable")throw new Error("delete requires array element or array");return{type:"delete",target:r}}return this.check(n.PRINT)?Le(this):this.check(n.PRINTF)?Me(this):{type:"expr_stmt",expression:this.parseExpression()}}parseIf(){this.expect(n.IF),this.expect(n.LPAREN);let t=this.parseExpression();this.expect(n.RPAREN),this.skipNewlines();let r=this.parseStatement();this.skipTerminators();let i;return this.check(n.ELSE)&&(this.advance(),this.skipNewlines(),i=this.parseStatement()),{type:"if",condition:t,consequent:r,alternate:i}}parseWhile(){this.expect(n.WHILE),this.expect(n.LPAREN);let t=this.parseExpression();this.expect(n.RPAREN),this.skipNewlines();let r=this.parseStatement();return{type:"while",condition:t,body:r}}parseDoWhile(){this.expect(n.DO),this.skipNewlines();let t=this.parseStatement();this.skipNewlines(),this.expect(n.WHILE),this.expect(n.LPAREN);let r=this.parseExpression();return this.expect(n.RPAREN),{type:"do_while",body:t,condition:r}}parseFor(){if(this.expect(n.FOR),this.expect(n.LPAREN),this.check(n.IDENT)){let a=this.advance();if(this.check(n.IN)){this.advance();let o=this.expect(n.IDENT).value;this.expect(n.RPAREN),this.skipNewlines();let c=this.parseStatement();return{type:"for_in",variable:a.value,array:o,body:c}}this.pos--}let t;this.check(n.SEMICOLON)||(t=this.parseExpression()),this.expect(n.SEMICOLON);let r;this.check(n.SEMICOLON)||(r=this.parseExpression()),this.expect(n.SEMICOLON);let i;this.check(n.RPAREN)||(i=this.parseExpression()),this.expect(n.RPAREN),this.skipNewlines();let s=this.parseStatement();return{type:"for",init:t,condition:r,update:i,body:s}}parseExpression(){return this.parseAssignment()}parseAssignment(){let t=this.parseTernary();if(this.match(n.ASSIGN,n.PLUS_ASSIGN,n.MINUS_ASSIGN,n.STAR_ASSIGN,n.SLASH_ASSIGN,n.PERCENT_ASSIGN,n.CARET_ASSIGN)){let r=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:{"=":"=","+=":"+=","-=":"-=","*=":"*=","/=":"/=","%=":"%=","^=":"^="}[r.value],target:t,value:i}}return t}parseTernary(){let t=this.parsePipeGetline();if(this.check(n.QUESTION)){this.advance();let r=this.parseExpression();this.expect(n.COLON);let i=this.parseExpression();t={type:"ternary",condition:t,consequent:r,alternate:i}}return t}parsePipeGetline(){let t=this.parseOr();if(this.check(n.PIPE)){if(this.advance(),!this.check(n.GETLINE))throw new Error("Expected 'getline' after '|' in expression context");this.advance();let r;return this.check(n.IDENT)&&(r=this.advance().value),{type:"getline",command:t,variable:r}}return t}parseOr(){let t=this.parseAnd();for(;this.check(n.OR);){this.advance();let r=this.parseAnd();t={type:"binary",operator:"||",left:t,right:r}}return t}parseLogicalOrRest(t){for(t=this.parseLogicalAndRest(t);this.check(n.OR);){this.advance();let r=this.parseAnd();t={type:"binary",operator:"||",left:t,right:r}}return t}parseLogicalAndRest(t){for(;this.check(n.AND);){this.advance();let r=this.parseIn();t={type:"binary",operator:"&&",left:t,right:r}}return t}parseAnd(){let t=this.parseIn();for(;this.check(n.AND);){this.advance();let r=this.parseIn();t={type:"binary",operator:"&&",left:t,right:r}}return t}parseIn(){let t=this.parseConcatenation();if(this.check(n.IN)){this.advance();let r=this.expect(n.IDENT).value;return{type:"in",key:t,array:r}}return t}parseConcatenation(){let t=this.parseMatch();for(;this.canStartExpression()&&!this.isConcatTerminator();){let r=this.parseMatch();t={type:"binary",operator:" ",left:t,right:r}}return t}parseMatch(){let t=this.parseComparison();for(;this.match(n.MATCH,n.NOT_MATCH);){let r=this.advance().type===n.MATCH?"~":"!~",i=this.parseComparison();t={type:"binary",operator:r,left:t,right:i}}return t}parseComparison(){let t=this.parseAddSub();for(;this.match(n.LT,n.LE,n.GT,n.GE,n.EQ,n.NE);){let r=this.advance(),i=this.parseAddSub();t={type:"binary",operator:new Map([["<","<"],["<=","<="],[">",">"],[">=",">="],["==","=="],["!=","!="]]).get(r.value)??"==",left:t,right:i}}return t}canStartExpression(){return this.match(n.NUMBER,n.STRING,n.IDENT,n.DOLLAR,n.LPAREN,n.NOT,n.MINUS,n.PLUS,n.INCREMENT,n.DECREMENT)}isConcatTerminator(){return this.match(n.AND,n.OR,n.QUESTION,n.ASSIGN,n.PLUS_ASSIGN,n.MINUS_ASSIGN,n.STAR_ASSIGN,n.SLASH_ASSIGN,n.PERCENT_ASSIGN,n.CARET_ASSIGN,n.COMMA,n.SEMICOLON,n.NEWLINE,n.RBRACE,n.RPAREN,n.RBRACKET,n.COLON,n.PIPE,n.APPEND,n.IN)}parseAddSub(){let t=this.parseMulDiv();for(;this.match(n.PLUS,n.MINUS);){let r=this.advance().value,i=this.parseMulDiv();t={type:"binary",operator:r,left:t,right:i}}return t}parseMulDiv(){let t=this.parseUnary();for(;this.match(n.STAR,n.SLASH,n.PERCENT);){let r=this.advance(),i=this.parseUnary();t={type:"binary",operator:new Map([["*","*"],["/","/"],["%","%"]]).get(r.value)??"*",left:t,right:i}}return t}parseUnary(){if(this.check(n.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(n.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(n.NOT,n.MINUS,n.PLUS)){let t=this.advance().value,r=this.parseUnary();return{type:"unary",operator:t,operand:r}}return this.parsePower()}parsePower(){let t=this.parsePostfix();if(this.check(n.CARET)){this.advance();let r=this.parsePower();t={type:"binary",operator:"^",left:t,right:r}}return t}parsePostfix(){let t=this.parsePrimary();if(this.check(n.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(n.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(n.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(n.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(n.NOT,n.MINUS,n.PLUS)){let t=this.advance().value,r=this.parseFieldIndex();return{type:"unary",operator:t,operand:r}}return this.parseFieldIndexPower()}parseFieldIndexPower(){let t=this.parseFieldIndexPrimary();if(this.check(n.CARET)){this.advance();let r=this.parseFieldIndexPower();t={type:"binary",operator:"^",left:t,right:r}}return t}parseFieldIndexPrimary(){if(this.check(n.NUMBER))return{type:"number",value:this.advance().value};if(this.check(n.STRING))return{type:"string",value:this.advance().value};if(this.check(n.DOLLAR))return this.advance(),{type:"field",index:this.parseFieldIndex()};if(this.check(n.LPAREN)){this.advance();let t=this.parseExpression();return this.expect(n.RPAREN),t}if(this.check(n.IDENT)){let t=this.advance().value;if(this.check(n.LPAREN)){this.advance();let r=[];if(!this.check(n.RPAREN))for(r.push(this.parseExpression());this.check(n.COMMA);)this.advance(),r.push(this.parseExpression());return this.expect(n.RPAREN),{type:"call",name:t,args:r}}if(this.check(n.LBRACKET)){this.advance();let r=this.parseExpression();if(this.check(n.COMMA)){let i=[r];for(;this.check(n.COMMA);)this.advance(),i.push(this.parseExpression());this.expect(n.RBRACKET);let s=i.reduce((a,o)=>({type:"binary",operator:" ",left:{type:"binary",operator:" ",left:a,right:{type:"variable",name:"SUBSEP"}},right:o}));return{type:"array_access",array:t,key:s}}return this.expect(n.RBRACKET),{type:"array_access",array:t,key:r}}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(n.NUMBER))return{type:"number",value:this.advance().value};if(this.check(n.STRING))return{type:"string",value:this.advance().value};if(this.check(n.REGEX))return{type:"regex",pattern:this.advance().value};if(this.check(n.DOLLAR))return this.advance(),{type:"field",index:this.parseFieldIndex()};if(this.check(n.LPAREN)){this.advance();let t=this.parseExpression();if(this.check(n.COMMA)){let r=[t];for(;this.check(n.COMMA);)this.advance(),r.push(this.parseExpression());return this.expect(n.RPAREN),{type:"tuple",elements:r}}return this.expect(n.RPAREN),t}if(this.check(n.GETLINE)){this.advance();let t,r;return this.check(n.IDENT)&&(t=this.advance().value),this.check(n.LT)&&(this.advance(),r=this.parsePrimary()),{type:"getline",variable:t,file:r}}if(this.check(n.IDENT)){let t=this.advance().value;if(this.check(n.LPAREN)){this.advance();let r=[];if(this.skipNewlines(),!this.check(n.RPAREN))for(r.push(this.parseExpression());this.check(n.COMMA);)this.advance(),this.skipNewlines(),r.push(this.parseExpression());return this.skipNewlines(),this.expect(n.RPAREN),{type:"call",name:t,args:r}}if(this.check(n.LBRACKET)){this.advance();let r=[this.parseExpression()];for(;this.check(n.COMMA);)this.advance(),r.push(this.parseExpression());this.expect(n.RBRACKET);let i;if(r.length===1)i=r[0];else{i=r[0];for(let s=1;s<r.length;s++)i={type:"binary",operator:" ",left:{type:"binary",operator:" ",left:i,right:{type:"variable",name:"SUBSEP"}},right:r[s]}}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 Ut={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"]},Fr={name:"awk",async execute(e,t){let r=ce(e);if(ue(r))return le(Ut);let i=new _(/\s+/),s=" ",a=Object.create(null),o=0;for(let h=0;h<r.length;h++){let p=r[h];if(p==="-F"&&h+1<r.length)s=oe(r[++h]),i=Pe(s),o=h+1;else if(p.startsWith("-F"))s=oe(p.slice(2)),i=Pe(s),o=h+1;else if(p==="-v"&&h+1<r.length){let f=r[++h],R=f.indexOf("=");if(R>0){let C=f.slice(0,R),Fe=oe(f.slice(R+1));a[C]=Fe}o=h+1}else{if(p.startsWith("--"))return Z("awk",p);if(p.startsWith("-")&&p.length>1){let f=p[1];if(f!=="F"&&f!=="v")return Z("awk",`-${f}`);o=h+1}else if(!p.startsWith("-")){o=h;break}}}if(o>=r.length)return{stdout:P(),stderr:M(`awk: missing program
|
|
15
|
+
`),exitCode:1};let c=r[o],l=r.slice(o+1),N=new J,w;try{w=N.parse(c)}catch(h){let p=h instanceof Error?h.message:String(h);return{stdout:P(),stderr:M(`awk: ${p}
|
|
16
|
+
`),exitCode:1}}let L={readFile:h=>t.fs.readFileText(h),writeFile:t.fs.writeFile.bind(t.fs),appendFile:async(h,p)=>{try{let f=await t.fs.readFileText(h);await t.fs.writeFile(h,f+p)}catch{await t.fs.writeFile(h,p)}},resolvePath:t.fs.resolvePath.bind(t.fs)},y=Y({fieldSep:i,maxIterations:t.limits?.maxAwkIterations,maxOutputSize:t.limits?.maxStringLength,fs:L,cwd:t.cwd,exec:t.exec?async h=>{let p=await t.exec(h,{cwd:t.cwd});return{stdout:await $(p.stdout),stderr:await $(p.stderr),exitCode:p.exitCode}}:void 0,coverage:t.coverage});y.FS=s,y.vars=Object.assign(Object.create(null),a),y.ARGC=l.length+1,y.ARGV=Object.create(null),y.ARGV[0]="awk";for(let h=0;h<l.length;h++)y.ARGV[String(h+1)]=l[h];y.ENVIRON=he(t.env);let k=new H(y);k.execute(w);let g=w.rules.some(h=>h.pattern?.type!=="begin"&&h.pattern?.type!=="end"),E=w.rules.some(h=>h.pattern?.type==="end");try{if(await k.executeBegin(),y.shouldExit)return await k.executeEnd(),{stdout:M(k.getOutput()),stderr:P(),exitCode:k.getExitCode()};if(!g&&!E)return{stdout:M(k.getOutput()),stderr:P(),exitCode:k.getExitCode()};let h=[];if(l.length>0)for(let p of l)try{let f=t.fs.resolvePath(t.cwd,p),C=(await t.fs.readFileText(f)).split(`
|
|
17
|
+
`);C.length>0&&C[C.length-1]===""&&C.pop(),h.push({filename:p,lines:C})}catch{return{stdout:P(),stderr:M(`awk: ${p}: No such file or directory
|
|
18
|
+
`),exitCode:1}}else{let p=(await $(t.stdin)).split(`
|
|
19
|
+
`);p.length>0&&p[p.length-1]===""&&p.pop(),h.push({filename:"",lines:p})}for(let p of h){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 k.executeLine(p.lines[y.lineIndex]),!(y.shouldExit||y.shouldNextFile)););if(y.shouldExit)break}return await k.executeEnd(),{stdout:M(k.getOutput()),stderr:P(),exitCode:k.getExitCode()}}catch(h){let p=h instanceof Error?h.message:String(h),f=h instanceof b?b.EXIT_CODE:2;return{stdout:M(k.getOutput()),stderr:M(`awk: ${p}
|
|
20
|
+
`),exitCode:f}}}};function oe(e){return e.replace(/\\t/g," ").replace(/\\n/g,`
|
|
21
|
+
`).replace(/\\r/g,"\r").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\a/g,"\x07").replace(/\\v/g,"\v").replace(/\\\\/g,"\\")}function Pe(e){if(e===" ")return A("\\s+");if(/[[\](){}.*+?^$|\\]/.test(e))try{return A(e)}catch{return A(Te(e))}return A(Te(e))}function Te(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Gr={name:"awk",flags:[{flag:"-F",type:"value",valueHint:"delimiter"},{flag:"-v",type:"value",valueHint:"string"}],stdinType:"text",needsArgs:!0};export{Fr as a,Gr as b};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as L,b as T,c as I}from"./chunk-EKD22SYR.js";import{b as m,f as w,k as S}from"./chunk-6VQWCKYE.js";import{k as x}from"./chunk-463VWH7H.js";var D={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 E(c){let l=[],n=c.split(",");for(let t of n)if(t.includes("-")){let[r,i]=t.split("-");l.push({start:r?parseInt(r,10):1,end:i?parseInt(i,10):null})}else{let r=parseInt(t,10);l.push({start:r,end:r})}return l}function k(c,l){let n=[];for(let t of l){let r=t.start-1,i=t.end===null?c.length:t.end;for(let o=r;o<i&&o<c.length;o++)o>=0&&!n.includes(c[o])&&n.push(c[o])}return n}var z={name:"cut",async execute(c,l){let n=x(c);if(T(n))return L(D);let t=" ",r=null,i=null,o=!1,u=[];for(let s=0;s<n.length;s++){let e=n[s];if(e==="-d")t=n[++s]||" ";else if(e.startsWith("-d"))t=e.slice(2);else if(e==="-f")r=n[++s];else if(e.startsWith("-f"))r=e.slice(2);else if(e==="-c")i=n[++s];else if(e.startsWith("-c"))i=e.slice(2);else if(e==="-s"||e==="--only-delimited")o=!0;else{if(e.startsWith("--"))return I("cut",e);if(e.startsWith("-")){let d=!1;for(let a of e.slice(1))if(a==="s")o=!0;else if(!"dfc".includes(a)){d=!0;break}if(d)return I("cut",e)}else u.push(e)}}if(!r&&!i)return{stdout:m(),stderr:w(`cut: you must specify a list of bytes, characters, or fields
|
|
3
|
+
`),exitCode:1};let g;if(u.length===0||u[0]==="-")g=l.stdin;else try{g=await l.fs.readFile(l.fs.resolvePath(l.cwd,u[0]))}catch{return{stdout:m(),stderr:w(`cut: ${u[0]}: No such file or directory
|
|
4
|
+
`),exitCode:1}}let v=E(r||i||"1"),F=new TextDecoder,H=new TextEncoder,b=s=>{if(i){let a=s.split(""),p=[];for(let y of v){let W=y.start-1,C=y.end===null?a.length:y.end;for(let h=W;h<C&&h<a.length;h++)h>=0&&p.push(a[h])}return p.join("")}if(o&&!s.includes(t))return null;let e=s.split(t);return k(e,v).join(t)},f=null;return{stdout:new ReadableStream({async pull(s){for(f===null&&(f=S(g)[Symbol.asyncIterator]());;){let{done:e,value:d}=await f.next();if(e){s.close();return}let a=F.decode(d),p=b(a);if(p!==null){s.enqueue(H.encode(`${p}
|
|
5
|
+
`));return}}},async cancel(){if(f?.return)try{await f.return()}catch{}}}),stderr:m(),exitCode:0}}},B={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{z as a,B as b};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as _}from"./chunk-ZMMCLDDP.js";import{a as ae}from"./chunk-N7YAMUQG.js";import{a as ue,b as he,d as de}from"./chunk-K2K4KPOQ.js";import{a as pe,b as fe}from"./chunk-EKD22SYR.js";import{b as re,f as Z,h as Y}from"./chunk-6VQWCKYE.js";import{k as ce}from"./chunk-463VWH7H.js";function k(e,t){switch(e.type){case"name":{let n=e.pattern,r=n.match(/^\*(\.[a-zA-Z0-9]+)$/);if(r){let s=r[1],c=t.name;if(e.ignoreCase){if(!c.toLowerCase().endsWith(s.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!c.endsWith(s))return{matches:!1,pruned:!1,printed:!1};return{matches:!0,pruned:!1,printed:!1}}return{matches:_(t.name,n,e.ignoreCase),pruned:!1,printed:!1}}case"path":{let n=e.pattern,r=t.relativePath,s=n.split("/");for(let i=0;i<s.length-1;i++){let a=s[i];if(a&&a!=="."&&a!==".."&&!a.includes("*")&&!a.includes("?")&&!a.includes("[")){let l=`/${a}/`;if(e.ignoreCase){if(!r.toLowerCase().includes(l.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!r.includes(l))return{matches:!1,pruned:!1,printed:!1}}}let c=n.match(/\*(\.[a-zA-Z0-9]+)$/);if(c){let i=c[1];if(e.ignoreCase){if(!r.toLowerCase().endsWith(i.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!r.endsWith(i))return{matches:!1,pruned:!1,printed:!1}}return{matches:_(r,n,e.ignoreCase),pruned:!1,printed:!1}}case"regex":try{let n=e.ignoreCase?"i":"";return{matches:ae(e.pattern,n).test(t.relativePath),pruned:!1,printed:!1}}catch{return{matches:!1,pruned:!1,printed:!1}}case"type":return e.fileType==="f"?{matches:t.isFile,pruned:!1,printed:!1}:e.fileType==="d"?{matches:t.isDirectory,pruned:!1,printed:!1}:{matches:!1,pruned:!1,printed:!1};case"empty":return{matches:t.isEmpty,pruned:!1,printed:!1};case"mtime":{let r=(Date.now()-t.mtime)/(1e3*60*60*24),s;return e.comparison==="more"?s=r>e.days:e.comparison==="less"?s=r<e.days:s=Math.floor(r)===e.days,{matches:s,pruned:!1,printed:!1}}case"newer":{let n=t.newerRefTimes.get(e.refPath);return n===void 0?{matches:!1,pruned:!1,printed:!1}:{matches:t.mtime>n,pruned:!1,printed:!1}}case"size":{let n=e.value;switch(e.unit){case"c":n=e.value;break;case"k":n=e.value*1024;break;case"M":n=e.value*1024*1024;break;case"G":n=e.value*1024*1024*1024;break;case"b":n=e.value*512;break}let r;return e.comparison==="more"?r=t.size>n:e.comparison==="less"?r=t.size<n:e.unit==="b"?r=Math.ceil(t.size/512)===e.value:r=t.size===n,{matches:r,pruned:!1,printed:!1}}case"perm":{let n=t.mode&511,r=e.mode&511,s;return e.matchType==="exact"?s=n===r:e.matchType==="all"?s=(n&r)===r:s=(n&r)!==0,{matches:s,pruned:!1,printed:!1}}case"prune":return{matches:!0,pruned:!0,printed:!1};case"print":return{matches:!0,pruned:!1,printed:!0};case"not":{let n=k(e.expr,t);return{matches:!n.matches,pruned:n.pruned,printed:!1}}case"and":{let n=k(e.left,t);if(!n.matches)return{matches:!1,pruned:n.pruned,printed:!1};let r=k(e.right,t);return{matches:r.matches,pruned:n.pruned||r.pruned,printed:n.printed||r.printed}}case"or":{let n=k(e.left,t);if(n.matches)return n;let r=k(e.right,t);return{matches:r.matches,pruned:n.pruned||r.pruned,printed:r.printed}}}}function V(e){if(!e)return!1;switch(e.type){case"name":case"path":case"regex":case"type":case"prune":case"print":return!1;case"empty":case"mtime":case"newer":case"size":case"perm":return!0;case"not":return V(e.expr);case"and":case"or":return V(e.left)||V(e.right)}}function J(e){if(!e)return!1;switch(e.type){case"empty":return!0;case"not":return J(e.expr);case"and":case"or":return J(e.left)||J(e.right);default:return!1}}function me(e){let t={terminalDirName:null,requiredExtension:null};if(!e)return t;let n=Fe(e);if(Ie(e)&&n.length===1){let c=n[0].split("/").filter(i=>i.length>0);if(c.length>=2)for(let i=c.length-2;i>=0;i--){let a=c[i];if(!a.includes("*")&&!a.includes("?")&&!a.includes("[")&&a!=="."&&a!==".."){let l=c[i+1];if(l&&(l.includes("*")||l.includes("?"))){t.terminalDirName=a;let o=l.match(/^\*(\.[a-zA-Z0-9]+)$/);o&&(t.requiredExtension=o[1])}break}}}return t}function Fe(e){let t=[],n=r=>{r.type==="path"?t.push(r.pattern):r.type==="not"?n(r.expr):(r.type==="and"||r.type==="or")&&(n(r.left),n(r.right))};return n(e),t}function Ie(e){let t=n=>n.type==="type"&&n.fileType==="f"?!0:n.type==="not"?t(n.expr):n.type==="and"||n.type==="or"?t(n.left)||t(n.right):!1;return t(e)}function ye(e){let t=[],n=r=>{r&&(r.type==="newer"?t.push(r.refPath):r.type==="not"?n(r.expr):(r.type==="and"||r.type==="or")&&(n(r.left),n(r.right)))};return n(e),t}function Q(e){if(!e)return!0;switch(e.type){case"name":case"path":case"regex":case"type":case"prune":case"print":return!0;case"empty":case"mtime":case"newer":case"size":case"perm":return!1;case"not":return Q(e.expr);case"and":case"or":return Q(e.left)&&Q(e.right)}}function H(e,t,n,r,s){switch(e.type){case"name":{let c=e.pattern,i=c.match(/^\*(\.[a-zA-Z0-9]+)$/);if(i){let a=i[1];if(e.ignoreCase){if(!t.toLowerCase().endsWith(a.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!t.endsWith(a))return{matches:!1,pruned:!1,printed:!1};return{matches:!0,pruned:!1,printed:!1}}return{matches:_(t,c,e.ignoreCase),pruned:!1,printed:!1}}case"path":{let c=e.pattern,i=c.split("/");for(let l=0;l<i.length-1;l++){let o=i[l];if(o&&o!=="."&&o!==".."&&!o.includes("*")&&!o.includes("?")&&!o.includes("[")){let u=`/${o}/`;if(e.ignoreCase){if(!n.toLowerCase().includes(u.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!n.includes(u))return{matches:!1,pruned:!1,printed:!1}}}let a=c.match(/\*(\.[a-zA-Z0-9]+)$/);if(a){let l=a[1];if(e.ignoreCase){if(!n.toLowerCase().endsWith(l.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!n.endsWith(l))return{matches:!1,pruned:!1,printed:!1}}return{matches:_(n,c,e.ignoreCase),pruned:!1,printed:!1}}case"regex":try{let c=e.ignoreCase?"i":"";return{matches:ae(e.pattern,c).test(n),pruned:!1,printed:!1}}catch{return{matches:!1,pruned:!1,printed:!1}}case"type":return e.fileType==="f"?{matches:r,pruned:!1,printed:!1}:e.fileType==="d"?{matches:s,pruned:!1,printed:!1}:{matches:!1,pruned:!1,printed:!1};case"prune":return{matches:!0,pruned:!0,printed:!1};case"print":return{matches:!0,pruned:!1,printed:!0};case"not":{let c=H(e.expr,t,n,r,s);return{matches:!c.matches,pruned:c.pruned,printed:!1}}case"and":{let c=H(e.left,t,n,r,s);if(!c.matches)return{matches:!1,pruned:c.pruned,printed:!1};let i=H(e.right,t,n,r,s);return{matches:i.matches,pruned:c.pruned||i.pruned,printed:c.printed||i.printed}}case"or":{let c=H(e.left,t,n,r,s);if(c.matches)return c;let i=H(e.right,t,n,r,s);return{matches:i.matches,pruned:c.pruned||i.pruned,printed:i.printed}}default:return{matches:!1,pruned:!1,printed:!1}}}function U(e){if(!e)return!1;switch(e.type){case"prune":return!0;case"not":return U(e.expr);case"and":case"or":return U(e.left)||U(e.right);default:return!1}}function z(e){switch(e.type){case"name":case"path":case"regex":case"type":case"prune":case"print":return!0;case"empty":case"mtime":case"newer":case"size":case"perm":return!1;case"not":return z(e.expr);case"and":case"or":return z(e.left)&&z(e.right)}}function ge(e,t){if(!e||!t.isDirectory)return{shouldPrune:!1};if(!z(e))return ie(e,t);let n={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};return{shouldPrune:k(e,n).pruned}}function ie(e,t){switch(e.type){case"or":{if(z(e.left)){let n={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};if(k(e.left,n).pruned)return{shouldPrune:!0}}return ie(e.right,t)}case"and":{if(z(e.left)&&z(e.right)){let n={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};return{shouldPrune:k(e,n).pruned}}if(z(e.left)){let n={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};return k(e.left,n).matches?ie(e.right,t):{shouldPrune:!1}}return{shouldPrune:!1}}case"not":return{shouldPrune:!1};default:return{shouldPrune:!1}}}function we(e,t){let n=[],r=[],s=t;for(;s<e.length;){let i=e[s];if(i==="("||i==="\\("){n.push({type:"lparen"}),s++;continue}if(i===")"||i==="\\)"){n.push({type:"rparen"}),s++;continue}if(i==="-name"&&s+1<e.length)n.push({type:"expr",expr:{type:"name",pattern:e[++s]}});else if(i==="-iname"&&s+1<e.length)n.push({type:"expr",expr:{type:"name",pattern:e[++s],ignoreCase:!0}});else if(i==="-path"&&s+1<e.length)n.push({type:"expr",expr:{type:"path",pattern:e[++s]}});else if(i==="-ipath"&&s+1<e.length)n.push({type:"expr",expr:{type:"path",pattern:e[++s],ignoreCase:!0}});else if(i==="-regex"&&s+1<e.length)n.push({type:"expr",expr:{type:"regex",pattern:e[++s]}});else if(i==="-iregex"&&s+1<e.length)n.push({type:"expr",expr:{type:"regex",pattern:e[++s],ignoreCase:!0}});else if(i==="-type"&&s+1<e.length){let a=e[++s];if(a==="f"||a==="d")n.push({type:"expr",expr:{type:"type",fileType:a}});else return{expr:null,pathIndex:s,error:`find: Unknown argument to -type: ${a}
|
|
3
|
+
`,actions:[]}}else if(i==="-empty")n.push({type:"expr",expr:{type:"empty"}});else if(i==="-mtime"&&s+1<e.length){let a=e[++s],l="exact",o=a;a.startsWith("+")?(l="more",o=a.slice(1)):a.startsWith("-")&&(l="less",o=a.slice(1));let u=parseInt(o,10);Number.isNaN(u)||n.push({type:"expr",expr:{type:"mtime",days:u,comparison:l}})}else if(i==="-newer"&&s+1<e.length){let a=e[++s];n.push({type:"expr",expr:{type:"newer",refPath:a}})}else if(i==="-size"&&s+1<e.length){let a=e[++s],l="exact",o=a;a.startsWith("+")?(l="more",o=a.slice(1)):a.startsWith("-")&&(l="less",o=a.slice(1));let u=o.match(/^(\d+)([ckMGb])?$/);if(u){let B=parseInt(u[1],10),X=u[2]||"b";n.push({type:"expr",expr:{type:"size",value:B,unit:X,comparison:l}})}}else if(i==="-perm"&&s+1<e.length){let a=e[++s],l="exact",o=a;a.startsWith("-")?(l="all",o=a.slice(1)):a.startsWith("/")&&(l="any",o=a.slice(1));let u=parseInt(o,8);Number.isNaN(u)||n.push({type:"expr",expr:{type:"perm",mode:u,matchType:l}})}else if(i==="-prune")n.push({type:"expr",expr:{type:"prune"}});else if(i==="-not"||i==="!")n.push({type:"not"});else if(i==="-o"||i==="-or")n.push({type:"op",op:"or"});else if(i==="-a"||i==="-and")n.push({type:"op",op:"and"});else if(i==="-maxdepth"||i==="-mindepth")s++;else if(i!=="-depth")if(i==="-exec"){let a=[];for(s++;s<e.length&&e[s]!==";"&&e[s]!=="+";)a.push(e[s]),s++;if(s>=e.length)return{expr:null,pathIndex:s,error:"find: missing argument to `-exec'\n",actions:[]};let l=e[s]==="+";r.push({type:"exec",command:a,batchMode:l})}else if(i==="-print")n.push({type:"expr",expr:{type:"print"}}),r.push({type:"print"});else if(i==="-print0")r.push({type:"print0"});else if(i==="-printf"&&s+1<e.length){let a=e[++s];r.push({type:"printf",format:a})}else if(i==="-delete")r.push({type:"delete"});else{if(i.startsWith("-"))return{expr:null,pathIndex:s,error:`find: unknown predicate '${i}'
|
|
4
|
+
`,actions:[]};if(n.length===0){s++;continue}break}s++}if(n.length===0)return{expr:null,pathIndex:s,actions:r};let c=$e(n);return c.error?{expr:null,pathIndex:s,error:c.error,actions:r}:{expr:c.expr,pathIndex:s,actions:r}}function $e(e){let t=0;function n(){let a=r();if(!a)return null;for(;t<e.length;){let l=e[t];if(l.type==="op"&&l.op==="or"){t++;let o=r();if(!o)return a;a={type:"or",left:a,right:o}}else break}return a}function r(){let a=s();if(!a)return null;for(;t<e.length;){let l=e[t];if(l.type==="op"&&l.op==="and"){t++;let o=s();if(!o)return a;a={type:"and",left:a,right:o}}else if(l.type==="expr"||l.type==="not"||l.type==="lparen"){let o=s();if(!o)return a;a={type:"and",left:a,right:o}}else break}return a}function s(){if(t<e.length&&e[t].type==="not"){t++;let a=s();return a?{type:"not",expr:a}:null}return c()}function c(){if(t>=e.length)return null;let a=e[t];if(a.type==="lparen"){t++;let l=n();return t<e.length&&e[t].type==="rparen"&&t++,l}return a.type==="expr"?(t++,a.expr):(a.type==="rparen",null)}return{expr:n()}}var De=500;function Re(){return{readdirCalls:0,readdirTime:0,statCalls:0,statTime:0,evalCalls:0,evalTime:0,nodeCount:0,batchCount:0,batchTime:0,earlyPrunes:0}}function ke(e,t,n){e({category:"find",name:"summary",durationMs:n,details:{readdirCalls:t.readdirCalls,readdirTimeMs:t.readdirTime,statCalls:t.statCalls,statTimeMs:t.statTime,evalCalls:t.evalCalls,evalTimeMs:t.evalTime,nodeCount:t.nodeCount,batchCount:t.batchCount,batchTimeMs:t.batchTime,earlyPrunes:t.earlyPrunes,otherTimeMs:n-t.readdirTime-t.statTime-t.evalTime-t.batchTime}})}var Ne={name:"find",summary:"search for files in a directory hierarchy",usage:"find [path...] [expression]",options:["-name PATTERN file name matches shell pattern PATTERN","-iname PATTERN like -name but case insensitive","-path PATTERN file path matches shell pattern PATTERN","-ipath PATTERN like -path but case insensitive","-regex PATTERN file path matches regular expression PATTERN","-iregex PATTERN like -regex but case insensitive","-type TYPE file is of type: f (regular file), d (directory)","-empty file is empty or directory is empty","-mtime N file's data was modified N*24 hours ago","-newer FILE file was modified more recently than FILE","-size N[ckMGb] file uses N units of space (c=bytes, k=KB, M=MB, G=GB, b=512B blocks)","-perm MODE file's permission bits are exactly MODE (octal)","-perm -MODE all permission bits MODE are set","-perm /MODE any permission bits MODE are set","-maxdepth LEVELS descend at most LEVELS directories","-mindepth LEVELS do not apply tests at levels less than LEVELS","-depth process directory contents before directory itself","-prune do not descend into this directory","-not, ! negate the following expression","-a, -and logical AND (default)","-o, -or logical OR","-exec CMD {} ; execute CMD on each file ({} is replaced by filename)","-exec CMD {} + execute CMD with multiple files at once","-print print the full file name (default action)","-print0 print the full file name followed by a null character","-printf FORMAT print FORMAT with directives: %f %h %p %P %s %d %m %M %t","-delete delete found files/directories"," --help display this help and exit"]},We=new Set(["-name","-iname","-path","-ipath","-regex","-iregex","-type","-maxdepth","-mindepth","-mtime","-newer","-size","-perm"]),Qe={name:"find",async execute(e,t){let n=ce(e);if(fe(n))return pe(Ne);let r=[],s=null,c=null,i=!1,a=!1;for(let p=0;p<n.length;p++){let f=n[p];if(f==="-maxdepth"&&p+1<n.length)a=!0,s=parseInt(n[++p],10);else if(f==="-mindepth"&&p+1<n.length)a=!0,c=parseInt(n[++p],10);else if(f==="-depth")a=!0,i=!0;else if(f==="-exec")for(a=!0,p++;p<n.length&&n[p]!==";"&&n[p]!=="+";)p++;else!f.startsWith("-")&&f!==";"&&f!=="+"&&f!=="("&&f!==")"&&f!=="\\("&&f!=="\\)"&&f!=="!"?a||r.push(f):We.has(f)?(a=!0,p++):(f.startsWith("-")||f==="("||f==="\\("||f==="!")&&(a=!0)}r.length===0&&r.push(".");let{expr:l,error:o,actions:u}=we(n,0);if(o)return{stdout:re(),stderr:Z(o),exitCode:1};let B=u.some(p=>p.type==="print"),X=u.length===0,N=[],Te=u.some(p=>p.type==="printf"),le=[],q="",G=0,Se=ye(l),ee=new Map;for(let p of Se){let f=t.fs.resolvePath(t.cwd,p);try{let d=await t.fs.stat(f);ee.set(p,d.mtime?.getTime()??Date.now())}catch{}}let Ce=u.some(p=>{if(p.type!=="printf")return!1;let f=p.format.replace(/%%/g,"");return/%[-+]?[0-9]*\.?[0-9]*(s|m|M|t|T)/.test(f)}),Pe=V(l)||Ce,be=J(l),te=me(l),oe=U(l),ve=Q(l),Ee=typeof t.fs.readdirWithFileTypes=="function";for(let p of r){let W=function(h){let $=c===null||h.depth>=c,C=!1;if($&&l!==null){let P=Date.now(),y;if(ve)y=H(l,h.name,h.relativePath,h.isFile,h.isDirectory);else{let m={name:h.name,relativePath:h.relativePath,isFile:h.isFile,isDirectory:h.isDirectory,isEmpty:h.isEmpty,mtime:h.stat?.mtime?.getTime()??Date.now(),size:h.stat?.size??0,mode:h.stat?.mode??420,newerRefTimes:ee};y=k(l,m)}$=y.matches,C=B?y.printed:$,d.evalCalls++,d.evalTime+=Date.now()-P}else $&&(C=!0);return C?{print:!0,printfData:Te?{path:h.relativePath,name:h.name,size:h.stat?.size??0,mtime:h.stat?.mtime?.getTime()??Date.now(),mode:h.stat?.mode??420,isDirectory:h.isDirectory,depth:h.depth,startingPoint:p}:null}:{print:!1,printfData:null}};var Oe=W;p.length>1&&p.endsWith("/")&&(p=p.slice(0,-1));let f=t.fs.resolvePath(t.cwd,p);try{await t.fs.stat(f)}catch{q+=`find: ${p}: No such file or directory
|
|
5
|
+
`,G=1;continue}let d=Re(),I=Date.now();async function b(h){let{path:v,depth:$,typeInfo:C}=h;if(d.nodeCount++,s!==null&&$>s)return null;let E,P,y;if(C&&!Pe)E=C.isFile,P=C.isDirectory;else{try{let L=Date.now();y=await t.fs.stat(v),d.statCalls++,d.statTime+=Date.now()-L}catch{return null}if(!y)return null;E=y.isFile,P=y.isDirectory}let m;v===f?m=p.split("/").pop()||p:m=v.split("/").pop()||"";let g=v===f?p:p==="."?`./${v.slice(f==="/"?f.length:f.length+1)}`:p+v.slice(f.length),T=[],S=null,w=null,D=!1;P&&oe&&!i&&(D=ge(l,{name:m,relativePath:g,isFile:E,isDirectory:P}).shouldPrune,D&&d.earlyPrunes++);let x=s!==null&&$>=s,F=te.terminalDirName!==null&&m===te.terminalDirName,j=!x&&!F&&!D;if(P&&((j||be||F)&&!D)){let L=Date.now();if(Ee&&t.fs.readdirWithFileTypes){if(S=await t.fs.readdirWithFileTypes(v),w=S.map(M=>M.name),d.readdirCalls++,d.readdirTime+=Date.now()-L,j)T=S.map((M,R)=>({path:v==="/"?`/${M.name}`:`${v}/${M.name}`,depth:$+1,typeInfo:{isFile:M.isFile,isDirectory:M.isDirectory},resultIndex:R}));else if(F){let M=te.requiredExtension;T=S.filter(R=>R.isFile&&(!M||R.name.endsWith(M))).map((R,xe)=>({path:v==="/"?`/${R.name}`:`${v}/${R.name}`,depth:$+1,typeInfo:{isFile:R.isFile,isDirectory:R.isDirectory},resultIndex:xe}))}}else w=await t.fs.readdir(v),d.readdirCalls++,d.readdirTime+=Date.now()-L,j&&(T=w.map((M,R)=>({path:v==="/"?`/${M}`:`${v}/${M}`,depth:$+1,resultIndex:R})))}let K=E?(y?.size??0)===0:w!==null&&w.length===0,O=D;if(!i&&l!==null&&!D&&oe){let L=Date.now(),M={name:m,relativePath:g,isFile:E,isDirectory:P,isEmpty:K,mtime:y?.mtime?.getTime()??Date.now(),size:y?.size??0,mode:y?.mode??420,newerRefTimes:ee};O=k(l,M).pruned,d.evalCalls++,d.evalTime+=Date.now()-L}return{relativePath:g,name:m,isFile:E,isDirectory:P,isEmpty:K,stat:y,depth:$,children:O?[]:T,pruned:O}}async function Me(){let h={paths:[],printfData:[]};if(i){let y=function(m){let g={paths:[],printfData:[]},T=C[m];if(!T)return g;for(let D of T.childIndices){let x=y(D);g.paths.push(...x.paths),g.printfData.push(...x.printfData)}let{print:S,printfData:w}=W(T.node);return S&&(g.paths.push(T.node.relativePath),w&&g.printfData.push(w)),g};var v=y;let C=[],E=[{item:{path:f,depth:0,resultIndex:0},parentIndex:-1,childOrderInParent:0}],P=new Map;for(;E.length>0;){let m=Date.now(),g=E.splice(0,De),T=await Promise.all(g.map(S=>b(S.item)));d.batchCount++,d.batchTime+=Date.now()-m;for(let S=0;S<g.length;S++){let w=T[S],D=g[S];if(!w)continue;let x=C.length;if(D.parentIndex>=0){let F=P.get(D.parentIndex)||[];F.push(x),P.set(D.parentIndex,F)}C.push({node:w,parentIndex:D.parentIndex,childIndices:[]});for(let F=0;F<w.children.length;F++)E.push({item:w.children[F],parentIndex:x,childOrderInParent:F})}}for(let[m,g]of P)m>=0&&m<C.length&&(C[m].childIndices=g);if(C.length>0){let m=y(0);h.paths.push(...m.paths),h.printfData.push(...m.printfData)}}else{let m=function(g){let T=C.get(g);T&&(h.paths.push(T.path),T.printfData&&h.printfData.push(T.printfData));let S=y.get(g);if(S)for(let w of S)m(w)};var $=m;let C=new Map,E=0,P=[{item:{path:f,depth:0,resultIndex:0},orderIndex:E++}],y=new Map;for(;P.length>0;){let g=Date.now(),T=P.splice(0,De),S=await Promise.all(T.map(async({item:w,orderIndex:D})=>{let x=await b(w);return x?{node:x,orderIndex:D}:null}));d.batchCount++,d.batchTime+=Date.now()-g;for(let w of S){if(!w)continue;let{node:D,orderIndex:x}=w,{print:F,printfData:j}=W(D);if(F&&C.set(x,{path:D.relativePath,printfData:j}),D.children.length>0){let se=[];for(let K of D.children){let O=E++;se.push(O),P.push({item:K,orderIndex:O})}y.set(x,se)}}}m(0)}return h}let ne=await Me();if(N.push(...ne.paths),le.push(...ne.printfData),t.trace){let h=Date.now()-I;ke(t.trace,d,h),t.trace({category:"find",name:"searchPath",durationMs:h,details:{path:p,resultsFound:ne.paths.length}})}}let A="";if(u.length>0)for(let p of u)switch(p.type){case"print":A+=N.length>0?`${N.join(`
|
|
6
|
+
`)}
|
|
7
|
+
`:"";break;case"print0":A+=N.length>0?`${N.join("\0")}\0`:"";break;case"delete":{let f=[...N].sort((d,I)=>I.length-d.length);for(let d of f){let I=t.fs.resolvePath(t.cwd,d);try{await t.fs.rm(I,{recursive:!1})}catch(b){let W=b instanceof Error?b.message:String(b);q+=`find: cannot delete '${d}': ${W}
|
|
8
|
+
`,G=1}}break}case"printf":for(let f of le)A+=ze(p.format,f);break;case"exec":if(!t.exec)return{stdout:re(),stderr:Z(`find: -exec not supported in this context
|
|
9
|
+
`),exitCode:1};if(p.batchMode){let f=[];for(let b of p.command)b==="{}"?f.push(...N):f.push(b);let d=f.map(b=>`"${b}"`).join(" "),I=await t.exec(d,{cwd:t.cwd});A+=await Y(I.stdout),q+=await Y(I.stderr),I.exitCode!==0&&(G=I.exitCode)}else for(let f of N){let I=p.command.map(W=>W==="{}"?f:W).map(W=>`"${W}"`).join(" "),b=await t.exec(I,{cwd:t.cwd});A+=await Y(b.stdout),q+=await Y(b.stderr),b.exitCode!==0&&(G=b.exitCode)}break}else X&&(A=N.length>0?`${N.join(`
|
|
10
|
+
`)}
|
|
11
|
+
`:"");return{stdout:Z(A),stderr:Z(q),exitCode:G}}};function ze(e,t){let n=de(e),r="",s=0;for(;s<n.length;)if(n[s]==="%"&&s+1<n.length){if(s++,n[s]==="%"){r+="%",s++;continue}let[c,i,a]=he(n,s);if(s+=a,s>=n.length){r+="%";break}let l=n[s],o;switch(l){case"f":o=t.name,s++;break;case"h":{let u=t.path.lastIndexOf("/");o=u>0?t.path.slice(0,u):".",s++;break}case"p":o=t.path,s++;break;case"P":{let u=t.startingPoint;t.path===u?o="":t.path.startsWith(`${u}/`)?o=t.path.slice(u.length+1):u==="."&&t.path.startsWith("./")?o=t.path.slice(2):o=t.path,s++;break}case"s":o=String(t.size),s++;break;case"d":o=String(t.depth),s++;break;case"m":o=(t.mode&511).toString(8),s++;break;case"M":o=Ae(t.mode,t.isDirectory),s++;break;case"t":{let u=new Date(t.mtime);o=Le(u),s++;break}case"T":{if(s+1<n.length){let u=n[s+1],B=new Date(t.mtime);o=He(B,u),s+=2}else o="%T",s++;break}default:r+=`%${c!==0||i!==-1?`${c}.${i}`:""}${l}`,s++;continue}r+=ue(o,c,i)}else r+=n[s],s++;return r}function Ae(e,t){let n=e&511,r=t?"d":"-";return r+=n&256?"r":"-",r+=n&128?"w":"-",r+=n&64?"x":"-",r+=n&32?"r":"-",r+=n&16?"w":"-",r+=n&8?"x":"-",r+=n&4?"r":"-",r+=n&2?"w":"-",r+=n&1?"x":"-",r}function Le(e){let t=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],n=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],r=t[e.getDay()],s=n[e.getMonth()],c=String(e.getDate()).padStart(2," "),i=String(e.getHours()).padStart(2,"0"),a=String(e.getMinutes()).padStart(2,"0"),l=String(e.getSeconds()).padStart(2,"0"),o=e.getFullYear();return`${r} ${s} ${c} ${i}:${a}:${l} ${o}`}function He(e,t){switch(t){case"@":return String(e.getTime()/1e3);case"Y":return String(e.getFullYear());case"m":return String(e.getMonth()+1).padStart(2,"0");case"d":return String(e.getDate()).padStart(2,"0");case"H":return String(e.getHours()).padStart(2,"0");case"M":return String(e.getMinutes()).padStart(2,"0");case"S":return String(e.getSeconds()).padStart(2,"0");case"T":return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}:${String(e.getSeconds()).padStart(2,"0")}`;case"F":return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`;default:return`%T${t}`}}var Ke={name:"find",flags:[{flag:"-name",type:"value",valueHint:"pattern"},{flag:"-iname",type:"value",valueHint:"pattern"},{flag:"-type",type:"value",valueHint:"string"},{flag:"-maxdepth",type:"value",valueHint:"number"},{flag:"-mindepth",type:"value",valueHint:"number"},{flag:"-empty",type:"boolean"},{flag:"-print",type:"boolean"},{flag:"-print0",type:"boolean"}],needsFiles:!0};export{Qe as a,Ke as b};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as L}from"./chunk-J7ARATA6.js";import{a as M,b as $}from"./chunk-EKD22SYR.js";import{b as C,f as d,j as F}from"./chunk-6VQWCKYE.js";import{k as b}from"./chunk-463VWH7H.js";var z={name:"wc",summary:"print newline, word, and byte counts for each file",usage:"wc [OPTION]... [FILE]...",options:["-c, --bytes print the byte counts","-m, --chars print the character counts","-l, --lines print the newline counts","-w, --words print the word counts"," --help display this help and exit"]},A={lines:{short:"l",long:"lines",type:"boolean"},words:{short:"w",long:"words",type:"boolean"},bytes:{short:"c",long:"bytes",type:"boolean"},chars:{short:"m",long:"chars",type:"boolean"}},P={name:"wc",async execute(h,n){let i=b(h);if($(i))return M(z);let a=L("wc",i,A);if(!a.ok)return a.error;let{lines:t,words:e}=a.result.flags,r=a.result.flags.bytes||a.result.flags.chars,s=a.result.positional;if(!t&&!e&&!r&&(t=e=r=!0),s.length===0){let o=await k(n.stdin);return{stdout:d(`${y(o,t,e,r,"",0)}
|
|
3
|
+
`),stderr:C(),exitCode:0}}let l=[],p=0,m=0,g=0,x="",S=0;for(let o of s)try{let w=o==="-"?n.stdin:await n.fs.readFile(n.fs.resolvePath(n.cwd,o)),f=await k(w);p+=f.lines,m+=f.words,g+=f.chars,l.push({filename:o,stats:f})}catch{x+=`wc: ${o}: No such file or directory
|
|
4
|
+
`,S=1}let H=s.length>1?p:Math.max(...l.map(o=>o.stats.lines)),W=s.length>1?m:Math.max(...l.map(o=>o.stats.words)),v=s.length>1?g:Math.max(...l.map(o=>o.stats.chars)),c=s.length>1?3:0;t&&(c=Math.max(c,String(H).length)),e&&(c=Math.max(c,String(W).length)),r&&(c=Math.max(c,String(v).length));let u="";for(let{filename:o,stats:w}of l)u+=`${y(w,t,e,r,o,c)}
|
|
5
|
+
`;return s.length>1&&(u+=`${y({lines:p,words:m,chars:g},t,e,r,"total",c)}
|
|
6
|
+
`),{stdout:d(u),stderr:d(x),exitCode:S}}};async function k(h){let n=0,i=0,a=0,t=!1;for await(let e of F(h)){a+=e.length;let r=e.length;for(let s=0;s<r;s++){let l=e[s];l===10?(n++,t&&(i++,t=!1)):l===32||l===9||l===13?t&&(i++,t=!1):t=!0}}return t&&i++,{lines:n,words:i,chars:a}}function y(h,n,i,a,t,e){let r=[];n&&r.push(String(h.lines).padStart(e)),i&&r.push(String(h.words).padStart(e)),a&&r.push(String(h.chars).padStart(e));let s=r.join(" ");return t&&(s+=` ${t}`),s}var j={name:"wc",flags:[{flag:"-l",type:"boolean"},{flag:"-w",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-m",type:"boolean"}],stdinType:"text",needsFiles:!0};export{P as a,j as b};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{b as s,f as o}from"./chunk-6VQWCKYE.js";function p(t){let e=`${t.name} - ${t.summary}
|
|
3
|
+
|
|
4
|
+
`;if(e+=`Usage: ${t.usage}
|
|
5
|
+
`,t.description){if(e+=`
|
|
6
|
+
Description:
|
|
7
|
+
`,typeof t.description=="string")for(let n of t.description.split(`
|
|
8
|
+
`))e+=n?` ${n}
|
|
9
|
+
`:`
|
|
10
|
+
`;else if(t.description.length>0)for(let n of t.description)e+=n?` ${n}
|
|
11
|
+
`:`
|
|
12
|
+
`}if(t.options&&t.options.length>0){e+=`
|
|
13
|
+
Options:
|
|
14
|
+
`;for(let n of t.options)e+=` ${n}
|
|
15
|
+
`}if(t.examples&&t.examples.length>0){e+=`
|
|
16
|
+
Examples:
|
|
17
|
+
`;for(let n of t.examples)e+=` ${n}
|
|
18
|
+
`}if(t.notes&&t.notes.length>0){e+=`
|
|
19
|
+
Notes:
|
|
20
|
+
`;for(let n of t.notes)e+=` ${n}
|
|
21
|
+
`}return{stdout:o(e),stderr:s(),exitCode:0}}function i(t){return t.includes("--help")}function l(t,e){let n=e.startsWith("--")?`${t}: unrecognized option '${e}'
|
|
22
|
+
`:`${t}: invalid option -- '${e.replace(/^-/,"")}'
|
|
23
|
+
`;return{stdout:s(),stderr:o(n),exitCode:1}}export{p as a,i as b,l as c};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as m}from"./chunk-RUESYAVK.js";import{a as B}from"./chunk-J7ARATA6.js";import{a as y,b as w}from"./chunk-EKD22SYR.js";import{b as d,d as h,f as l,g as p}from"./chunk-6VQWCKYE.js";import{k as b}from"./chunk-463VWH7H.js";var x={name:"base64",summary:"base64 encode/decode data and print to standard output",usage:"base64 [OPTION]... [FILE]",options:["-d, --decode decode data","-w, --wrap=COLS wrap encoded lines after COLS character (default 76, 0 to disable)"," --help display this help and exit"]},L={decode:{short:"d",long:"decode",type:"boolean"},wrap:{short:"w",long:"wrap",type:"number",default:76}};async function C(o,n,c){if(n.length===0||n.length===1&&n[0]==="-")return{ok:!0,data:await p(o.stdin)};let r=[],f=null;for(let e of n){if(e==="-"){f===null&&(f=await p(o.stdin)),r.push(f);continue}try{let t=o.fs.resolvePath(o.cwd,e),s=await p(await o.fs.readFile(t));r.push(s)}catch{return{ok:!1,error:{stdout:d(),stderr:l(`${c}: ${e}: No such file or directory
|
|
3
|
+
`),exitCode:1}}}}let i=r.reduce((e,t)=>e+t.length,0),u=new Uint8Array(i),a=0;for(let e of r)u.set(e,a),a+=e.length;return{ok:!0,data:u}}var z={name:"base64",async execute(o,n){let c=b(o);if(w(c))return y(x);let r=B("base64",c,L);if(!r.ok)return r.error;let f=r.result.flags.decode,i=r.result.flags.wrap,u=r.result.positional;try{if(f){let t=await C(n,u,"base64");if(!t.ok)return t.error;if(typeof Buffer<"u"){let F=Buffer.from(t.data).toString("utf8").replace(/\s/g,""),g=Buffer.from(F,"base64");return{stdout:h(new Uint8Array(g.buffer,g.byteOffset,g.byteLength)),stderr:d(),exitCode:0}}let k=m(t.data).replace(/\s/g,""),S=atob(k);return{stdout:l(S),stderr:d(),exitCode:0}}let a=await C(n,u,"base64");if(!a.ok)return a.error;let e;if(typeof Buffer<"u"?e=Buffer.from(a.data).toString("base64"):e=btoa(m(a.data)),i>0){let t=[];for(let s=0;s<e.length;s+=i)t.push(e.slice(s,s+i));e=t.join(`
|
|
4
|
+
`)+(e.length>0?`
|
|
5
|
+
`:"")}return{stdout:l(e),stderr:d(),exitCode:0}}catch{return{stdout:d(),stderr:l(`base64: invalid input
|
|
6
|
+
`),exitCode:1}}}},N={name:"base64",flags:[{flag:"-d",type:"boolean"},{flag:"-w",type:"value",valueHint:"number"}],stdinType:"text",needsFiles:!0};export{z as a,N as b};
|