diff --git a/cli/cli.ts b/cli/cli.ts index acd1911..b37ed77 100644 --- a/cli/cli.ts +++ b/cli/cli.ts @@ -1,5 +1,5 @@ -import { colors } from "https://deno.land/x/cliffy@v0.25.7/ansi/mod.ts"; -import { Command, EnumType } from "https://deno.land/x/cliffy@v0.25.7/command/mod.ts"; +import { colors } from "https://deno.land/x/cliffy@v1.0.0-rc.3/ansi/mod.ts"; +import { Command, EnumType } from "https://deno.land/x/cliffy@v1.0.0-rc.3/command/mod.ts"; import { ghDescribe, GhDescribeError } from "../core/mod.ts"; interface GhDescribeCliArgs { diff --git a/deno.lock b/deno.lock index 3f01189..4536a91 100644 --- a/deno.lock +++ b/deno.lock @@ -59,8 +59,6 @@ "https://deno.land/std@0.140.0/path/separator.ts": "fe1816cb765a8068afb3e8f13ad272351c85cbc739af56dacfc7d93d710fe0f9", "https://deno.land/std@0.140.0/path/win32.ts": "31811536855e19ba37a999cd8d1b62078235548d67902ece4aa6b814596dd757", "https://deno.land/std@0.140.0/streams/conversion.ts": "712585bfa0172a97fb68dd46e784ae8ad59d11b88079d6a4ab098ff42e697d21", - "https://deno.land/std@0.170.0/encoding/base64.ts": "8605e018e49211efc767686f6f687827d7f5fd5217163e981d8d693105640d7a", - "https://deno.land/std@0.170.0/fmt/colors.ts": "03ad95e543d2808bc43c17a3dd29d25b43d0f16287fe562a0be89bf632454a12", "https://deno.land/std@0.171.0/_util/asserts.ts": "178dfc49a464aee693a7e285567b3d0b555dc805ff490505a8aae34f9cfb1462", "https://deno.land/std@0.171.0/_util/os.ts": "d932f56d41e4f6a6093d56044e29ce637f8dcc43c5a90af43504a889cf1775e3", "https://deno.land/std@0.171.0/fmt/colors.ts": "938c5d44d889fb82eff6c358bea8baa7e85950a16c9f6dae3ec3a7a729164471", @@ -93,6 +91,13 @@ "https://deno.land/std@0.181.0/path/posix.ts": "8b7c67ac338714b30c816079303d0285dd24af6b284f7ad63da5b27372a2c94d", "https://deno.land/std@0.181.0/path/separator.ts": "0fb679739d0d1d7bf45b68dacfb4ec7563597a902edbaf3c59b50d5bcadd93b1", "https://deno.land/std@0.181.0/path/win32.ts": "d186344e5583bcbf8b18af416d13d82b35a317116e6460a5a3953508c3de5bba", + "https://deno.land/std@0.196.0/assert/assert.ts": "9a97dad6d98c238938e7540736b826440ad8c1c1e54430ca4c4e623e585607ee", + "https://deno.land/std@0.196.0/assert/assertion_error.ts": "4d0bde9b374dfbcbe8ac23f54f567b77024fb67dbb1906a852d67fe050d42f56", + "https://deno.land/std@0.196.0/console/_data.json": "cf2cc9d039a192b3adbfe64627167c7e6212704c888c25c769fc8f1709e1e1b8", + "https://deno.land/std@0.196.0/console/_rle.ts": "56668d5c44f964f1b4ff93f21c9896df42d6ee4394e814db52d6d13f5bb247c7", + "https://deno.land/std@0.196.0/console/unicode_width.ts": "10661c0f2eeab802d16b8b85ed8825bbc573991bbfb6affed32dc1ff994f54f9", + "https://deno.land/std@0.196.0/encoding/base64.ts": "144ae6234c1fbe5b68666c711dc15b1e9ee2aef6d42b3b4345bf9a6c91d70d0d", + "https://deno.land/std@0.196.0/fmt/colors.ts": "a7eecffdf3d1d54db890723b303847b6e0a1ab4b528ba6958b8f2e754cf1b3bc", "https://deno.land/std@0.213.0/assert/assert.ts": "bec068b2fccdd434c138a555b19a2c2393b71dfaada02b7d568a01541e67cdc5", "https://deno.land/std@0.213.0/assert/assertion_error.ts": "9f689a101ee586c4ce92f52fa7ddd362e86434ffdf1f848e45987dc7689976b8", "https://deno.land/std@0.213.0/bytes/concat.ts": "9cac3b4376afbef98ff03588eb3cf948e0d1eb6c27cfe81a7651ab6dd3adc54a", @@ -204,65 +209,73 @@ "https://deno.land/std@0.213.0/path/windows/to_namespaced_path.ts": "4ffa4fb6fae321448d5fe810b3ca741d84df4d7897e61ee29be961a6aac89a4c", "https://deno.land/std@0.213.0/streams/reader_from_stream_reader.ts": "f981cf94a42133e5c6ace8c3b500565750806c4fc9802262ee63746abc528b0d", "https://deno.land/std@0.213.0/streams/writer_from_stream_writer.ts": "b0e39ef607dfdc5abdfb627edf61a9672809463e2bb022afcbaf0cd006c40feb", - "https://deno.land/x/cliffy@v0.25.7/_utils/distance.ts": "02af166952c7c358ac83beae397aa2fbca4ad630aecfcd38d92edb1ea429f004", - "https://deno.land/x/cliffy@v0.25.7/ansi/ansi.ts": "7f43d07d31dd7c24b721bb434c39cbb5132029fa4be3dd8938873065f65e5810", - "https://deno.land/x/cliffy@v0.25.7/ansi/ansi_escapes.ts": "885f61f343223f27b8ec69cc138a54bea30542924eacd0f290cd84edcf691387", - "https://deno.land/x/cliffy@v0.25.7/ansi/chain.ts": "31fb9fcbf72fed9f3eb9b9487270d2042ccd46a612d07dd5271b1a80ae2140a0", - "https://deno.land/x/cliffy@v0.25.7/ansi/colors.ts": "5f71993af5bd1aa0a795b15f41692d556d7c89584a601fed75997df844b832c9", - "https://deno.land/x/cliffy@v0.25.7/ansi/cursor_position.ts": "d537491e31d9c254b208277448eff92ff7f55978c4928dea363df92c0df0813f", - "https://deno.land/x/cliffy@v0.25.7/ansi/deps.ts": "0f35cb7e91868ce81561f6a77426ea8bc55dc15e13f84c7352f211023af79053", - "https://deno.land/x/cliffy@v0.25.7/ansi/mod.ts": "bb4e6588e6704949766205709463c8c33b30fec66c0b1846bc84a3db04a4e075", - "https://deno.land/x/cliffy@v0.25.7/ansi/tty.ts": "8fb064c17ead6cdf00c2d3bc87a9fd17b1167f2daa575c42b516f38bdb604673", - "https://deno.land/x/cliffy@v0.25.7/command/_errors.ts": "a9bd23dc816b32ec96c9b8f3057218241778d8c40333b43341138191450965e5", - "https://deno.land/x/cliffy@v0.25.7/command/_utils.ts": "9ab3d69fabab6c335b881b8a5229cbd5db0c68f630a1c307aff988b6396d9baf", - "https://deno.land/x/cliffy@v0.25.7/command/command.ts": "a2b83c612acd65c69116f70dec872f6da383699b83874b70fcf38cddf790443f", - "https://deno.land/x/cliffy@v0.25.7/command/completions/_bash_completions_generator.ts": "43b4abb543d4dc60233620d51e69d82d3b7c44e274e723681e0dce2a124f69f9", - "https://deno.land/x/cliffy@v0.25.7/command/completions/_fish_completions_generator.ts": "d0289985f5cf0bd288c05273bfa286b24c27feb40822eb7fd9d7fee64e6580e8", - "https://deno.land/x/cliffy@v0.25.7/command/completions/_zsh_completions_generator.ts": "14461eb274954fea4953ee75938821f721da7da607dc49bcc7db1e3f33a207bd", - "https://deno.land/x/cliffy@v0.25.7/command/completions/bash.ts": "053aa2006ec327ccecacb00ba28e5eb836300e5c1bec1b3cfaee9ddcf8189756", - "https://deno.land/x/cliffy@v0.25.7/command/completions/complete.ts": "58df61caa5e6220ff2768636a69337923ad9d4b8c1932aeb27165081c4d07d8b", - "https://deno.land/x/cliffy@v0.25.7/command/completions/fish.ts": "9938beaa6458c6cf9e2eeda46a09e8cd362d4f8c6c9efe87d3cd8ca7477402a5", - "https://deno.land/x/cliffy@v0.25.7/command/completions/mod.ts": "aeef7ec8e319bb157c39a4bab8030c9fe8fa327b4c1e94c9c1025077b45b40c0", - "https://deno.land/x/cliffy@v0.25.7/command/completions/zsh.ts": "8b04ab244a0b582f7927d405e17b38602428eeb347a9968a657e7ea9f40e721a", - "https://deno.land/x/cliffy@v0.25.7/command/deprecated.ts": "bbe6670f1d645b773d04b725b8b8e7814c862c9f1afba460c4d599ffe9d4983c", - "https://deno.land/x/cliffy@v0.25.7/command/deps.ts": "275b964ce173770bae65f6b8ebe9d2fd557dc10292cdd1ed3db1735f0d77fa1d", - "https://deno.land/x/cliffy@v0.25.7/command/help/_help_generator.ts": "f7c349cb2ddb737e70dc1f89bcb1943ca9017a53506be0d4138e0aadb9970a49", - "https://deno.land/x/cliffy@v0.25.7/command/help/mod.ts": "09d74d3eb42d21285407cda688074c29595d9c927b69aedf9d05ff3f215820d3", - "https://deno.land/x/cliffy@v0.25.7/command/mod.ts": "d0a32df6b14028e43bb2d41fa87d24bc00f9662a44e5a177b3db02f93e473209", - "https://deno.land/x/cliffy@v0.25.7/command/type.ts": "24e88e3085e1574662b856ccce70d589959648817135d4469fab67b9cce1b364", - "https://deno.land/x/cliffy@v0.25.7/command/types.ts": "ae02eec0ed7a769f7dba2dd5d3a931a61724b3021271b1b565cf189d9adfd4a0", - "https://deno.land/x/cliffy@v0.25.7/command/types/action_list.ts": "33c98d449617c7a563a535c9ceb3741bde9f6363353fd492f90a74570c611c27", - "https://deno.land/x/cliffy@v0.25.7/command/types/boolean.ts": "3879ec16092b4b5b1a0acb8675f8c9250c0b8a972e1e4c7adfba8335bd2263ed", - "https://deno.land/x/cliffy@v0.25.7/command/types/child_command.ts": "f1fca390c7fbfa7a713ca15ef55c2c7656bcbb394d50e8ef54085bdf6dc22559", - "https://deno.land/x/cliffy@v0.25.7/command/types/command.ts": "325d0382e383b725fd8d0ef34ebaeae082c5b76a1f6f2e843fee5dbb1a4fe3ac", - "https://deno.land/x/cliffy@v0.25.7/command/types/enum.ts": "2178345972adf7129a47e5f02856ca3e6852a91442a1c78307dffb8a6a3c6c9f", - "https://deno.land/x/cliffy@v0.25.7/command/types/file.ts": "8618f16ac9015c8589cbd946b3de1988cc4899b90ea251f3325c93c46745140e", - "https://deno.land/x/cliffy@v0.25.7/command/types/integer.ts": "29864725fd48738579d18123d7ee78fed37515e6dc62146c7544c98a82f1778d", - "https://deno.land/x/cliffy@v0.25.7/command/types/number.ts": "aeba96e6f470309317a16b308c82e0e4138a830ec79c9877e4622c682012bc1f", - "https://deno.land/x/cliffy@v0.25.7/command/types/string.ts": "e4dadb08a11795474871c7967beab954593813bb53d9f69ea5f9b734e43dc0e0", - "https://deno.land/x/cliffy@v0.25.7/command/upgrade/mod.ts": "17e2df3b620905583256684415e6c4a31e8de5c59066eb6d6c9c133919292dc4", - "https://deno.land/x/cliffy@v0.25.7/command/upgrade/provider.ts": "d6fb846043232cbd23c57d257100c7fc92274984d75a5fead0f3e4266dc76ab8", - "https://deno.land/x/cliffy@v0.25.7/command/upgrade/provider/deno_land.ts": "24f8d82e38c51e09be989f30f8ad21f9dd41ac1bb1973b443a13883e8ba06d6d", - "https://deno.land/x/cliffy@v0.25.7/command/upgrade/provider/github.ts": "99e1b133dd446c6aa79f69e69c46eb8bc1c968dd331c2a7d4064514a317c7b59", - "https://deno.land/x/cliffy@v0.25.7/command/upgrade/provider/nest_land.ts": "0e07936cea04fa41ac9297f32d87f39152ea873970c54cb5b4934b12fee1885e", - "https://deno.land/x/cliffy@v0.25.7/command/upgrade/upgrade_command.ts": "3640a287d914190241ea1e636774b1b4b0e1828fa75119971dd5304784061e05", - "https://deno.land/x/cliffy@v0.25.7/flags/_errors.ts": "f1fbb6bfa009e7950508c9d491cfb4a5551027d9f453389606adb3f2327d048f", - "https://deno.land/x/cliffy@v0.25.7/flags/_utils.ts": "340d3ecab43cde9489187e1f176504d2c58485df6652d1cdd907c0e9c3ce4cc2", - "https://deno.land/x/cliffy@v0.25.7/flags/_validate_flags.ts": "16eb5837986c6f6f7620817820161a78d66ce92d690e3697068726bbef067452", - "https://deno.land/x/cliffy@v0.25.7/flags/deprecated.ts": "a72a35de3cc7314e5ebea605ca23d08385b218ef171c32a3f135fb4318b08126", - "https://deno.land/x/cliffy@v0.25.7/flags/flags.ts": "68a9dfcacc4983a84c07ba19b66e5e9fccd04389fad215210c60fb414cc62576", - "https://deno.land/x/cliffy@v0.25.7/flags/types.ts": "7452ea5296758fb7af89930349ce40d8eb9a43b24b3f5759283e1cb5113075fd", - "https://deno.land/x/cliffy@v0.25.7/flags/types/boolean.ts": "4c026dd66ec9c5436860dc6d0241427bdb8d8e07337ad71b33c08193428a2236", - "https://deno.land/x/cliffy@v0.25.7/flags/types/integer.ts": "b60d4d590f309ddddf066782d43e4dc3799f0e7d08e5ede7dc62a5ee94b9a6d9", - "https://deno.land/x/cliffy@v0.25.7/flags/types/number.ts": "610936e2d29de7c8c304b65489a75ebae17b005c6122c24e791fbed12444d51e", - "https://deno.land/x/cliffy@v0.25.7/flags/types/string.ts": "e89b6a5ce322f65a894edecdc48b44956ec246a1d881f03e97bbda90dd8638c5", - "https://deno.land/x/cliffy@v0.25.7/table/border.ts": "2514abae4e4f51eda60a5f8c927ba24efd464a590027e900926b38f68e01253c", - "https://deno.land/x/cliffy@v0.25.7/table/cell.ts": "1d787d8006ac8302020d18ec39f8d7f1113612c20801b973e3839de9c3f8b7b3", - "https://deno.land/x/cliffy@v0.25.7/table/deps.ts": "5b05fa56c1a5e2af34f2103fd199e5f87f0507549963019563eae519271819d2", - "https://deno.land/x/cliffy@v0.25.7/table/layout.ts": "46bf10ae5430cf4fbb92f23d588230e9c6336edbdb154e5c9581290562b169f4", - "https://deno.land/x/cliffy@v0.25.7/table/row.ts": "5f519ba7488d2ef76cbbf50527f10f7957bfd668ce5b9169abbc44ec88302645", - "https://deno.land/x/cliffy@v0.25.7/table/table.ts": "ec204c9d08bb3ff1939c5ac7412a4c9ed7d00925d4fc92aff9bfe07bd269258d", - "https://deno.land/x/cliffy@v0.25.7/table/utils.ts": "187bb7dcbcfb16199a5d906113f584740901dfca1007400cba0df7dcd341bc29", + "https://deno.land/x/cliffy@v1.0.0-rc.3/_utils/distance.ts": "02af166952c7c358ac83beae397aa2fbca4ad630aecfcd38d92edb1ea429f004", + "https://deno.land/x/cliffy@v1.0.0-rc.3/ansi/ansi.ts": "481e382126922ff686dd664f4bae6bc44df44bc5ed883c0f5f8a8b3776e5a983", + "https://deno.land/x/cliffy@v1.0.0-rc.3/ansi/ansi_escapes.ts": "193b3c3a4e520274bd8322ca4cab1c3ce38070bed1898cb2ade12a585dddd7c9", + "https://deno.land/x/cliffy@v1.0.0-rc.3/ansi/chain.ts": "eca61b1b64cad7b9799490c12c7aa5538d0f63ac65a73ddb6acac8b35f0a5323", + "https://deno.land/x/cliffy@v1.0.0-rc.3/ansi/colors.ts": "328916ea1627c202b39f2ed0f1ca65a573cfb75fa8986aa3dbcc0b7463911005", + "https://deno.land/x/cliffy@v1.0.0-rc.3/ansi/cursor_position.ts": "caa008d29f7a904908bda514f9839bfbb7a93f2d5f5580501675b646d26a87ff", + "https://deno.land/x/cliffy@v1.0.0-rc.3/ansi/deps.ts": "f48ae5d066684793f4a203524db2a9fd61f514527934b458006f3e57363c0215", + "https://deno.land/x/cliffy@v1.0.0-rc.3/ansi/mod.ts": "8713c4babbb279615d325e386c318674650fe61855388e2f8a5b4809fdaf4d00", + "https://deno.land/x/cliffy@v1.0.0-rc.3/ansi/tty.ts": "155aacdcb7dc00f3f95352616a2415c622ffb88db51c5934e5d2e8341eab010b", + "https://deno.land/x/cliffy@v1.0.0-rc.3/command/_argument_types.ts": "ab269dacea2030f865a07c2a1e953ec437a64419a05bad1f1ddaab3f99752ead", + "https://deno.land/x/cliffy@v1.0.0-rc.3/command/_errors.ts": "12d513ff401020287a344e0830e1297ce1c80c077ecb91e0ac5db44d04a6019c", + "https://deno.land/x/cliffy@v1.0.0-rc.3/command/_spread.ts": "0cc6eb70a6df97b5d7d26008822d39f3e8a1232ee0a27f395aa19e68de738245", + "https://deno.land/x/cliffy@v1.0.0-rc.3/command/_type_utils.ts": "820004a59bc858e355b11f80e5b3ff1be2c87e66f31f53f253610170795602f0", + "https://deno.land/x/cliffy@v1.0.0-rc.3/command/_utils.ts": "3c88ff4f36eba298beb07de08068fdce5e5cb7b9d82c8a319f09596d8279be64", + "https://deno.land/x/cliffy@v1.0.0-rc.3/command/command.ts": "ae690745759524082776b7f271f66d5b93933170b1b132f888bd4ac12e9fdd7d", + "https://deno.land/x/cliffy@v1.0.0-rc.3/command/completions/_bash_completions_generator.ts": "0c6cb1df4d378d22f001155781d97a9c3519fd10c48187a198fef2cc63b0f84a", + "https://deno.land/x/cliffy@v1.0.0-rc.3/command/completions/_fish_completions_generator.ts": "8ba4455f7f76a756e05c3db4ce35332b2951af65a2891f2750b530e06880f495", + "https://deno.land/x/cliffy@v1.0.0-rc.3/command/completions/_zsh_completions_generator.ts": "c74525feaf570fe8c14433c30d192622c25603f1fc64694ef69f2a218b41f230", + "https://deno.land/x/cliffy@v1.0.0-rc.3/command/completions/bash.ts": "53fe78994eb2359110dc4fa79235bdd86800a38c1d6b1c4fe673c81756f3a0e2", + "https://deno.land/x/cliffy@v1.0.0-rc.3/command/completions/complete.ts": "58df61caa5e6220ff2768636a69337923ad9d4b8c1932aeb27165081c4d07d8b", + "https://deno.land/x/cliffy@v1.0.0-rc.3/command/completions/completions_command.ts": "506f97f1c6b0b1c3e9956e5069070028b818942310600d4157f64c9b644d3c49", + "https://deno.land/x/cliffy@v1.0.0-rc.3/command/completions/fish.ts": "6f0b44b4067740b2931c9ec8863b6619b1d3410fea0c5a3988525a4c53059197", + "https://deno.land/x/cliffy@v1.0.0-rc.3/command/completions/mod.ts": "8dda715ca25f3f66d5ec232b76d7c9a96dd4c64b5029feff91738cc0c9586fb1", + "https://deno.land/x/cliffy@v1.0.0-rc.3/command/completions/zsh.ts": "f1263c3946975e090d4aadc8681db811d86b52a8ae680f246e03248025885c21", + "https://deno.land/x/cliffy@v1.0.0-rc.3/command/deprecated.ts": "bbe6670f1d645b773d04b725b8b8e7814c862c9f1afba460c4d599ffe9d4983c", + "https://deno.land/x/cliffy@v1.0.0-rc.3/command/deps.ts": "7473ebd5625bf901becd7ff80afdde3b8a50ae5d1bbfa2f43805cfacf4559d5a", + "https://deno.land/x/cliffy@v1.0.0-rc.3/command/help/_help_generator.ts": "532dd4a928baab8b45ce46bb6d20e2ebacfdf3da141ce9d12da796652b1de478", + "https://deno.land/x/cliffy@v1.0.0-rc.3/command/help/help_command.ts": "fbbf0c0827dd21d3cec7bcc68c00c20b55f53e2b621032891b9d23ac4191231c", + "https://deno.land/x/cliffy@v1.0.0-rc.3/command/help/mod.ts": "8369b292761dcc9ddaf41f2d34bfb06fb6800b69efe80da4fc9752c3b890275b", + "https://deno.land/x/cliffy@v1.0.0-rc.3/command/mod.ts": "4b708df1b97152522bee0e3828f06abbbc1d2250168910e5cf454950d7b7404b", + "https://deno.land/x/cliffy@v1.0.0-rc.3/command/type.ts": "f588f5d9635b79100044e62aced4b00e510e75b83801f9b089c40c2d98674de2", + "https://deno.land/x/cliffy@v1.0.0-rc.3/command/types.ts": "bc9ff7459b9cc1079eeb95ff101690a51b4b4afa4af5623340076ee361d08dbb", + "https://deno.land/x/cliffy@v1.0.0-rc.3/command/types/action_list.ts": "33c98d449617c7a563a535c9ceb3741bde9f6363353fd492f90a74570c611c27", + "https://deno.land/x/cliffy@v1.0.0-rc.3/command/types/boolean.ts": "3879ec16092b4b5b1a0acb8675f8c9250c0b8a972e1e4c7adfba8335bd2263ed", + "https://deno.land/x/cliffy@v1.0.0-rc.3/command/types/child_command.ts": "f1fca390c7fbfa7a713ca15ef55c2c7656bcbb394d50e8ef54085bdf6dc22559", + "https://deno.land/x/cliffy@v1.0.0-rc.3/command/types/command.ts": "325d0382e383b725fd8d0ef34ebaeae082c5b76a1f6f2e843fee5dbb1a4fe3ac", + "https://deno.land/x/cliffy@v1.0.0-rc.3/command/types/enum.ts": "8a7cd2898e03089234083bb78c8b1d9b7172254c53c32d4710321638165a48ec", + "https://deno.land/x/cliffy@v1.0.0-rc.3/command/types/file.ts": "8618f16ac9015c8589cbd946b3de1988cc4899b90ea251f3325c93c46745140e", + "https://deno.land/x/cliffy@v1.0.0-rc.3/command/types/integer.ts": "29864725fd48738579d18123d7ee78fed37515e6dc62146c7544c98a82f1778d", + "https://deno.land/x/cliffy@v1.0.0-rc.3/command/types/number.ts": "aeba96e6f470309317a16b308c82e0e4138a830ec79c9877e4622c682012bc1f", + "https://deno.land/x/cliffy@v1.0.0-rc.3/command/types/string.ts": "e4dadb08a11795474871c7967beab954593813bb53d9f69ea5f9b734e43dc0e0", + "https://deno.land/x/cliffy@v1.0.0-rc.3/command/upgrade/_check_version.ts": "6cfa7dc26bc0dc46381500e8d4b130fb224f4c5456152dada15bd3793edca89b", + "https://deno.land/x/cliffy@v1.0.0-rc.3/command/upgrade/mod.ts": "4eff69c489467be17dea27fb95a795396111ee385d170ac0cbcc82f0ea38156c", + "https://deno.land/x/cliffy@v1.0.0-rc.3/command/upgrade/provider.ts": "c23253334097dc4b8a147ccdeb3aa44f5a95aa953a6386cb5396f830d95d77a5", + "https://deno.land/x/cliffy@v1.0.0-rc.3/command/upgrade/provider/deno_land.ts": "24f8d82e38c51e09be989f30f8ad21f9dd41ac1bb1973b443a13883e8ba06d6d", + "https://deno.land/x/cliffy@v1.0.0-rc.3/command/upgrade/provider/github.ts": "99e1b133dd446c6aa79f69e69c46eb8bc1c968dd331c2a7d4064514a317c7b59", + "https://deno.land/x/cliffy@v1.0.0-rc.3/command/upgrade/provider/nest_land.ts": "0e07936cea04fa41ac9297f32d87f39152ea873970c54cb5b4934b12fee1885e", + "https://deno.land/x/cliffy@v1.0.0-rc.3/command/upgrade/upgrade_command.ts": "3640a287d914190241ea1e636774b1b4b0e1828fa75119971dd5304784061e05", + "https://deno.land/x/cliffy@v1.0.0-rc.3/flags/_errors.ts": "f1fbb6bfa009e7950508c9d491cfb4a5551027d9f453389606adb3f2327d048f", + "https://deno.land/x/cliffy@v1.0.0-rc.3/flags/_utils.ts": "340d3ecab43cde9489187e1f176504d2c58485df6652d1cdd907c0e9c3ce4cc2", + "https://deno.land/x/cliffy@v1.0.0-rc.3/flags/_validate_flags.ts": "e60b9038c0136ab7e6bd1baf0e993a07bf23f18afbfb6e12c59adf665a622957", + "https://deno.land/x/cliffy@v1.0.0-rc.3/flags/deprecated.ts": "a72a35de3cc7314e5ebea605ca23d08385b218ef171c32a3f135fb4318b08126", + "https://deno.land/x/cliffy@v1.0.0-rc.3/flags/flags.ts": "3e62c4a9756b5705aada29e7e94847001356b3a83cd18ad56f4207387a71cf51", + "https://deno.land/x/cliffy@v1.0.0-rc.3/flags/types.ts": "9e2f75edff2217d972fc711a21676a59dfd88378da2f1ace440ea84c07db1dcc", + "https://deno.land/x/cliffy@v1.0.0-rc.3/flags/types/boolean.ts": "4c026dd66ec9c5436860dc6d0241427bdb8d8e07337ad71b33c08193428a2236", + "https://deno.land/x/cliffy@v1.0.0-rc.3/flags/types/integer.ts": "b60d4d590f309ddddf066782d43e4dc3799f0e7d08e5ede7dc62a5ee94b9a6d9", + "https://deno.land/x/cliffy@v1.0.0-rc.3/flags/types/number.ts": "610936e2d29de7c8c304b65489a75ebae17b005c6122c24e791fbed12444d51e", + "https://deno.land/x/cliffy@v1.0.0-rc.3/flags/types/string.ts": "e89b6a5ce322f65a894edecdc48b44956ec246a1d881f03e97bbda90dd8638c5", + "https://deno.land/x/cliffy@v1.0.0-rc.3/table/_layout.ts": "e4a518da28333de95ad791208b9930025987c8b93d5f8b7f30b377b3e26b24e1", + "https://deno.land/x/cliffy@v1.0.0-rc.3/table/_utils.ts": "fd48d1a524a42e72aa3ad2eec858a92f5a00728d306c7e8436fba6c34314fee6", + "https://deno.land/x/cliffy@v1.0.0-rc.3/table/border.ts": "5c6e9ef5078c6930169aacb668b274bdbb498461c724a7693ac9270fe9d3f5d5", + "https://deno.land/x/cliffy@v1.0.0-rc.3/table/cell.ts": "1ffabd43b6b7fddfac9625cb0d015532e144702a9bfed03b358b79375115d06b", + "https://deno.land/x/cliffy@v1.0.0-rc.3/table/column.ts": "cf14009f2cb14bad156f879946186c1893acdc6a2fee6845db152edddb6a2714", + "https://deno.land/x/cliffy@v1.0.0-rc.3/table/consume_words.ts": "456e75755fdf6966abdefb8b783df2855e2a8bad6ddbdf21bd748547c5fc1d4b", + "https://deno.land/x/cliffy@v1.0.0-rc.3/table/deps.ts": "1226c4d39d53edc81d7c3e661fb8a79f2e704937c276c60355cd4947a0fe9153", + "https://deno.land/x/cliffy@v1.0.0-rc.3/table/row.ts": "79eb1468aafdd951e5963898cdafe0752d4ab4c519d5f847f3d8ecb8fe857d4f", + "https://deno.land/x/cliffy@v1.0.0-rc.3/table/table.ts": "298671e72e61f1ab18b42ae36643181993f79e29b39dc411fdc6ffd53aa04684", "https://deno.land/x/code_block_writer@12.0.0/mod.ts": "2c3448060e47c9d08604c8f40dee34343f553f33edcdfebbf648442be33205e5", "https://deno.land/x/code_block_writer@12.0.0/utils/string_utils.ts": "60cb4ec8bd335bf241ef785ccec51e809d576ff8e8d29da43d2273b69ce2a6ff", "https://deno.land/x/dax@0.38.0/mod.ts": "3a5d7e6ac12547feec5d3c0c96717f14276891a3802fbbc73e5901e4f20eb08d", diff --git a/dist/cli.js b/dist/cli.js index 882aeb2..9e32342 100644 --- a/dist/cli.js +++ b/dist/cli.js @@ -6980,7 +6980,7 @@ async function revParse(options) { return await exec(args); } -// dist/dnt/esm/deps/deno.land/x/cliffy@v0.25.7/ansi/ansi_escapes.js +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/ansi/ansi_escapes.js var ansi_escapes_exports = {}; __export(ansi_escapes_exports, { bel: () => bel, @@ -7013,7 +7013,7 @@ __export(ansi_escapes_exports, { scrollUp: () => scrollUp }); -// dist/dnt/esm/deps/deno.land/std@0.170.0/encoding/base64.js +// dist/dnt/esm/deps/deno.land/std@0.196.0/encoding/base64.js var base64abc = [ "A", "B", @@ -7104,7 +7104,7 @@ function encode(data) { return result; } -// dist/dnt/esm/deps/deno.land/x/cliffy@v0.25.7/ansi/ansi_escapes.js +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/ansi/ansi_escapes.js var ESC = "\x1B"; var CSI = `${ESC}[`; var OSC = `${ESC}]`; @@ -7210,8 +7210,9 @@ function image(buffer, options) { return ret + ":" + encode(buffer) + bel; } -// dist/dnt/esm/deps/deno.land/x/cliffy@v0.25.7/ansi/ansi.js +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/ansi/ansi.js var ansi = factory(); +var encoder = new TextEncoder(); function factory() { let result = []; let stack = []; @@ -7229,14 +7230,17 @@ function factory() { stack.push([text, []]); return this; }; - ansi2.toString = function() { + ansi2.toArray = function() { update(); - const str = result.join(""); + const ret = result; result = []; - return str; + return ret; + }; + ansi2.toString = function() { + return this.toArray().join(""); }; - ansi2.toBuffer = function() { - return new TextEncoder().encode(this.toString()); + ansi2.bytes = function() { + return encoder.encode(this.toString()); }; const methodList = Object.entries(ansi_escapes_exports); for (const [name, method] of methodList) { @@ -7260,7 +7264,7 @@ function factory() { } } -// dist/dnt/esm/deps/deno.land/std@0.170.0/fmt/colors.js +// dist/dnt/esm/deps/deno.land/std@0.196.0/fmt/colors.js var colors_exports = {}; __export(colors_exports, { bgBlack: () => bgBlack, @@ -7313,10 +7317,10 @@ __export(colors_exports, { yellow: () => yellow }); var { Deno: Deno3 } = dntGlobalThis; -var noColor = typeof Deno3?.noColor === "boolean" ? Deno3.noColor : true; +var noColor = typeof Deno3?.noColor === "boolean" ? Deno3.noColor : false; var enabled = !noColor; function setColorEnabled(value) { - if (noColor) { + if (Deno3?.noColor) { return; } enabled = value; @@ -7498,7 +7502,7 @@ function stripColor(string2) { return string2.replace(ANSI_PATTERN, ""); } -// dist/dnt/esm/deps/deno.land/x/cliffy@v0.25.7/ansi/colors.js +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/ansi/colors.js var proto = /* @__PURE__ */ Object.create(null); var methodNames = Object.keys(colors_exports); for (const name of methodNames) { @@ -7514,7 +7518,7 @@ for (const name of methodNames) { var colors = factory2(); function factory2(stack = []) { const colors2 = function(str, ...args) { - if (str) { + if (typeof str !== "undefined") { const lastIndex = stack.length - 1; return stack.reduce((str2, name, index) => index === lastIndex ? colors_exports[name](str2, ...args) : colors_exports[name](str2), str); } @@ -7527,28 +7531,31 @@ function factory2(stack = []) { return colors2; } -// dist/dnt/esm/deps/deno.land/x/cliffy@v0.25.7/ansi/cursor_position.js -function getCursorPosition({ stdin = import_shim_deno2.Deno.stdin, stdout = import_shim_deno2.Deno.stdout } = {}) { +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/ansi/cursor_position.js +var encoder2 = new TextEncoder(); +var decoder = new TextDecoder(); +function getCursorPosition({ reader = import_shim_deno2.Deno.stdin, writer = import_shim_deno2.Deno.stdout } = {}) { const data = new Uint8Array(8); - import_shim_deno2.Deno.stdin.setRaw(true); - stdout.writeSync(new TextEncoder().encode(cursorPosition)); - stdin.readSync(data); - import_shim_deno2.Deno.stdin.setRaw(false); - const [y, x] = new TextDecoder().decode(data).match(/\[(\d+);(\d+)R/)?.slice(1, 3).map(Number) ?? [0, 0]; + reader.setRaw(true); + writer.writeSync(encoder2.encode(cursorPosition)); + reader.readSync(data); + reader.setRaw(false); + const [y, x] = decoder.decode(data).match(/\[(\d+);(\d+)R/)?.slice(1, 3).map(Number) ?? [0, 0]; return { x, y }; } -// dist/dnt/esm/deps/deno.land/x/cliffy@v0.25.7/ansi/tty.js +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/ansi/tty.js var tty = factory3(); +var encoder3 = new TextEncoder(); function factory3(options) { let result = ""; let stack = []; - const stdout = options?.stdout ?? import_shim_deno2.Deno.stdout; - const stdin = options?.stdin ?? import_shim_deno2.Deno.stdin; + const writer = options?.writer ?? import_shim_deno2.Deno.stdout; + const reader = options?.reader ?? import_shim_deno2.Deno.stdin; const tty2 = function(...args) { if (this) { update(args); - stdout.writeSync(new TextEncoder().encode(result)); + writer.writeSync(encoder3.encode(result)); return this; } return factory3(args[0] ?? options); @@ -7556,10 +7563,10 @@ function factory3(options) { tty2.text = function(text) { stack.push([text, []]); update(); - stdout.writeSync(new TextEncoder().encode(result)); + writer.writeSync(encoder3.encode(result)); return this; }; - tty2.getCursorPosition = () => getCursorPosition({ stdout, stdin }); + tty2.getCursorPosition = () => getCursorPosition({ writer, reader }); const methodList = Object.entries(ansi_escapes_exports); for (const [name, method] of methodList) { if (name === "cursorPosition") { @@ -7585,7 +7592,7 @@ function factory3(options) { } } -// dist/dnt/esm/deps/deno.land/x/cliffy@v0.25.7/_utils/distance.js +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/_utils/distance.js function distance(a, b) { if (a.length == 0) { return b.length; @@ -7612,7 +7619,7 @@ function distance(a, b) { return matrix[b.length][a.length]; } -// dist/dnt/esm/deps/deno.land/x/cliffy@v0.25.7/flags/_utils.js +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/flags/_utils.js function paramCaseToCamelCase(str) { return str.replace(/-([a-z])/g, (g) => g[1].toUpperCase()); } @@ -7696,7 +7703,7 @@ function getDefaultValue(option) { return typeof option.default === "function" ? option.default() : option.default; } -// dist/dnt/esm/deps/deno.land/x/cliffy@v0.25.7/flags/_errors.js +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/flags/_errors.js var FlagsError = class _FlagsError extends Error { constructor(message) { super(message); @@ -7806,7 +7813,7 @@ var InvalidTypeError = class extends ValidationError { } }; -// dist/dnt/esm/deps/deno.land/x/cliffy@v0.25.7/flags/deprecated.js +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/flags/deprecated.js var OptionType; (function(OptionType2) { OptionType2["STRING"] = "string"; @@ -7815,237 +7822,7 @@ var OptionType; OptionType2["BOOLEAN"] = "boolean"; })(OptionType || (OptionType = {})); -// dist/dnt/esm/deps/deno.land/x/cliffy@v0.25.7/command/_utils.js -function didYouMeanCommand(command, commands, excludes = []) { - const commandNames = commands.map((command2) => command2.getName()).filter((command2) => !excludes.includes(command2)); - return didYouMean(" Did you mean command", command, commandNames); -} -var ARGUMENT_REGEX = /^[<\[].+[\]>]$/; -var ARGUMENT_DETAILS_REGEX = /[<\[:>\]]/; -function splitArguments(args) { - const parts = args.trim().split(/[, =] */g); - const typeParts = []; - while (parts[parts.length - 1] && ARGUMENT_REGEX.test(parts[parts.length - 1])) { - typeParts.unshift(parts.pop()); - } - const typeDefinition = typeParts.join(" "); - return { flags: parts, typeDefinition, equalsSign: args.includes("=") }; -} -function parseArgumentsDefinition(argsDefinition, validate = true, all) { - const argumentDetails = []; - let hasOptional = false; - let hasVariadic = false; - const parts = argsDefinition.split(/ +/); - for (const arg of parts) { - if (validate && hasVariadic) { - throw new UnexpectedArgumentAfterVariadicArgumentError(arg); - } - const parts2 = arg.split(ARGUMENT_DETAILS_REGEX); - if (!parts2[1]) { - if (all) { - argumentDetails.push(parts2[0]); - } - continue; - } - const type = parts2[2] || OptionType.STRING; - const details = { - optionalValue: arg[0] === "[", - requiredValue: arg[0] === "<", - name: parts2[1], - action: parts2[3] || type, - variadic: false, - list: type ? arg.indexOf(type + "[]") !== -1 : false, - type - }; - if (validate && !details.optionalValue && hasOptional) { - throw new UnexpectedRequiredArgumentError(details.name); - } - if (arg[0] === "[") { - hasOptional = true; - } - if (details.name.length > 3) { - const istVariadicLeft = details.name.slice(0, 3) === "..."; - const istVariadicRight = details.name.slice(-3) === "..."; - hasVariadic = details.variadic = istVariadicLeft || istVariadicRight; - if (istVariadicLeft) { - details.name = details.name.slice(3); - } else if (istVariadicRight) { - details.name = details.name.slice(0, -3); - } - } - argumentDetails.push(details); - } - return argumentDetails; -} -function dedent(str) { - const lines = str.split(/\r?\n|\r/g); - let text = ""; - let indent = 0; - for (const line of lines) { - if (text || line.trim()) { - if (!text) { - text = line.trimStart(); - indent = line.length - text.length; - } else { - text += line.slice(indent); - } - text += "\n"; - } - } - return text.trimEnd(); -} -function getDescription(description, short) { - return short ? description.trim().split("\n", 1)[0].trim() : dedent(description); -} - -// dist/dnt/esm/deps/deno.land/x/cliffy@v0.25.7/command/_errors.js -var CommandError = class _CommandError extends Error { - constructor(message) { - super(message); - Object.setPrototypeOf(this, _CommandError.prototype); - } -}; -var ValidationError2 = class _ValidationError extends CommandError { - constructor(message, { exitCode } = {}) { - super(message); - Object.defineProperty(this, "exitCode", { - enumerable: true, - configurable: true, - writable: true, - value: void 0 - }); - Object.defineProperty(this, "cmd", { - enumerable: true, - configurable: true, - writable: true, - value: void 0 - }); - Object.setPrototypeOf(this, _ValidationError.prototype); - this.exitCode = exitCode ?? 1; - } -}; -var DuplicateOptionNameError = class _DuplicateOptionNameError extends CommandError { - constructor(name) { - super(`Option with name "${getFlag(name)}" already exists.`); - Object.setPrototypeOf(this, _DuplicateOptionNameError.prototype); - } -}; -var MissingCommandNameError = class _MissingCommandNameError extends CommandError { - constructor() { - super("Missing command name."); - Object.setPrototypeOf(this, _MissingCommandNameError.prototype); - } -}; -var DuplicateCommandNameError = class _DuplicateCommandNameError extends CommandError { - constructor(name) { - super(`Duplicate command name "${name}".`); - Object.setPrototypeOf(this, _DuplicateCommandNameError.prototype); - } -}; -var DuplicateCommandAliasError = class _DuplicateCommandAliasError extends CommandError { - constructor(alias) { - super(`Duplicate command alias "${alias}".`); - Object.setPrototypeOf(this, _DuplicateCommandAliasError.prototype); - } -}; -var CommandNotFoundError = class _CommandNotFoundError extends CommandError { - constructor(name, commands, excluded) { - super(`Unknown command "${name}".${didYouMeanCommand(name, commands, excluded)}`); - Object.setPrototypeOf(this, _CommandNotFoundError.prototype); - } -}; -var DuplicateTypeError = class _DuplicateTypeError extends CommandError { - constructor(name) { - super(`Type with name "${name}" already exists.`); - Object.setPrototypeOf(this, _DuplicateTypeError.prototype); - } -}; -var DuplicateCompletionError = class _DuplicateCompletionError extends CommandError { - constructor(name) { - super(`Completion with name "${name}" already exists.`); - Object.setPrototypeOf(this, _DuplicateCompletionError.prototype); - } -}; -var DuplicateExampleError = class _DuplicateExampleError extends CommandError { - constructor(name) { - super(`Example with name "${name}" already exists.`); - Object.setPrototypeOf(this, _DuplicateExampleError.prototype); - } -}; -var DuplicateEnvVarError = class _DuplicateEnvVarError extends CommandError { - constructor(name) { - super(`Environment variable with name "${name}" already exists.`); - Object.setPrototypeOf(this, _DuplicateEnvVarError.prototype); - } -}; -var MissingRequiredEnvVarError = class _MissingRequiredEnvVarError extends ValidationError2 { - constructor(envVar) { - super(`Missing required environment variable "${envVar.names[0]}".`); - Object.setPrototypeOf(this, _MissingRequiredEnvVarError.prototype); - } -}; -var TooManyEnvVarValuesError = class _TooManyEnvVarValuesError extends CommandError { - constructor(name) { - super(`An environment variable can only have one value, but "${name}" has more than one.`); - Object.setPrototypeOf(this, _TooManyEnvVarValuesError.prototype); - } -}; -var UnexpectedOptionalEnvVarValueError = class _UnexpectedOptionalEnvVarValueError extends CommandError { - constructor(name) { - super(`An environment variable cannot have an optional value, but "${name}" is defined as optional.`); - Object.setPrototypeOf(this, _UnexpectedOptionalEnvVarValueError.prototype); - } -}; -var UnexpectedVariadicEnvVarValueError = class _UnexpectedVariadicEnvVarValueError extends CommandError { - constructor(name) { - super(`An environment variable cannot have an variadic value, but "${name}" is defined as variadic.`); - Object.setPrototypeOf(this, _UnexpectedVariadicEnvVarValueError.prototype); - } -}; -var DefaultCommandNotFoundError = class _DefaultCommandNotFoundError extends CommandError { - constructor(name, commands) { - super(`Default command "${name}" not found.${didYouMeanCommand(name, commands)}`); - Object.setPrototypeOf(this, _DefaultCommandNotFoundError.prototype); - } -}; -var CommandExecutableNotFoundError = class _CommandExecutableNotFoundError extends CommandError { - constructor(name) { - super(`Command executable not found: ${name}`); - Object.setPrototypeOf(this, _CommandExecutableNotFoundError.prototype); - } -}; -var UnknownCommandError = class _UnknownCommandError extends ValidationError2 { - constructor(name, commands, excluded) { - super(`Unknown command "${name}".${didYouMeanCommand(name, commands, excluded)}`); - Object.setPrototypeOf(this, _UnknownCommandError.prototype); - } -}; -var NoArgumentsAllowedError = class _NoArgumentsAllowedError extends ValidationError2 { - constructor(name) { - super(`No arguments allowed for command "${name}".`); - Object.setPrototypeOf(this, _NoArgumentsAllowedError.prototype); - } -}; -var MissingArgumentsError = class _MissingArgumentsError extends ValidationError2 { - constructor(names) { - super(`Missing argument(s): ${names.join(", ")}`); - Object.setPrototypeOf(this, _MissingArgumentsError.prototype); - } -}; -var MissingArgumentError = class _MissingArgumentError extends ValidationError2 { - constructor(name) { - super(`Missing argument: ${name}`); - Object.setPrototypeOf(this, _MissingArgumentError.prototype); - } -}; -var TooManyArgumentsError = class _TooManyArgumentsError extends ValidationError2 { - constructor(args) { - super(`Too many arguments: ${args.join(" ")}`); - Object.setPrototypeOf(this, _TooManyArgumentsError.prototype); - } -}; - -// dist/dnt/esm/deps/deno.land/x/cliffy@v0.25.7/flags/types/boolean.js +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/flags/types/boolean.js var boolean = (type) => { if (~["1", "true"].indexOf(type.value)) { return true; @@ -8056,7 +7833,7 @@ var boolean = (type) => { throw new InvalidTypeError(type, ["true", "false", "1", "0"]); }; -// dist/dnt/esm/deps/deno.land/x/cliffy@v0.25.7/flags/types/number.js +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/flags/types/number.js var number = (type) => { const value = Number(type.value); if (Number.isFinite(value)) { @@ -8065,29 +7842,29 @@ var number = (type) => { throw new InvalidTypeError(type); }; -// dist/dnt/esm/deps/deno.land/x/cliffy@v0.25.7/flags/types/string.js +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/flags/types/string.js var string = ({ value }) => { return value; }; -// dist/dnt/esm/deps/deno.land/x/cliffy@v0.25.7/flags/_validate_flags.js +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/flags/_validate_flags.js function validateFlags(ctx, opts, options = /* @__PURE__ */ new Map()) { if (!opts.flags) { return; } - const defaultValues = setDefaultValues(ctx, opts); + setDefaultValues(ctx, opts); const optionNames = Object.keys(ctx.flags); if (!optionNames.length && opts.allowEmpty) { return; } if (ctx.standalone) { - validateStandaloneOption(ctx, options, optionNames, defaultValues); + validateStandaloneOption(ctx, options, optionNames); return; } for (const [name, option] of options) { validateUnknownOption(option, opts); validateConflictingOptions(ctx, option); - validateDependingOptions(ctx, option, defaultValues); + validateDependingOptions(ctx, option); validateRequiredValues(ctx, option, name); } validateRequiredOptions(ctx, options, opts); @@ -8098,9 +7875,8 @@ function validateUnknownOption(option, opts) { } } function setDefaultValues(ctx, opts) { - const defaultValues = {}; if (!opts.flags?.length) { - return defaultValues; + return; } for (const option of opts.flags) { let name; @@ -8123,20 +7899,19 @@ function setDefaultValues(ctx, opts) { const hasDefaultValue = (!opts.ignoreDefaults || typeof opts.ignoreDefaults[name] === "undefined") && typeof ctx.flags[name] === "undefined" && (typeof option.default !== "undefined" || typeof defaultValue !== "undefined"); if (hasDefaultValue) { ctx.flags[name] = getDefaultValue(option) ?? defaultValue; - defaultValues[option.name] = true; + ctx.defaults[option.name] = true; if (typeof option.value === "function") { ctx.flags[name] = option.value(ctx.flags[name]); } } } - return defaultValues; } -function validateStandaloneOption(ctx, options, optionNames, defaultValues) { +function validateStandaloneOption(ctx, options, optionNames) { if (!ctx.standalone || optionNames.length === 1) { return; } for (const [_, opt] of options) { - if (!defaultValues[opt.name] && opt !== ctx.standalone) { + if (!ctx.defaults[opt.name] && opt !== ctx.standalone) { throw new OptionNotCombinableError(ctx.standalone.name); } } @@ -8151,12 +7926,12 @@ function validateConflictingOptions(ctx, option) { } } } -function validateDependingOptions(ctx, option, defaultValues) { +function validateDependingOptions(ctx, option) { if (!option.depends) { return; } for (const flag of option.depends) { - if (!isset(flag, ctx.flags) && !defaultValues[option.name]) { + if (!isset(flag, ctx.flags) && !ctx.defaults[option.name]) { throw new DependingOptionError(option.name, flag); } } @@ -8168,7 +7943,7 @@ function validateRequiredValues(ctx, option, name) { const isArray = option.args.length > 1; for (let i = 0; i < option.args.length; i++) { const arg = option.args[i]; - if (!arg.requiredValue) { + if (arg.optional) { continue; } const hasValue = isArray ? typeof ctx.flags[name][i] !== "undefined" : typeof ctx.flags[name] !== "undefined"; @@ -8200,7 +7975,7 @@ function isset(flagName, flags) { return typeof flags[name] !== "undefined"; } -// dist/dnt/esm/deps/deno.land/x/cliffy@v0.25.7/flags/types/integer.js +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/flags/types/integer.js var integer = (type) => { const value = Number(type.value); if (Number.isInteger(value)) { @@ -8209,7 +7984,7 @@ var integer = (type) => { throw new InvalidTypeError(type); }; -// dist/dnt/esm/deps/deno.land/x/cliffy@v0.25.7/flags/flags.js +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/flags/flags.js var DefaultTypes = { string, number, @@ -8233,6 +8008,7 @@ function parseFlags(argsOrCtx, opts = {}) { ctx.unknown ??= []; ctx.stopEarly = false; ctx.stopOnUnknown = false; + ctx.defaults ??= {}; opts.dotted ??= true; validateOptions(opts); const options = parseArgs(ctx, args, opts); @@ -8262,10 +8038,10 @@ function parseArgs(ctx, args, opts) { for (let argsIndex = 0; argsIndex < args.length; argsIndex++) { let parseNext = function(option2) { if (negate) { - ctx.flags[propName] = false; + setFlagValue(false); return; } else if (!option2.args?.length) { - ctx.flags[propName] = void 0; + setFlagValue(void 0); return; } const arg = option2.args[optionArgsIndex]; @@ -8276,16 +8052,10 @@ function parseArgs(ctx, args, opts) { if (!arg.type) { arg.type = OptionType.BOOLEAN; } - if (option2.args?.length && !option2.type) { - if ((typeof arg.optionalValue === "undefined" || arg.optionalValue === false) && typeof arg.requiredValue === "undefined") { - arg.requiredValue = true; - } - } else { - if (arg.type !== OptionType.BOOLEAN && (typeof arg.optionalValue === "undefined" || arg.optionalValue === false) && typeof arg.requiredValue === "undefined") { - arg.requiredValue = true; - } + if (!option2.args?.length && arg.type === OptionType.BOOLEAN && arg.optional === void 0) { + arg.optional = true; } - if (!arg.requiredValue) { + if (arg.optional) { inOptionalArg = true; } else if (inOptionalArg) { throw new UnexpectedRequiredArgumentError(option2.name); @@ -8306,7 +8076,7 @@ function parseArgs(ctx, args, opts) { } else { if (hasNext(arg)) { result = parseValue(option2, arg, next()); - } else if (arg.optionalValue && arg.type === OptionType.BOOLEAN) { + } else if (arg.optional && arg.type === OptionType.BOOLEAN) { result = true; } } @@ -8320,14 +8090,14 @@ function parseArgs(ctx, args, opts) { } if (typeof result !== "undefined" && (option2.args.length > 1 || arg.variadic)) { if (!ctx.flags[propName]) { - ctx.flags[propName] = []; + setFlagValue([]); } ctx.flags[propName].push(result); if (hasNext(arg)) { parseNext(option2); } } else { - ctx.flags[propName] = result; + setFlagValue(result); } function hasNext(arg2) { if (!option2.args?.length) { @@ -8340,13 +8110,13 @@ function parseArgs(ctx, args, opts) { if (option2.args.length > 1 && optionArgsIndex >= option2.args.length) { return false; } - if (arg2.requiredValue) { + if (!arg2.optional) { return true; } - if (option2.equalsSign && arg2.optionalValue && !arg2.variadic && typeof currentValue === "undefined") { + if (option2.equalsSign && arg2.optional && !arg2.variadic && typeof currentValue === "undefined") { return false; } - if (arg2.optionalValue || arg2.variadic) { + if (arg2.optional || arg2.variadic) { return nextValue[0] !== "-" || typeof currentValue !== "undefined" || arg2.type === OptionType.NUMBER && !isNaN(Number(nextValue)); } return false; @@ -8363,6 +8133,11 @@ function parseArgs(ctx, args, opts) { } return result2; } + }, setFlagValue = function(value) { + ctx.flags[propName] = value; + if (ctx.defaults[propName]) { + delete ctx.defaults[propName]; + } }; let option; let current = args[argsIndex]; @@ -8431,15 +8206,14 @@ function parseArgs(ctx, args, opts) { if (typeof ctx.flags[propName] !== "undefined") { if (!opts.flags?.length) { option.collect = true; - } else if (!option.collect) { + } else if (!option.collect && !ctx.defaults[option.name]) { throw new DuplicateOptionError(current); } } if (option.type && !option.args?.length) { option.args = [{ type: option.type, - requiredValue: option.requiredValue, - optionalValue: option.optionalValue, + optional: option.optionalValue, variadic: option.variadic, list: option.list, separator: option.separator @@ -8454,20 +8228,21 @@ function parseArgs(ctx, args, opts) { const previous = ctx.flags[propName]; parseNext(option); if (typeof ctx.flags[propName] === "undefined") { - if (option.args?.[optionArgsIndex]?.requiredValue) { + if (option.args?.length && !option.args?.[optionArgsIndex].optional) { throw new MissingOptionValueError(option.name); - } else if (typeof option.default !== "undefined") { + } else if (typeof option.default !== "undefined" && (option.type || option.value || option.args?.length)) { ctx.flags[propName] = getDefaultValue(option); } else { - ctx.flags[propName] = true; + setFlagValue(true); } } if (option.value) { - ctx.flags[propName] = option.value(ctx.flags[propName], previous); + const value = option.value(ctx.flags[propName], previous); + setFlagValue(value); } else if (option.collect) { const value = typeof previous !== "undefined" ? Array.isArray(previous) ? previous : [previous] : []; value.push(ctx.flags[propName]); - ctx.flags[propName] = value; + setFlagValue(value); } optionsMap.set(propName, option); opts.option?.(option, ctx.flags[propName]); @@ -8523,23 +8298,252 @@ function parseDefaultType(option, arg, value) { }); } -// dist/dnt/esm/deps/deno.land/x/cliffy@v0.25.7/command/type.js -var Type = class { -}; - -// dist/dnt/esm/deps/deno.land/x/cliffy@v0.25.7/command/types/boolean.js -var BooleanType = class extends Type { - /** Parse boolean type. */ - parse(type) { - return boolean(type); - } - /** Complete boolean type. */ - complete() { - return ["true", "false"]; +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/command/_utils.js +function didYouMeanCommand(command, commands, excludes = []) { + const commandNames = commands.map((command2) => command2.getName()).filter((command2) => !excludes.includes(command2)); + return didYouMean(" Did you mean command", command, commandNames); +} +var ARGUMENT_REGEX = /^[<\[].+[\]>]$/; +var ARGUMENT_DETAILS_REGEX = /[<\[:>\]]/; +function splitArguments(args) { + const parts = args.trim().split(/[, =] */g); + const typeParts = []; + while (parts[parts.length - 1] && ARGUMENT_REGEX.test(parts[parts.length - 1])) { + typeParts.unshift(parts.pop()); } + const typeDefinition = typeParts.join(" "); + return { flags: parts, typeDefinition, equalsSign: args.includes("=") }; +} +function parseArgumentsDefinition(argsDefinition, validate = true, all) { + const argumentDetails = []; + let hasOptional = false; + let hasVariadic = false; + const parts = argsDefinition.split(/ +/); + for (const arg of parts) { + if (validate && hasVariadic) { + throw new UnexpectedArgumentAfterVariadicArgumentError(arg); + } + const parts2 = arg.split(ARGUMENT_DETAILS_REGEX); + if (!parts2[1]) { + if (all) { + argumentDetails.push(parts2[0]); + } + continue; + } + const type = parts2[2] || OptionType.STRING; + const details = { + optional: arg[0] === "[", + name: parts2[1], + action: parts2[3] || type, + variadic: false, + list: type ? arg.indexOf(type + "[]") !== -1 : false, + type + }; + if (validate && !details.optional && hasOptional) { + throw new UnexpectedRequiredArgumentError(details.name); + } + if (arg[0] === "[") { + hasOptional = true; + } + if (details.name.length > 3) { + const istVariadicLeft = details.name.slice(0, 3) === "..."; + const istVariadicRight = details.name.slice(-3) === "..."; + hasVariadic = details.variadic = istVariadicLeft || istVariadicRight; + if (istVariadicLeft) { + details.name = details.name.slice(3); + } else if (istVariadicRight) { + details.name = details.name.slice(0, -3); + } + } + argumentDetails.push(details); + } + return argumentDetails; +} +function dedent(str) { + const lines = str.split(/\r?\n|\r/g); + let text = ""; + let indent = 0; + for (const line of lines) { + if (text || line.trim()) { + if (!text) { + text = line.trimStart(); + indent = line.length - text.length; + } else { + text += line.slice(indent); + } + text += "\n"; + } + } + return text.trimEnd(); +} +function getDescription(description, short) { + return short ? description.trim().split("\n", 1)[0].trim() : dedent(description); +} + +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/command/_errors.js +var CommandError = class _CommandError extends Error { + constructor(message) { + super(message); + Object.setPrototypeOf(this, _CommandError.prototype); + } +}; +var ValidationError2 = class _ValidationError extends CommandError { + constructor(message, { exitCode } = {}) { + super(message); + Object.defineProperty(this, "exitCode", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "cmd", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.setPrototypeOf(this, _ValidationError.prototype); + this.exitCode = exitCode ?? 2; + } +}; +var DuplicateOptionNameError = class _DuplicateOptionNameError extends CommandError { + constructor(optionName, commandName) { + super(`An option with name '${bold(getFlag(optionName))}' is already registered on command '${bold(commandName)}'. If it is intended to override the option, set the '${bold("override")}' option of the '${bold("option")}' method to true.`); + Object.setPrototypeOf(this, _DuplicateOptionNameError.prototype); + } +}; +var MissingCommandNameError = class _MissingCommandNameError extends CommandError { + constructor() { + super("Missing command name."); + Object.setPrototypeOf(this, _MissingCommandNameError.prototype); + } +}; +var DuplicateCommandNameError = class _DuplicateCommandNameError extends CommandError { + constructor(name) { + super(`Duplicate command name "${name}".`); + Object.setPrototypeOf(this, _DuplicateCommandNameError.prototype); + } +}; +var DuplicateCommandAliasError = class _DuplicateCommandAliasError extends CommandError { + constructor(alias) { + super(`Duplicate command alias "${alias}".`); + Object.setPrototypeOf(this, _DuplicateCommandAliasError.prototype); + } +}; +var CommandNotFoundError = class _CommandNotFoundError extends CommandError { + constructor(name, commands, excluded) { + super(`Unknown command "${name}".${didYouMeanCommand(name, commands, excluded)}`); + Object.setPrototypeOf(this, _CommandNotFoundError.prototype); + } +}; +var DuplicateTypeError = class _DuplicateTypeError extends CommandError { + constructor(name) { + super(`Type with name "${name}" already exists.`); + Object.setPrototypeOf(this, _DuplicateTypeError.prototype); + } +}; +var DuplicateCompletionError = class _DuplicateCompletionError extends CommandError { + constructor(name) { + super(`Completion with name "${name}" already exists.`); + Object.setPrototypeOf(this, _DuplicateCompletionError.prototype); + } +}; +var DuplicateExampleError = class _DuplicateExampleError extends CommandError { + constructor(name) { + super(`Example with name "${name}" already exists.`); + Object.setPrototypeOf(this, _DuplicateExampleError.prototype); + } +}; +var DuplicateEnvVarError = class _DuplicateEnvVarError extends CommandError { + constructor(name) { + super(`Environment variable with name "${name}" already exists.`); + Object.setPrototypeOf(this, _DuplicateEnvVarError.prototype); + } +}; +var MissingRequiredEnvVarError = class _MissingRequiredEnvVarError extends ValidationError2 { + constructor(envVar) { + super(`Missing required environment variable "${envVar.names[0]}".`); + Object.setPrototypeOf(this, _MissingRequiredEnvVarError.prototype); + } +}; +var TooManyEnvVarValuesError = class _TooManyEnvVarValuesError extends CommandError { + constructor(name) { + super(`An environment variable can only have one value, but "${name}" has more than one.`); + Object.setPrototypeOf(this, _TooManyEnvVarValuesError.prototype); + } +}; +var UnexpectedOptionalEnvVarValueError = class _UnexpectedOptionalEnvVarValueError extends CommandError { + constructor(name) { + super(`An environment variable cannot have an optional value, but "${name}" is defined as optional.`); + Object.setPrototypeOf(this, _UnexpectedOptionalEnvVarValueError.prototype); + } +}; +var UnexpectedVariadicEnvVarValueError = class _UnexpectedVariadicEnvVarValueError extends CommandError { + constructor(name) { + super(`An environment variable cannot have an variadic value, but "${name}" is defined as variadic.`); + Object.setPrototypeOf(this, _UnexpectedVariadicEnvVarValueError.prototype); + } +}; +var DefaultCommandNotFoundError = class _DefaultCommandNotFoundError extends CommandError { + constructor(name, commands) { + super(`Default command "${name}" not found.${didYouMeanCommand(name, commands)}`); + Object.setPrototypeOf(this, _DefaultCommandNotFoundError.prototype); + } +}; +var CommandExecutableNotFoundError = class _CommandExecutableNotFoundError extends CommandError { + constructor(name) { + super(`Command executable not found: ${name}`); + Object.setPrototypeOf(this, _CommandExecutableNotFoundError.prototype); + } +}; +var UnknownCommandError = class _UnknownCommandError extends ValidationError2 { + constructor(name, commands, excluded) { + super(`Unknown command "${name}".${didYouMeanCommand(name, commands, excluded)}`); + Object.setPrototypeOf(this, _UnknownCommandError.prototype); + } +}; +var NoArgumentsAllowedError = class _NoArgumentsAllowedError extends ValidationError2 { + constructor(name) { + super(`No arguments allowed for command "${name}".`); + Object.setPrototypeOf(this, _NoArgumentsAllowedError.prototype); + } +}; +var MissingArgumentsError = class _MissingArgumentsError extends ValidationError2 { + constructor(names) { + super(`Missing argument(s): ${names.join(", ")}`); + Object.setPrototypeOf(this, _MissingArgumentsError.prototype); + } +}; +var MissingArgumentError = class _MissingArgumentError extends ValidationError2 { + constructor(name) { + super(`Missing argument: ${name}`); + Object.setPrototypeOf(this, _MissingArgumentError.prototype); + } +}; +var TooManyArgumentsError = class _TooManyArgumentsError extends ValidationError2 { + constructor(args) { + super(`Too many arguments: ${args.join(" ")}`); + Object.setPrototypeOf(this, _TooManyArgumentsError.prototype); + } +}; + +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/command/type.js +var Type = class { }; -// dist/dnt/esm/deps/deno.land/x/cliffy@v0.25.7/command/types/string.js +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/command/types/boolean.js +var BooleanType = class extends Type { + /** Parse boolean type. */ + parse(type) { + return boolean(type); + } + /** Complete boolean type. */ + complete() { + return ["true", "false"]; + } +}; + +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/command/types/string.js var StringType = class extends Type { /** Complete string type. */ parse(type) { @@ -8547,14 +8551,22 @@ var StringType = class extends Type { } }; -// dist/dnt/esm/deps/deno.land/x/cliffy@v0.25.7/command/types/file.js +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/command/types/file.js var FileType = class extends StringType { constructor() { super(); } }; -// dist/dnt/esm/deps/deno.land/x/cliffy@v0.25.7/command/types/number.js +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/command/types/integer.js +var IntegerType = class extends Type { + /** Parse integer type. */ + parse(type) { + return integer(type); + } +}; + +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/command/types/number.js var NumberType = class extends Type { /** Parse number type. */ parse(type) { @@ -8562,7 +8574,7 @@ var NumberType = class extends Type { } }; -// dist/dnt/esm/deps/deno.land/x/cliffy@v0.25.7/table/border.js +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/table/border.js var border = { top: "\u2500", topMid: "\u252C", @@ -8581,7 +8593,7 @@ var border = { middle: "\u2502" }; -// dist/dnt/esm/deps/deno.land/x/cliffy@v0.25.7/table/cell.js +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/table/cell.js var Cell = class _Cell { /** Get cell length. */ get length() { @@ -8590,17 +8602,22 @@ var Cell = class _Cell { /** * Create a new cell. If value is a cell, the value and all options of the cell * will be copied to the new cell. + * * @param value Cell or cell value. */ static from(value) { - const cell = new this(value); + let cell; if (value instanceof _Cell) { + cell = new this(value.getValue()); cell.options = { ...value.options }; + } else { + cell = new this(value); } return cell; } /** * Cell constructor. + * * @param value Cell value. */ constructor(value) { @@ -8617,12 +8634,17 @@ var Cell = class _Cell { value: {} }); } - /** Get cell value. */ + /** Get cell string value. */ toString() { return this.value.toString(); } + /** Get cell value. */ + getValue() { + return this.value; + } /** * Set cell value. + * * @param value Cell or cell value. */ setValue(value) { @@ -8631,22 +8653,22 @@ var Cell = class _Cell { } /** * Clone cell with all options. + * * @param value Cell or cell value. */ clone(value) { - const cell = new _Cell(value ?? this); - cell.options = { ...this.options }; - return cell; + return _Cell.from(value ?? this); } /** * Setter: */ /** * Enable/disable cell border. + * * @param enable Enable/disable cell border. * @param override Override existing value. */ - border(enable, override = true) { + border(enable = true, override = true) { if (override || typeof this.options.border === "undefined") { this.options.border = enable; } @@ -8654,6 +8676,23 @@ var Cell = class _Cell { } /** * Set col span. + * + * ```ts + * import { Cell, Table } from "./mod.ts"; + * + * new Table() + * .body([ + * [ + * new Cell("Row 1 & 2 Column 1").rowSpan(2), + * "Row 1 Column 2", + * "Row 1 Column 3", + * ], + * [new Cell("Row 2 Column 2 & 3").colSpan(2)], + * ]) + * .border() + * .render(); + * ``` + * * @param span Number of cols to span. * @param override Override existing value. */ @@ -8665,6 +8704,23 @@ var Cell = class _Cell { } /** * Set row span. + * + * ```ts + * import { Cell, Table } from "./mod.ts"; + * + * new Table() + * .body([ + * [ + * new Cell("Row 1 & 2 Column 1").rowSpan(2), + * "Row 1 Column 2", + * "Row 1 Column 3", + * ], + * [new Cell("Row 2 Column 2 & 3").colSpan(2)], + * ]) + * .border() + * .render(); + * ``` + * * @param span Number of rows to span. * @param override Override existing value. */ @@ -8676,6 +8732,7 @@ var Cell = class _Cell { } /** * Align cell content. + * * @param direction Align direction. * @param override Override existing value. */ @@ -8706,7 +8763,172 @@ var Cell = class _Cell { } }; -// dist/dnt/esm/deps/deno.land/x/cliffy@v0.25.7/table/row.js +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/table/column.js +var Column = class _Column { + constructor() { + Object.defineProperty(this, "opts", { + enumerable: true, + configurable: true, + writable: true, + value: {} + }); + } + /** + * Create a new cell from column options or an existing column. + * @param options + */ + static from(options) { + const opts = options instanceof _Column ? options.opts : options; + return new _Column().options(opts); + } + /** Set column options. */ + options(options) { + Object.assign(this.opts, options); + return this; + } + /** Set min column width. */ + minWidth(width) { + this.opts.minWidth = width; + return this; + } + /** Set max column width. */ + maxWidth(width) { + this.opts.maxWidth = width; + return this; + } + /** Set column border. */ + border(border2 = true) { + this.opts.border = border2; + return this; + } + /** Set column padding. */ + padding(padding) { + this.opts.padding = padding; + return this; + } + /** Set column alignment. */ + align(direction) { + this.opts.align = direction; + return this; + } + /** Get min column width. */ + getMinWidth() { + return this.opts.minWidth; + } + /** Get max column width. */ + getMaxWidth() { + return this.opts.maxWidth; + } + /** Get column border. */ + getBorder() { + return this.opts.border; + } + /** Get column padding. */ + getPadding() { + return this.opts.padding; + } + /** Get column alignment. */ + getAlign() { + return this.opts.align; + } +}; + +// dist/dnt/esm/deps/deno.land/std@0.196.0/console/_data.js +var data_default = { + "UNICODE_VERSION": "15.0.0", + "tables": [ + { + "d": "AAECAwQFBgcICQoLDA0OAw8DDwkQCRESERIA", + "r": "AQEBAgEBAQEBAQEBAQEBBwEHAVABBwcBBwF4" + }, + { + "d": "AAECAwQFBgcGCAYJCgsMDQ4PEAYREhMUBhUWFxgZGhscHR4fICEiIyIkJSYnKCkqJSssLS4vMDEyMzQ1Njc4OToGOzwKBj0GPj9AQUIGQwZEBkVGR0hJSktMTQZOBgoGT1BRUlNUVVZXWFkGWgZbBlxdXl1fYGFiY2RlZmdoBmlqBmsGAQZsBm1uO29wcXI7czt0dXZ3OwY7eHkGent8Bn0Gfn+AgYKDhIWGBoc7iAZdO4kGiosGAXGMBo0GjgaPBpAGkQaSBpMGlJUGlpcGmJmam5ydnp+gLgahLKIGo6SlpganqKmqqwasBq0Grq8GsLGyswa0BrUGtre4Brm6uwZHvAa9vga/wME7wjvDxAbFO8bHO8gGyQbKywbMzQbOBs/Q0QbSBr8GvgbT1AbUBtUG1gbXBtjZ2tsG3N0G3t/g4eLjO+Tl5ufoO+k76gbrBuztOwbu7/AGO+XxCgYKCwZd8g==", + "r": "AQEBAQEBAQEBAQEBAQEBAQEBAQMBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQECBQEOAQEBAQEBAQEBAwEBAQEBAQEBAQIBAwEIAQEBAQEBAQEBAQEBAQIBAQEBAQEBAQEBAQEBAQEBDQEBBQEBAQEBAgEBAwEBAQEBAQEBAQEBbQHaAQEFAQEBBAECAQEBAQEBAQEBAwGuASFkCAELAQEBAQEBAQEHAQMBAQEaAQIBCAEFAQEBAQEBAQEBAQEBAQEBAQEBAQECAQEBAQIBAQEBAQEBAwEDAQEBAQEBAQUBAQEBAQEBBAEBAVIBAdkBARABAQFfARMBAYoBBAEBBQEmAUkBAQcBAQIBHgEBARUBAQEBAQUBAQcBDwEBARoBAgEBAQEBAQECAQEBAQEBAQEBAQEBAQEBAQMBBAEBAgEBAQEUfwEBAQIDAXj/AQ==" + }, + { + "d": "AFUVAF3Xd3X/93//VXVVV9VX9V91f1/31X93XVXdVdVV9dVV/VVX1X9X/131VfXVVXV3V1VdVV1V1/1dV1X/3VUAVf3/3/9fVf3/3/9fVV1V/11VFQBQVQEAEEEQVQBQVQBAVFUVAFVUVQUAEAAUBFBVFVFVAEBVBQBUVRUAVVFVBRAAAVBVAVVQVQBVBQBAVUVUAQBUUQEAVQVVUVVUAVRVUVUFVUVBVVRBFRRQUVVQUVUBEFRRVQVVBQBRVRQBVFVRVUFVBVVFVVRVUVVUVQRUBQRQVUFVBVVFVVBVBVVQVRVUAVRVUVUFVVFVRVUFRFVRAEBVFQBAVVEAVFUAQFVQVRFRVQEAQAAEVQEAAQBUVUVVAQQAQVVQBVRVAVRVRUFVUVVRVaoAVQFVBVRVBVUFVQVVEABQVUUBAFVRVRUAVUFVUVVAFVRVRVUBVRUUVUUAQEQBAFQVABRVAEBVAFUEQFRFVRUAVVBVBVAQUFVFUBFQVQAFVUAABABUUVVUUFUVANd/X3//BUD3XdV1VQAEAFVXVdX9V1VXVQBUVdVdVdV1VX111VXVV9V//1X/X1VdVf9fVV9VdVdV1VX31dfVXXX9193/d1X/VV9VV3VVX//1VfVVXVVdVdVVdVWlVWlVqVaWVf/f/1X/Vf/1X1Xf/19V9VVf9df1X1X1X1XVVWlVfV31VVpVd1V3VapV33/fVZVVlVX1WVWlVelV+v/v//7/31Xv/6/77/tVWaVVVlVdVWaVmlX1/1WpVVZVlVWVVlVW+V9VFVBVAKqaqlWqWlWqVaoKoKpqqapqgapVqaqpqmqqVapqqv+qVqpqVRVAAFBVBVVQVUUVVUFVVFVQVQBQVRVVBQBQVRUAUFWqVkBVFQVQVVFVAUBBVRVVVFVUVQQUVAVRVVBVRVVRVFFVqlVFVQCqWlUAqmqqaqpVqlZVqmpVAV1VUVVUVQVAVQFBVQBVQBVVQVUAVRVUVQFVBQBUVQVQVVFVAEBVFFRVFVBVFUBBUUVVUVVAVRUAAQBUVRVVUFUFAEBVARRVFVAEVUVVFQBAVVRVBQBUAFRVAAVEVUVVFQBEFQRVBVBVEFRVUFUVAEARVFUVUQAQVQEFEABVFQBBVRVEFVUABVVUVQEAQFUVABRAVRVVAUABVQUAQFBVAEAAEFUFAAUABEFVAUBFEAAQVVARVRVUVVBVBUBVRFVUFQBQVQBUVQBAVRVVFUBVqlRVWlWqVapaVapWVaqpqmmqalVlVWpZVapVqlVBAFUAUABAVRVQVRUAQAEAVQVQVQVUVQBAFQBUVVFVVFUVAAEAVQBAABQAEARAVUVVAFUAQFUAQFVWVZVV/39V/1//X1X/76uq6v9XVWpVqlWqVlVaVapaVapWVamqmqqmqlWqapWqVapWqmqmqpaqWlWVaqpVZVVpVVZVlapVqlpVVmqpVapVlVZVqlZVqlVWVapqqpqqVapWqlZVqpqqWlWlqlWqVlWqVlVRVQD/Xw==", + "r": "CBcBCAEBAQEBAQEBAQECAQEBAQEBAQEBAQEBAQMBAQECAQEBAQEBAQEBAQEBBAEBGAEDAQwBAwEIAQEBAQEBAQgcCAEDAQEBAQEDAQEBDQEDEAELAQEBEQEKAQEBDgEBAgIBAQoBBQQBCAEBAQEBAQEHAQEHBgEWAQIBDQECAgEFAQECAgEKAQ0BAQIKAQ0BDQEBAQEBAQEBAgEHAQ4BAQEBAQQBBgEBDgEBAQEBAQcBAQIBAQEBBAEFAQEBDgEBAQEBAQECAQcBDwECAQwCDQEBAQEBAQECAQgBAQEEAQcBDQEBAQEBAQQBBwERAQEBARYBAQECAQEBGAECAQIBARIBBgEBDQECAQEBAQECAQgBAQEZAQEBAgYBAQEDAQECAQEBAQMBCBgIBwEMAQEGAQcBBwEQAQEBAQEBAgIBCgEBDQEIAQ0BAQEBAQEBBgEBDgEBAQEBAQEBAgEMBwEMAQwBAQEBCQECAwEHAQEBAQ0BAQEBDgIBBgEDAQEBAQEBAQMBAQEBAgEBAQEBAQEBCAEBAgEBAQEBAQkBCAgBAwECAQEBAgEBAQkBAQEBAwECAQMBAQIBBwEFAQEDAQYBAQEBAgEBAQEBAQEBAQECAgEDAQECBAIDAgIBBQEEAQEBAwEPAQEBCyIBCAEJAwQBAQIBAQEBAgECAQEBAQMBAQEBAwEBAQEBAQEBAQgBAQMDAgEBAwEEAQIBAQEBBAEBAQEBAQECAQEBAQEBAQEBAQEHAQQBAwEBAQcBAgUBBgECAQYBAQwBAQEUAQELCAYBFgMFAQYDAQoBAQMBARQBAQkBAQoBBgEVAwsBCgIPAQ0BGQEBAgEHARQBAwIBBgEBAQUBBgQBAgEJAQEBBQECAQMHAQELAQECCQEQAQECAgECAQsBDAEBAQEBCgEBAQsBAQEECQ4BCAQCAQEECAEEAQEFCAEPAQEEAQEPAQgBFAEBAQEBAQEKAQEJAQ8BEAEBEwEBAQIBCwEBDgENAwEKAQEBAQELAQEBAQECAQwBCAEBAQEBDgEDAQwBAQECAQEXAQEBAQEHAgEBBQEIAQEBAQEQAgEBBQEUAQEBAQEbAQEBAQEGARQBAQEBARkBAQEBCQEBAQEQAQIBDwEBARQBAQEBBwEBAQkBAQEBAQECAQEBCwECAQEVAQEBAQQBBQEBAQEOAQEBAQEBEgEBFgEBAgEMAQEBAQ8BAQMBFgEBDgEBBQEPAQETAQECAQMOAgUBCgIBGQEBAQEIAQMBBwEBAwECEwgBAQcLAQUBFwEBAQEDAQEBBwEBBAEBDg0BAQwBAQEDAQQBAQEDBAEBBAEBAQEBEAEPAQgBAQsBAQ4BEQEMAgEBBwEOAQEHAQEBAQQBBAEDCwECAQEBAwEBBggBAgEBAREBBQMKAQEBAwQCEQEBHgEPAQIBAQYEAQYBAwEUAQUMAQEBAQEBAQECAQEBAgEIAwEBBgsBAgEODAMBAgEBCwEBAQEBAwECAQECAQEBBwgPAQ==" + } + ] +}; + +// dist/dnt/esm/deps/deno.land/std@0.196.0/console/_rle.js +function runLengthDecode({ d, r }) { + const data = atob(d); + const runLengths = atob(r); + let out = ""; + for (const [i, ch] of [...runLengths].entries()) { + out += data[i].repeat(ch.codePointAt(0)); + } + return Uint8Array.from([...out].map((x) => x.codePointAt(0))); +} + +// dist/dnt/esm/deps/deno.land/std@0.196.0/console/unicode_width.js +var tables = null; +function lookupWidth(cp) { + if (!tables) + tables = data_default.tables.map(runLengthDecode); + const t1Offset = tables[0][cp >> 13 & 255]; + const t2Offset = tables[1][128 * t1Offset + (cp >> 6 & 127)]; + const packedWidths = tables[2][16 * t2Offset + (cp >> 2 & 15)]; + const width = packedWidths >> 2 * (cp & 3) & 3; + return width === 3 ? 1 : width; +} +var cache = /* @__PURE__ */ new Map(); +function charWidth(ch) { + if (cache.has(ch)) + return cache.get(ch); + const cp = ch.codePointAt(0); + let v = null; + if (cp < 127) { + v = cp >= 32 ? 1 : cp === 0 ? 0 : null; + } else if (cp >= 160) { + v = lookupWidth(cp); + } else { + v = null; + } + cache.set(ch, v); + return v; +} +function unicodeWidth(str) { + return [...str].map((ch) => charWidth(ch) ?? 0).reduce((a, b) => a + b, 0); +} + +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/table/_utils.js +function longest(index, rows, maxWidth) { + const cellLengths = rows.map((row) => { + const cell = row[index]; + const cellValue = cell instanceof Cell && cell.getColSpan() > 1 ? "" : cell?.toString() || ""; + return cellValue.split("\n").map((line) => { + const str = typeof maxWidth === "undefined" ? line : consumeWords(maxWidth, line); + return strLength(str) || 0; + }); + }).flat(); + return Math.max(...cellLengths); +} +var strLength = (str) => { + return unicodeWidth(stripColor(str)); +}; + +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/table/consume_words.js +function consumeWords(length, content) { + let consumed = ""; + const words = content.split("\n")[0]?.split(/ /g); + for (let i = 0; i < words.length; i++) { + const word = words[i]; + if (consumed) { + const nextLength = strLength(word); + const consumedLength = strLength(consumed); + if (consumedLength + nextLength >= length) { + break; + } + } + consumed += (i > 0 ? " " : "") + word; + } + return consumed; +} + +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/table/row.js var Row = class _Row extends Array { constructor() { super(...arguments); @@ -8720,6 +8942,7 @@ var Row = class _Row extends Array { /** * Create a new row. If cells is a row, all cells and options of the row will * be copied to the new row. + * * @param cells Cells or row. */ static from(cells) { @@ -8740,10 +8963,11 @@ var Row = class _Row extends Array { */ /** * Enable/disable cell border. + * * @param enable Enable/disable cell border. * @param override Override existing value. */ - border(enable, override = true) { + border(enable = true, override = true) { if (override || typeof this.options.border === "undefined") { this.options.border = enable; } @@ -8751,6 +8975,7 @@ var Row = class _Row extends Array { } /** * Align row content. + * * @param direction Align direction. * @param override Override existing value. */ @@ -8777,49 +9002,7 @@ var Row = class _Row extends Array { } }; -// dist/dnt/esm/deps/deno.land/x/cliffy@v0.25.7/table/utils.js -function consumeWords(length, content) { - let consumed = ""; - const words = content.split("\n")[0]?.split(/ /g); - for (let i = 0; i < words.length; i++) { - const word = words[i]; - if (consumed) { - const nextLength = strLength(word); - const consumedLength = strLength(consumed); - if (consumedLength + nextLength >= length) { - break; - } - } - consumed += (i > 0 ? " " : "") + word; - } - return consumed; -} -function longest(index, rows, maxWidth) { - const cellLengths = rows.map((row) => { - const cell = row[index]; - const cellValue = cell instanceof Cell && cell.getColSpan() > 1 ? "" : cell?.toString() || ""; - return cellValue.split("\n").map((line) => { - const str = typeof maxWidth === "undefined" ? line : consumeWords(maxWidth, line); - return strLength(str) || 0; - }); - }).flat(); - return Math.max(...cellLengths); -} -var strLength = (str) => { - str = stripColor(str); - let length = 0; - for (let i = 0; i < str.length; i++) { - const charCode = str.charCodeAt(i); - if (charCode >= 19968 && charCode <= 40869) { - length += 2; - } else { - length += 1; - } - } - return length; -}; - -// dist/dnt/esm/deps/deno.land/x/cliffy@v0.25.7/table/layout.js +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/table/_layout.js var __classPrivateFieldGet = function(receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); @@ -8871,23 +9054,25 @@ var TableLayout = class { const hasBorder = hasHeaderBorder || hasBodyBorder; const rows = __classPrivateFieldGet(this, _TableLayout_instances, "m", _TableLayout_getRows).call(this); const columns = Math.max(...rows.map((row) => row.length)); - for (const row of rows) { + for (let rowIndex = 0; rowIndex < rows.length; rowIndex++) { + const row = rows[rowIndex]; const length = row.length; if (length < columns) { const diff = columns - length; for (let i = 0; i < diff; i++) { - row.push(this.createCell(null, row)); + row.push(this.createCell(null, row, rowIndex, length + i)); } } } const padding = []; const width = []; for (let colIndex = 0; colIndex < columns; colIndex++) { - const minColWidth = Array.isArray(this.options.minColWidth) ? this.options.minColWidth[colIndex] : this.options.minColWidth; - const maxColWidth = Array.isArray(this.options.maxColWidth) ? this.options.maxColWidth[colIndex] : this.options.maxColWidth; + const column = this.options.columns.at(colIndex); + const minColWidth = column?.getMinWidth() ?? (Array.isArray(this.options.minColWidth) ? this.options.minColWidth[colIndex] : this.options.minColWidth); + const maxColWidth = column?.getMaxWidth() ?? (Array.isArray(this.options.maxColWidth) ? this.options.maxColWidth[colIndex] : this.options.maxColWidth); const colWidth = longest(colIndex, rows, maxColWidth); width[colIndex] = Math.min(maxColWidth, Math.max(minColWidth, colWidth)); - padding[colIndex] = Array.isArray(this.options.padding) ? this.options.padding[colIndex] : this.options.padding; + padding[colIndex] = column?.getPadding() ?? (Array.isArray(this.options.padding) ? this.options.padding[colIndex] : this.options.padding); } return { padding, @@ -8930,7 +9115,7 @@ var TableLayout = class { rows[rowIndex].splice(colIndex, this.getDeleteCount(rows, rowIndex, colIndex), rows[rowIndex - 1][colIndex]); continue; } - const cell = row[colIndex] = this.createCell(row[colIndex] || null, row); + const cell = row[colIndex] = this.createCell(row[colIndex] || null, row, rowIndex, colIndex); colSpan = cell.getColSpan(); rowSpan[colIndex] = cell.getRowSpan(); } @@ -8949,11 +9134,19 @@ var TableLayout = class { } /** * Create a new cell from existing cell or cell value. - * @param cell Original cell. - * @param row Parent row. + * + * @param cell Original cell. + * @param row Parent row. + * @param rowIndex The row index of the cell. + * @param colIndex The column index of the cell. */ - createCell(cell, row) { - return Cell.from(cell ?? "").border(row.getBorder(), false).align(row.getAlign(), false); + createCell(cell, row, rowIndex, colIndex) { + const column = this.options.columns.at(colIndex); + const isHeaderRow = this.isHeaderRow(rowIndex); + return Cell.from(cell ?? "").border((isHeaderRow ? null : column?.getBorder()) ?? row.getBorder(), false).align((isHeaderRow ? null : column?.getAlign()) ?? row.getAlign(), false); + } + isHeaderRow(rowIndex) { + return rowIndex === 0 && this.table.getHeader() !== void 0; } /** * Render table layout. @@ -9015,7 +9208,7 @@ var TableLayout = class { if (isMultilineRow) { return result + this.renderRow(rowSpan, rowIndex, opts, isMultilineRow); } - if (rowIndex === 0 && opts.hasHeaderBorder || rowIndex < opts.rows.length - 1 && opts.hasBodyBorder) { + if (opts.rows.length > 1 && (rowIndex === 0 && opts.hasHeaderBorder || rowIndex < opts.rows.length - 1 && opts.hasBodyBorder)) { result += this.renderBorderRow(row, nextRow, rowSpan, opts); } if (rowIndex === opts.rows.length - 1 && row.hasBorder()) { @@ -9060,7 +9253,7 @@ var TableLayout = class { } } const { current, next } = this.renderCellValue(cell, maxLength); - row[colIndex].setValue(next); + row[colIndex].setValue(next.getValue()); if (opts.hasBorder) { result += " ".repeat(opts.padding[colIndex]); } @@ -9269,16 +9462,16 @@ _TableLayout_instances = /* @__PURE__ */ new WeakSet(), _TableLayout_getRows = f if (hasSpan) { return this.spanRows(rows); } - return rows.map((row) => { + return rows.map((row, rowIndex) => { const newRow = this.createRow(row); - for (let i = 0; i < row.length; i++) { - newRow[i] = this.createCell(row[i], newRow); + for (let colIndex = 0; colIndex < row.length; colIndex++) { + newRow[colIndex] = this.createCell(row[colIndex], newRow, rowIndex, colIndex); } return newRow; }); }; -// dist/dnt/esm/deps/deno.land/x/cliffy@v0.25.7/table/table.js +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/table/table.js var Table = class _Table extends Array { constructor() { super(...arguments); @@ -9292,7 +9485,8 @@ var Table = class _Table extends Array { maxColWidth: Infinity, minColWidth: 0, padding: 1, - chars: { ..._Table._chars } + chars: { ..._Table._chars }, + columns: [] } }); Object.defineProperty(this, "headerRow", { @@ -9305,7 +9499,8 @@ var Table = class _Table extends Array { /** * Create a new table. If rows is a table, all rows and options of the table * will be copied to the new table. - * @param rows + * + * @param rows An array of rows or a table instance. */ static from(rows) { const table = new this(...rows); @@ -9318,6 +9513,7 @@ var Table = class _Table extends Array { /** * Create a new table from an array of json objects. An object represents a * row and each property a column. + * * @param rows Array of objects. */ static fromJson(rows) { @@ -9325,6 +9521,7 @@ var Table = class _Table extends Array { } /** * Set global default border characters. + * * @param chars Border options. */ static chars(chars) { @@ -9333,6 +9530,7 @@ var Table = class _Table extends Array { } /** * Write table or rows to stdout. + * * @param rows Table or rows. */ static render(rows) { @@ -9341,6 +9539,7 @@ var Table = class _Table extends Array { /** * Read data from an array of json objects. An object represents a * row and each property a column. + * * @param rows Array of objects. */ fromJson(rows) { @@ -9348,8 +9547,34 @@ var Table = class _Table extends Array { this.body(rows.map((row) => Object.values(row))); return this; } + /** + * Set column options. + * + * @param columns An array of columns or column options. + */ + columns(columns) { + this.options.columns = columns.map((column) => column instanceof Column ? column : Column.from(column)); + return this; + } + /** + * Set column options by index. + * + @param index The column index. + @param column Column or column options. + */ + column(index, column) { + if (column instanceof Column) { + this.options.columns[index] = column; + } else if (this.options.columns[index]) { + this.options.columns[index].options(column); + } else { + this.options.columns[index] = Column.from(column); + } + return this; + } /** * Set table header. + * * @param header Header row or cells. */ header(header) { @@ -9358,7 +9583,8 @@ var Table = class _Table extends Array { } /** * Set table body. - * @param rows Table rows. + * + * @param rows Array of rows. */ body(rows) { this.length = 0; @@ -9382,8 +9608,9 @@ var Table = class _Table extends Array { return this; } /** - * Set max col with. - * @param width Max col width. + * Set max column width. + * + * @param width Max column width. * @param override Override existing value. */ maxColWidth(width, override = true) { @@ -9393,8 +9620,9 @@ var Table = class _Table extends Array { return this; } /** - * Set min col width. - * @param width Min col width. + * Set min column width. + * + * @param width Min column width. * @param override Override existing value. */ minColWidth(width, override = true) { @@ -9405,6 +9633,7 @@ var Table = class _Table extends Array { } /** * Set table indentation. + * * @param width Indent width. * @param override Override existing value. */ @@ -9416,6 +9645,7 @@ var Table = class _Table extends Array { } /** * Set cell padding. + * * @param padding Cell padding. * @param override Override existing value. */ @@ -9427,10 +9657,11 @@ var Table = class _Table extends Array { } /** * Enable/disable cell border. + * * @param enable Enable/disable cell border. * @param override Override existing value. */ - border(enable, override = true) { + border(enable = true, override = true) { if (override || typeof this.options.border === "undefined") { this.options.border = enable; } @@ -9438,6 +9669,7 @@ var Table = class _Table extends Array { } /** * Align table content. + * * @param direction Align direction. * @param override Override existing value. */ @@ -9449,6 +9681,7 @@ var Table = class _Table extends Array { } /** * Set border characters. + * * @param chars Border options. */ chars(chars) { @@ -9463,11 +9696,11 @@ var Table = class _Table extends Array { getBody() { return [...this]; } - /** Get mac col widrth. */ + /** Get max column width. */ getMaxColWidth() { return this.options.maxColWidth; } - /** Get min col width. */ + /** Get min column width. */ getMinColWidth() { return this.options.minColWidth; } @@ -9490,7 +9723,7 @@ var Table = class _Table extends Array { } /** Check if table bordy has border. */ hasBodyBorder() { - return this.getBorder() || this.some((row) => row instanceof Row ? row.hasBorder() : row.some((cell) => cell instanceof Cell ? cell.getBorder : false)); + return this.getBorder() || this.options.columns.some((column) => column.getBorder()) || this.some((row) => row instanceof Row ? row.hasBorder() : row.some((cell) => cell instanceof Cell ? cell.getBorder() : false)); } /** Check if table header or body has border. */ hasBorder() { @@ -9500,6 +9733,14 @@ var Table = class _Table extends Array { getAlign() { return this.options.align ?? "left"; } + /** Get columns. */ + getColumns() { + return this.options.columns; + } + /** Get column by column index. */ + getColumn(index) { + return this.options.columns[index] ??= new Column(); + } }; Object.defineProperty(Table, "_chars", { enumerable: true, @@ -9508,7 +9749,7 @@ Object.defineProperty(Table, "_chars", { value: { ...border } }); -// dist/dnt/esm/deps/deno.land/x/cliffy@v0.25.7/command/help/_help_generator.js +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/command/help/_help_generator.js var HelpGenerator = class _HelpGenerator { /** Generate help text for given command. */ static generate(cmd, options) { @@ -9560,7 +9801,7 @@ var HelpGenerator = class _HelpGenerator { if (version2) { rows.push([bold("Version:"), yellow(`${this.cmd.getVersion()}`)]); } - return "\n" + Table.from(rows).indent(this.indent).padding(1).toString() + "\n"; + return "\n" + Table.from(rows).padding(1).toString() + "\n"; } generateMeta() { const meta = Object.entries(this.cmd.getMeta()); @@ -9571,7 +9812,7 @@ var HelpGenerator = class _HelpGenerator { for (const [name, value] of meta) { rows.push([bold(`${name}: `) + value]); } - return "\n" + Table.from(rows).indent(this.indent).padding(1).toString() + "\n"; + return "\n" + Table.from(rows).padding(1).toString() + "\n"; } generateDescription() { if (!this.cmd.getDescription()) { @@ -9579,7 +9820,7 @@ var HelpGenerator = class _HelpGenerator { } return this.label("Description") + Table.from([ [dedent(this.cmd.getDescription())] - ]).indent(this.indent * 2).maxColWidth(140).padding(1).toString() + "\n"; + ]).indent(this.indent).maxColWidth(140).padding(1).toString() + "\n"; } generateOptions() { const options = this.cmd.getOptions(false); @@ -9626,7 +9867,7 @@ var HelpGenerator = class _HelpGenerator { getDescription(option.description, !this.options.long), this.generateHints(option) ]) - ]).padding([2, 2, 1, 2]).indent(this.indent * 2).maxColWidth([60, 60, 1, 80, 60]).toString() + "\n"; + ]).padding([2, 2, 1, 2]).indent(this.indent).maxColWidth([60, 60, 1, 80, 60]).toString() + "\n"; } return this.label(group.name ?? "Options") + Table.from([ ...group.options.map((option) => [ @@ -9635,7 +9876,7 @@ var HelpGenerator = class _HelpGenerator { getDescription(option.description, !this.options.long), this.generateHints(option) ]) - ]).indent(this.indent * 2).maxColWidth([60, 1, 80, 60]).padding([2, 1, 2]).toString() + "\n"; + ]).indent(this.indent).maxColWidth([60, 1, 80, 60]).padding([2, 1, 2]).toString() + "\n"; } generateCommands() { const commands = this.cmd.getCommands(false); @@ -9651,7 +9892,7 @@ var HelpGenerator = class _HelpGenerator { red(bold("-")), command.getShortDescription() ]) - ]).indent(this.indent * 2).maxColWidth([60, 60, 1, 80]).padding([2, 2, 1, 2]).toString() + "\n"; + ]).indent(this.indent).maxColWidth([60, 60, 1, 80]).padding([2, 2, 1, 2]).toString() + "\n"; } return this.label("Commands") + Table.from([ ...commands.map((command) => [ @@ -9659,7 +9900,7 @@ var HelpGenerator = class _HelpGenerator { red(bold("-")), command.getShortDescription() ]) - ]).maxColWidth([60, 1, 80]).padding([2, 1, 2]).indent(this.indent * 2).toString() + "\n"; + ]).maxColWidth([60, 1, 80]).padding([2, 1, 2]).indent(this.indent).toString() + "\n"; } generateEnvironmentVariables() { const envVars = this.cmd.getEnvVars(false); @@ -9674,7 +9915,7 @@ var HelpGenerator = class _HelpGenerator { this.options.long ? dedent(envVar.description) : envVar.description.trim().split("\n", 1)[0], envVar.required ? `(${yellow(`required`)})` : "" ]) - ]).padding([2, 2, 1, 2]).indent(this.indent * 2).maxColWidth([60, 60, 1, 80, 10]).toString() + "\n"; + ]).padding([2, 2, 1, 2]).indent(this.indent).maxColWidth([60, 60, 1, 80, 10]).toString() + "\n"; } generateExamples() { const examples = this.cmd.getExamples(); @@ -9684,7 +9925,7 @@ var HelpGenerator = class _HelpGenerator { return this.label("Examples") + Table.from(examples.map((example) => [ dim(bold(`${capitalize(example.name)}:`)), dedent(example.description) - ])).padding(1).indent(this.indent * 2).maxColWidth(150).toString() + "\n"; + ])).padding(1).indent(this.indent).maxColWidth(150).toString() + "\n"; } generateHints(option) { if (!this.options.hints) { @@ -9692,7 +9933,12 @@ var HelpGenerator = class _HelpGenerator { } const hints = []; option.required && hints.push(yellow(`required`)); - typeof option.default !== "undefined" && hints.push(bold(`Default: `) + inspect(option.default, this.options.colors)); + if (typeof option.default !== "undefined") { + const defaultValue = getDefaultValue(option); + if (typeof defaultValue !== "undefined") { + hints.push(bold(`Default: `) + inspect(defaultValue, this.options.colors)); + } + } option.depends?.length && hints.push(yellow(bold(`Depends: `)) + italic(option.depends.map(getFlag).join(", "))); option.conflicts?.length && hints.push(red(bold(`Conflicts: `)) + italic(option.conflicts.map(getFlag).join(", "))); const type = this.cmd.getType(option.args[0]?.type)?.handler; @@ -9708,7 +9954,7 @@ var HelpGenerator = class _HelpGenerator { return ""; } label(label) { - return "\n" + " ".repeat(this.indent) + bold(`${label}:`) + "\n\n"; + return "\n" + bold(`${label}:`) + "\n\n"; } }; function capitalize(string2) { @@ -9729,7 +9975,7 @@ function highlightArguments(argsDefinition, types = true) { } function highlightArgumentDetails(arg, types = true) { let str = ""; - str += yellow(arg.optionalValue ? "[" : "<"); + str += yellow(arg.optional ? "[" : "<"); let name = ""; name += arg.name; if (arg.variadic) { @@ -9744,19 +9990,30 @@ function highlightArgumentDetails(arg, types = true) { str += green("[]"); } } - str += yellow(arg.optionalValue ? "]" : ">"); + str += yellow(arg.optional ? "]" : ">"); return str; } -// dist/dnt/esm/deps/deno.land/x/cliffy@v0.25.7/command/types/integer.js -var IntegerType = class extends Type { - /** Parse integer type. */ - parse(type) { - return integer(type); +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/command/upgrade/_check_version.js +async function checkVersion(cmd) { + const mainCommand = cmd.getMainCommand(); + const upgradeCommand = mainCommand.getCommand("upgrade"); + if (!isUpgradeCommand(upgradeCommand)) { + return; } -}; + const latestVersion = await upgradeCommand.getLatestVersion(); + const currentVersion = mainCommand.getVersion(); + if (currentVersion === latestVersion) { + return; + } + const versionHelpText = `(New version available: ${latestVersion}. Run '${mainCommand.getName()} upgrade' to upgrade to the latest version!)`; + mainCommand.version(`${currentVersion} ${bold(yellow(versionHelpText))}`); +} +function isUpgradeCommand(command) { + return command instanceof Command && "getLatestVersion" in command; +} -// dist/dnt/esm/deps/deno.land/x/cliffy@v0.25.7/command/command.js +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/command/command.js var Command = class _Command { constructor() { Object.defineProperty(this, "types", { @@ -9813,7 +10070,13 @@ var Command = class _Command { writable: true, value: void 0 }); - Object.defineProperty(this, "fn", { + Object.defineProperty(this, "actionHandler", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "globalActionHandler", { enumerable: true, configurable: true, writable: true, @@ -9973,7 +10236,7 @@ var Command = class _Command { enumerable: true, configurable: true, writable: true, - value: void 0 + value: null }); Object.defineProperty(this, "_noGlobals", { enumerable: true, @@ -10049,6 +10312,7 @@ var Command = class _Command { } /** * Add new command alias. + * * @param alias Tha name of the alias. */ alias(alias) { @@ -10060,7 +10324,7 @@ var Command = class _Command { } /** Reset internal command reference to main command. */ reset() { - this._groupName = void 0; + this._groupName = null; this.cmd = this; return this; } @@ -10079,13 +10343,14 @@ var Command = class _Command { /***************************************************************************** **** SUB HANDLER ************************************************************ *****************************************************************************/ - /** Set command name. */ + /** Set command name. Used in auto generated help and shell completions */ name(name) { this.cmd._name = name; return this; } /** * Set command version. + * * @param version Semantic version string string or method that returns the version string. */ version(version2) { @@ -10096,6 +10361,13 @@ var Command = class _Command { } return this; } + /** + * Add meta data. Will be displayed in the auto generated help and in the + * output of the long version. + * + * @param name The name/label of the metadata. + * @param value The value of the metadata. + */ meta(name, value) { this.cmd._meta[name] = value; return this; @@ -10105,6 +10377,7 @@ var Command = class _Command { } /** * Set command help. + * * @param help Help string, method, or config for generator that returns the help string. */ help(help) { @@ -10119,6 +10392,7 @@ var Command = class _Command { } /** * Set the long command description. + * * @param description The command description. */ description(description) { @@ -10127,15 +10401,14 @@ var Command = class _Command { } /** * Set the command usage. Defaults to arguments. + * * @param usage The command usage. */ usage(usage) { this.cmd._usage = usage; return this; } - /** - * Hide command from help, completions, etc. - */ + /** Hide command from help, completions, etc. */ hidden() { this.cmd.isHidden = true; return this; @@ -10161,32 +10434,27 @@ var Command = class _Command { } /** * Set command callback method. + * * @param fn Command action handler. */ action(fn) { - this.cmd.fn = fn; + this.cmd.actionHandler = fn; + return this; + } + /** + * Set command callback method. + * + * @param fn Command action handler. + */ + globalAction(fn) { + this.cmd.globalActionHandler = fn; return this; } /** * Don't throw an error if the command was called without arguments. + * * @param allowEmpty Enable/disable allow empty. */ - // public allowEmpty( - // allowEmpty?: TAllowEmpty, - // ): false extends TAllowEmpty ? this - // : Command< - // Partial, - // TParentCommandTypes, - // Partial, - // TCommandArguments, - // TCommandGlobals, - // TCommandTypes, - // TCommandGlobalTypes, - // TParentCommand - // > { - // this.cmd._allowEmpty = allowEmpty !== false; - // return this; - // } allowEmpty(allowEmpty) { this.cmd._allowEmpty = allowEmpty !== false; return this; @@ -10200,7 +10468,7 @@ var Command = class _Command { * `command --debug-level warning server --port 80` * * Will result in: - * - options: `{debugLevel: 'warning'}` + * - options: `{ debugLevel: 'warning' }` * - args: `['server', '--port', '80']` * * @param stopEarly Enable/disable stop early. @@ -10213,6 +10481,7 @@ var Command = class _Command { * Disable parsing arguments. If enabled the raw arguments will be passed to * the action handler. This has no effect for parent or child commands. Only * for the command on which this method was called. + * * @param useRawArgs Enable/disable raw arguments. */ useRawArgs(useRawArgs = true) { @@ -10222,6 +10491,7 @@ var Command = class _Command { /** * Set default command. The default command is executed when the program * was called without any argument and if no action handler is registered. + * * @param name Name of the default command. */ default(name) { @@ -10233,6 +10503,7 @@ var Command = class _Command { } /** * Register custom type. + * * @param name The name of the type. * @param handler The callback method to parse the type. * @param options Type options. @@ -10252,6 +10523,13 @@ var Command = class _Command { } return this; } + /** + * Register global complete handler. + * + * @param name The name of the completion. + * @param complete The callback method to complete the type. + * @param options Complete options. + */ globalComplete(name, complete, options) { return this.complete(name, complete, { ...options, global: true }); } @@ -10279,7 +10557,12 @@ var Command = class _Command { * * **Example:** * - * ``` + * ```ts + * import { Command, ValidationError } from "./mod.ts"; + * + * const cmd = new Command(); + * // ... + * * try { * cmd.parse(); * } catch(error) { @@ -10297,10 +10580,16 @@ var Command = class _Command { this.cmd.throwOnError = true; return this; } + /** + * Set custom error handler. + * + * @param handler Error handler callback function. + */ error(handler) { this.cmd.errorHandler = handler; return this; } + /** Get error handler callback function. */ getErrorHandler() { return this.errorHandler ?? this._parent?.errorHandler; } @@ -10329,12 +10618,6 @@ var Command = class _Command { shouldExit() { return this._shouldExit ?? this._parent?.shouldExit() ?? true; } - globalOption(flags, desc, opts) { - if (typeof opts === "function") { - return this.option(flags, desc, { value: opts, global: true }); - } - return this.option(flags, desc, { ...opts, global: true }); - } /** * Enable grouping of options and set the name of the group. * All option which are added after calling the `.group()` method will be @@ -10347,9 +10630,22 @@ var Command = class _Command { this.cmd._groupName = name; return this; } + /** + * Register a global option. + * + * @param flags Flags string e.g: -h, --help, --manual [optionalArg:number] [...restArgs:string] + * @param desc Flag description. + * @param opts Flag options or custom handler for processing flag value. + */ + globalOption(flags, desc, opts) { + if (typeof opts === "function") { + return this.option(flags, desc, { value: opts, global: true }); + } + return this.option(flags, desc, { ...opts, global: true }); + } option(flags, desc, opts) { if (typeof opts === "function") { - return this.option(flags, desc, { value: opts }); + opts = { value: opts }; } const result = splitArguments(flags); const args = result.typeDefinition ? parseArgumentsDefinition(result.typeDefinition) : []; @@ -10361,7 +10657,7 @@ var Command = class _Command { flags: result.flags, equalsSign: result.equalsSign, typeDefinition: result.typeDefinition, - groupName: this._groupName + groupName: this._groupName ?? void 0 }; if (option.separator) { for (const arg of args) { @@ -10378,7 +10674,7 @@ var Command = class _Command { if (opts?.override) { this.removeOption(name); } else { - throw new DuplicateOptionNameError(name); + throw new DuplicateOptionNameError(name, this.getPath()); } } if (!option.name && isLong) { @@ -10397,7 +10693,8 @@ var Command = class _Command { return this; } /** - * Add new command example. + * Register command example. + * * @param name Name of the example. * @param description The content of the example. */ @@ -10408,6 +10705,18 @@ var Command = class _Command { this.cmd.examples.push({ name, description }); return this; } + /** + * @param flags Flags string e.g: -h, --help, --manual [optionalArg:number] [...restArgs:string] + * @param desc Flag description. + * @param opts Flag options or custom handler for processing flag value. + */ + /** + * Register a global environment variable. + * + * @param name Name of the environment variable. + * @param description The description of the environment variable. + * @param options Environment variable options. + */ globalEnv(name, description, options) { return this.env(name, description, { ...options, global: true }); } @@ -10422,7 +10731,7 @@ var Command = class _Command { const details = parseArgumentsDefinition(result.typeDefinition); if (details.length > 1) { throw new TooManyEnvVarValuesError(name); - } else if (details.length && details[0].optionalValue) { + } else if (details.length && details[0].optional) { throw new UnexpectedOptionalEnvVarValueError(name); } else if (details.length && details[0].variadic) { throw new UnexpectedVariadicEnvVarValueError(name); @@ -10442,6 +10751,7 @@ var Command = class _Command { *****************************************************************************/ /** * Parse command line arguments and execute matched command. + * * @param args Command line args to parse. Ex: `cmd.parse( Deno.args )` */ parse(args = import_shim_deno2.Deno.args) { @@ -10451,7 +10761,9 @@ var Command = class _Command { env: {}, literal: [], stopEarly: false, - stopOnUnknown: false + stopOnUnknown: false, + defaults: {}, + actions: [] }; return this.parseCommand(ctx); } @@ -10465,7 +10777,7 @@ var Command = class _Command { return { options: {}, args: [], cmd: this, literal: [] }; } else if (this._useRawArgs) { await this.parseEnvVars(ctx, this.envVars); - return this.execute(ctx.env, ...ctx.unknown); + return await this.execute(ctx.env, ctx.unknown); } let preParseGlobals = false; let subCommand; @@ -10491,18 +10803,18 @@ var Command = class _Command { const options = { ...ctx.env, ...ctx.flags }; const args = this.parseArguments(ctx, options); this.literalArgs = ctx.literal; - if (ctx.action) { - await ctx.action.action.call(this, options, ...args); - if (ctx.action.standalone) { - return { - options, - args, - cmd: this, - literal: this.literalArgs - }; - } + if (ctx.actions.length) { + await Promise.all(ctx.actions.map((action) => action.call(this, options, ...args))); + } + if (ctx.standalone) { + return { + options, + args, + cmd: this, + literal: this.literalArgs + }; } - return await this.execute(options, ...args); + return await this.execute(options, args); } catch (error) { this.handleError(error); } @@ -10553,10 +10865,7 @@ var Command = class _Command { !this.types.has("boolean") && this.type("boolean", new BooleanType(), { global: true }); !this.types.has("file") && this.type("file", new FileType(), { global: true }); if (!this._help) { - this.help({ - hints: true, - types: false - }); + this.help({}); } if (this._versionOptions !== false && (this._versionOptions || this.ver)) { this.option(this._versionOptions?.flags || "-V, --version", this._versionOptions?.desc || "Show the version number for this program.", { @@ -10565,7 +10874,7 @@ var Command = class _Command { action: async function() { const long = this.getRawArgs().includes(`--${this._versionOption?.name}`); if (long) { - await this.checkVersion(); + await checkVersion(this); this.showLongVersion(); } else { this.showVersion(); @@ -10583,7 +10892,7 @@ var Command = class _Command { prepend: true, action: async function() { const long = this.getRawArgs().includes(`--${this.getHelpOption()?.name}`); - await this.checkVersion(); + await checkVersion(this); this.showHelp({ long }); this.exit(); }, @@ -10598,16 +10907,18 @@ var Command = class _Command { * @param options A map of options. * @param args Command arguments. */ - async execute(options, ...args) { - if (this.fn) { - await this.fn(options, ...args); - } else if (this.defaultCommand) { + async execute(options, args) { + if (this.defaultCommand) { const cmd = this.getCommand(this.defaultCommand, true); if (!cmd) { throw new DefaultCommandNotFoundError(this.defaultCommand, this.getCommands()); } cmd._globalParent = this; - return cmd.execute(options, ...args); + return cmd.execute(options, args); + } + await this.executeGlobalAction(options, args); + if (this.actionHandler) { + await this.actionHandler(options, ...args); } return { options, @@ -10616,6 +10927,12 @@ var Command = class _Command { literal: this.literalArgs }; } + async executeGlobalAction(options, args) { + if (!this._noGlobals) { + await this._parent?.executeGlobalAction(options, args); + } + await this.globalActionHandler?.(options, ...args); + } /** * Execute external sub-command. * @param args Raw command line arguments. @@ -10624,12 +10941,12 @@ var Command = class _Command { const command = this.getPath().replace(/\s+/g, "-"); await import_shim_deno2.Deno.permissions.request({ name: "run", command }); try { - const process2 = import_shim_deno2.Deno.run({ - cmd: [command, ...args] + const cmd = new import_shim_deno2.Deno.Command(command, { + args }); - const status = await process2.status(); - if (!status.success) { - import_shim_deno2.Deno.exit(status.code); + const output = await cmd.output(); + if (!output.success) { + import_shim_deno2.Deno.exit(output.code); } } catch (error) { if (error instanceof import_shim_deno2.Deno.errors.NotFound) { @@ -10649,8 +10966,8 @@ var Command = class _Command { ignoreDefaults: ctx.env, parse: (type) => this.parseType(type), option: (option) => { - if (!ctx.action && option.action) { - ctx.action = option; + if (option.action) { + ctx.actions.push(option.action); } } }); @@ -10732,7 +11049,7 @@ var Command = class _Command { } } else { if (!args.length) { - const required = this.getArguments().filter((expectedArg) => !expectedArg.optionalValue).map((expectedArg) => expectedArg.name); + const required = this.getArguments().filter((expectedArg) => !expectedArg.optional).map((expectedArg) => expectedArg.name); if (required.length) { const optionNames = Object.keys(options); const hasStandaloneOption = !!optionNames.find((name) => this.getOption(name, true)?.standalone); @@ -10743,7 +11060,7 @@ var Command = class _Command { } else { for (const expectedArg of this.getArguments()) { if (!args.length) { - if (expectedArg.optionalValue) { + if (expectedArg.optional) { break; } throw new MissingArgumentError(expectedArg.name); @@ -10828,9 +11145,13 @@ var Command = class _Command { getAliases() { return this.aliases; } - /** Get full command path. */ - getPath() { - return this._parent ? this._parent.getPath() + " " + this._name : this._name; + /** + * Get full command path. + * + * @param name Override the main command name. + */ + getPath(name) { + return this._parent ? this._parent.getPath(name) + " " + this._name : name || this._name; } /** Get arguments definition. E.g: */ getArgsDefinition() { @@ -10838,6 +11159,7 @@ var Command = class _Command { } /** * Get argument by name. + * * @param name Name of the argument. */ getArgument(name) { @@ -10866,8 +11188,12 @@ var Command = class _Command { getDescription() { return typeof this.desc === "function" ? this.desc = this.desc() : this.desc; } + /** Get auto generated command usage. */ getUsage() { - return this._usage ?? this.getArgsDefinition(); + return this._usage ?? [this.getArgsDefinition(), this.getRequiredOptionsDefinition()].join(" ").trim(); + } + getRequiredOptionsDefinition() { + return this.getOptions().filter((option) => option.required).map((option) => [findFlag(option.flags), option.typeDefinition].filter((v) => v).join(" ").trim()).join(" "); } /** Get short command description. This is the first line of the description. */ getShortDescription() { @@ -10912,26 +11238,12 @@ ${bold(k)} ${brightBlue(v)}`).join(""); import_shim_deno2.Deno.exit(code2); } } - /** Check if new version is available and add hint to version. */ - async checkVersion() { - const mainCommand = this.getMainCommand(); - const upgradeCommand = mainCommand.getCommand("upgrade"); - if (!isUpgradeCommand(upgradeCommand)) { - return; - } - const latestVersion = await upgradeCommand.getLatestVersion(); - const currentVersion = mainCommand.getVersion(); - if (currentVersion === latestVersion) { - return; - } - const versionHelpText = `(New version available: ${latestVersion}. Run '${mainCommand.getName()} upgrade' to upgrade to the latest version!)`; - mainCommand.version(`${currentVersion} ${bold(yellow(versionHelpText))}`); - } /***************************************************************************** **** Options GETTER ********************************************************* *****************************************************************************/ /** * Checks whether the command has options or not. + * * @param hidden Include hidden options. */ hasOptions(hidden2) { @@ -10939,6 +11251,7 @@ ${bold(k)} ${brightBlue(v)}`).join(""); } /** * Get options. + * * @param hidden Include hidden options. */ getOptions(hidden2) { @@ -10946,6 +11259,7 @@ ${bold(k)} ${brightBlue(v)}`).join(""); } /** * Get base options. + * * @param hidden Include hidden options. */ getBaseOptions(hidden2) { @@ -10956,6 +11270,7 @@ ${bold(k)} ${brightBlue(v)}`).join(""); } /** * Get global options. + * * @param hidden Include hidden options. */ getGlobalOptions(hidden2) { @@ -10978,6 +11293,7 @@ ${bold(k)} ${brightBlue(v)}`).join(""); } /** * Checks whether the command has an option with given name or not. + * * @param name Name of the option. Must be in param-case. * @param hidden Include hidden options. */ @@ -10986,6 +11302,7 @@ ${bold(k)} ${brightBlue(v)}`).join(""); } /** * Get option by name. + * * @param name Name of the option. Must be in param-case. * @param hidden Include hidden options. */ @@ -10994,6 +11311,7 @@ ${bold(k)} ${brightBlue(v)}`).join(""); } /** * Get base option by name. + * * @param name Name of the option. Must be in param-case. * @param hidden Include hidden options. */ @@ -11003,6 +11321,7 @@ ${bold(k)} ${brightBlue(v)}`).join(""); } /** * Get global option from parent commands by name. + * * @param name Name of the option. Must be in param-case. * @param hidden Include hidden options. */ @@ -11022,6 +11341,7 @@ ${bold(k)} ${brightBlue(v)}`).join(""); } /** * Remove option by name. + * * @param name Name of the option. Must be in param-case. */ removeOption(name) { @@ -11033,6 +11353,7 @@ ${bold(k)} ${brightBlue(v)}`).join(""); } /** * Checks whether the command has sub-commands or not. + * * @param hidden Include hidden commands. */ hasCommands(hidden2) { @@ -11040,6 +11361,7 @@ ${bold(k)} ${brightBlue(v)}`).join(""); } /** * Get commands. + * * @param hidden Include hidden commands. */ getCommands(hidden2) { @@ -11047,6 +11369,7 @@ ${bold(k)} ${brightBlue(v)}`).join(""); } /** * Get base commands. + * * @param hidden Include hidden commands. */ getBaseCommands(hidden2) { @@ -11055,6 +11378,7 @@ ${bold(k)} ${brightBlue(v)}`).join(""); } /** * Get global commands. + * * @param hidden Include hidden commands. */ getGlobalCommands(hidden2) { @@ -11076,6 +11400,7 @@ ${bold(k)} ${brightBlue(v)}`).join(""); } /** * Checks whether a child command exists by given name or alias. + * * @param name Name or alias of the command. * @param hidden Include hidden commands. */ @@ -11084,6 +11409,7 @@ ${bold(k)} ${brightBlue(v)}`).join(""); } /** * Get command by name or alias. + * * @param name Name or alias of the command. * @param hidden Include hidden commands. */ @@ -11092,6 +11418,7 @@ ${bold(k)} ${brightBlue(v)}`).join(""); } /** * Get base command by name or alias. + * * @param name Name or alias of the command. * @param hidden Include hidden commands. */ @@ -11104,6 +11431,7 @@ ${bold(k)} ${brightBlue(v)}`).join(""); } /** * Get global command by name or alias. + * * @param name Name or alias of the command. * @param hidden Include hidden commands. */ @@ -11122,6 +11450,7 @@ ${bold(k)} ${brightBlue(v)}`).join(""); } /** * Remove sub-command by name or alias. + * * @param name Name or alias of the command. */ removeCommand(name) { @@ -11159,6 +11488,7 @@ ${bold(k)} ${brightBlue(v)}`).join(""); } /** * Get type by name. + * * @param name Name of the type. */ getType(name) { @@ -11166,6 +11496,7 @@ ${bold(k)} ${brightBlue(v)}`).join(""); } /** * Get base type by name. + * * @param name Name of the type. */ getBaseType(name) { @@ -11173,6 +11504,7 @@ ${bold(k)} ${brightBlue(v)}`).join(""); } /** * Get global type by name. + * * @param name Name of the type. */ getGlobalType(name) { @@ -11213,6 +11545,7 @@ ${bold(k)} ${brightBlue(v)}`).join(""); } /** * Get completion by name. + * * @param name Name of the completion. */ getCompletion(name) { @@ -11220,6 +11553,7 @@ ${bold(k)} ${brightBlue(v)}`).join(""); } /** * Get base completion by name. + * * @param name Name of the completion. */ getBaseCompletion(name) { @@ -11227,6 +11561,7 @@ ${bold(k)} ${brightBlue(v)}`).join(""); } /** * Get global completions by name. + * * @param name Name of the completion. */ getGlobalCompletion(name) { @@ -11241,6 +11576,7 @@ ${bold(k)} ${brightBlue(v)}`).join(""); } /** * Checks whether the command has environment variables or not. + * * @param hidden Include hidden environment variable. */ hasEnvVars(hidden2) { @@ -11248,6 +11584,7 @@ ${bold(k)} ${brightBlue(v)}`).join(""); } /** * Get environment variables. + * * @param hidden Include hidden environment variable. */ getEnvVars(hidden2) { @@ -11255,6 +11592,7 @@ ${bold(k)} ${brightBlue(v)}`).join(""); } /** * Get base environment variables. + * * @param hidden Include hidden environment variable. */ getBaseEnvVars(hidden2) { @@ -11265,6 +11603,7 @@ ${bold(k)} ${brightBlue(v)}`).join(""); } /** * Get global environment variables. + * * @param hidden Include hidden environment variable. */ getGlobalEnvVars(hidden2) { @@ -11289,6 +11628,7 @@ ${bold(k)} ${brightBlue(v)}`).join(""); } /** * Checks whether the command has an environment variable with given name or not. + * * @param name Name of the environment variable. * @param hidden Include hidden environment variable. */ @@ -11297,6 +11637,7 @@ ${bold(k)} ${brightBlue(v)}`).join(""); } /** * Get environment variable by name. + * * @param name Name of the environment variable. * @param hidden Include hidden environment variable. */ @@ -11305,6 +11646,7 @@ ${bold(k)} ${brightBlue(v)}`).join(""); } /** * Get base environment variable by name. + * * @param name Name of the environment variable. * @param hidden Include hidden environment variable. */ @@ -11314,6 +11656,7 @@ ${bold(k)} ${brightBlue(v)}`).join(""); } /** * Get global environment variable by name. + * * @param name Name of the environment variable. * @param hidden Include hidden environment variable. */ @@ -11347,27 +11690,20 @@ ${bold(k)} ${brightBlue(v)}`).join(""); return this._helpOption ?? this._parent?.getHelpOption(); } }; -function isUpgradeCommand(command) { - return command instanceof Command && "getLatestVersion" in command; +function findFlag(flags) { + for (const flag of flags) { + if (flag.startsWith("--")) { + return flag; + } + } + return flags[0]; } -// dist/dnt/esm/deps/deno.land/x/cliffy@v0.25.7/command/completions/bash.js -var _BashCompletionsCommand_cmd; -_BashCompletionsCommand_cmd = /* @__PURE__ */ new WeakMap(); - -// dist/dnt/esm/deps/deno.land/x/cliffy@v0.25.7/command/completions/fish.js -var _FishCompletionsCommand_cmd; -_FishCompletionsCommand_cmd = /* @__PURE__ */ new WeakMap(); - -// dist/dnt/esm/deps/deno.land/x/cliffy@v0.25.7/command/completions/zsh.js -var _ZshCompletionsCommand_cmd; -_ZshCompletionsCommand_cmd = /* @__PURE__ */ new WeakMap(); - -// dist/dnt/esm/deps/deno.land/x/cliffy@v0.25.7/command/completions/mod.js -var _CompletionsCommand_cmd; -_CompletionsCommand_cmd = /* @__PURE__ */ new WeakMap(); +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/command/types/child_command.js +var _ChildCommandType_cmd; +_ChildCommandType_cmd = /* @__PURE__ */ new WeakMap(); -// dist/dnt/esm/deps/deno.land/x/cliffy@v0.25.7/command/types/enum.js +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/command/types/enum.js var EnumType = class extends Type { constructor(values) { super(); @@ -11395,9 +11731,21 @@ var EnumType = class extends Type { } }; -// dist/dnt/esm/deps/deno.land/x/cliffy@v0.25.7/command/types/child_command.js -var _ChildCommandType_cmd; -_ChildCommandType_cmd = /* @__PURE__ */ new WeakMap(); +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/command/completions/bash.js +var _BashCompletionsCommand_cmd; +_BashCompletionsCommand_cmd = /* @__PURE__ */ new WeakMap(); + +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/command/completions/fish.js +var _FishCompletionsCommand_cmd; +_FishCompletionsCommand_cmd = /* @__PURE__ */ new WeakMap(); + +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/command/completions/zsh.js +var _ZshCompletionsCommand_cmd; +_ZshCompletionsCommand_cmd = /* @__PURE__ */ new WeakMap(); + +// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/command/completions/completions_command.js +var _CompletionsCommand_cmd; +_CompletionsCommand_cmd = /* @__PURE__ */ new WeakMap(); // dist/dnt/esm/gh-wrapper/exec.js async function exec2(args) {