The cross-platform version manager toolset crates.io/crates/hyper-jump
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: add initial project structure and dependencies

- add a `.gitignore` file with `/target` as its content
- add a `cargo.toml` file with various dependencies and configurations
- add a `readme.md` file with project information and installation instructions
- add new `mod.rs` files with parsing and command handling functions
- add a `dirs.rs` file with directory handling functions
- add a `main.rs` file with cli parsing and command execution logic

+1292
+1
.gitignore
··· 1 + /target
+1012
Cargo.lock
··· 1 + # This file is automatically @generated by Cargo. 2 + # It is not intended for manual editing. 3 + version = 3 4 + 5 + [[package]] 6 + name = "addr2line" 7 + version = "0.22.0" 8 + source = "registry+https://github.com/rust-lang/crates.io-index" 9 + checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" 10 + dependencies = [ 11 + "gimli", 12 + ] 13 + 14 + [[package]] 15 + name = "adler" 16 + version = "1.0.2" 17 + source = "registry+https://github.com/rust-lang/crates.io-index" 18 + checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" 19 + 20 + [[package]] 21 + name = "anstream" 22 + version = "0.6.14" 23 + source = "registry+https://github.com/rust-lang/crates.io-index" 24 + checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" 25 + dependencies = [ 26 + "anstyle", 27 + "anstyle-parse", 28 + "anstyle-query", 29 + "anstyle-wincon", 30 + "colorchoice", 31 + "is_terminal_polyfill", 32 + "utf8parse", 33 + ] 34 + 35 + [[package]] 36 + name = "anstyle" 37 + version = "1.0.7" 38 + source = "registry+https://github.com/rust-lang/crates.io-index" 39 + checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" 40 + 41 + [[package]] 42 + name = "anstyle-parse" 43 + version = "0.2.4" 44 + source = "registry+https://github.com/rust-lang/crates.io-index" 45 + checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" 46 + dependencies = [ 47 + "utf8parse", 48 + ] 49 + 50 + [[package]] 51 + name = "anstyle-query" 52 + version = "1.0.3" 53 + source = "registry+https://github.com/rust-lang/crates.io-index" 54 + checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" 55 + dependencies = [ 56 + "windows-sys 0.52.0", 57 + ] 58 + 59 + [[package]] 60 + name = "anstyle-wincon" 61 + version = "3.0.3" 62 + source = "registry+https://github.com/rust-lang/crates.io-index" 63 + checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" 64 + dependencies = [ 65 + "anstyle", 66 + "windows-sys 0.52.0", 67 + ] 68 + 69 + [[package]] 70 + name = "arrayvec" 71 + version = "0.7.4" 72 + source = "registry+https://github.com/rust-lang/crates.io-index" 73 + checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" 74 + 75 + [[package]] 76 + name = "autocfg" 77 + version = "1.3.0" 78 + source = "registry+https://github.com/rust-lang/crates.io-index" 79 + checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" 80 + 81 + [[package]] 82 + name = "backtrace" 83 + version = "0.3.72" 84 + source = "registry+https://github.com/rust-lang/crates.io-index" 85 + checksum = "17c6a35df3749d2e8bb1b7b21a976d82b15548788d2735b9d82f329268f71a11" 86 + dependencies = [ 87 + "addr2line", 88 + "cc", 89 + "cfg-if", 90 + "libc", 91 + "miniz_oxide", 92 + "object", 93 + "rustc-demangle", 94 + ] 95 + 96 + [[package]] 97 + name = "backtrace-ext" 98 + version = "0.2.1" 99 + source = "registry+https://github.com/rust-lang/crates.io-index" 100 + checksum = "537beee3be4a18fb023b570f80e3ae28003db9167a751266b259926e25539d50" 101 + dependencies = [ 102 + "backtrace", 103 + ] 104 + 105 + [[package]] 106 + name = "bitflags" 107 + version = "2.5.0" 108 + source = "registry+https://github.com/rust-lang/crates.io-index" 109 + checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" 110 + 111 + [[package]] 112 + name = "bytes" 113 + version = "1.6.0" 114 + source = "registry+https://github.com/rust-lang/crates.io-index" 115 + checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" 116 + 117 + [[package]] 118 + name = "cc" 119 + version = "1.0.98" 120 + source = "registry+https://github.com/rust-lang/crates.io-index" 121 + checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" 122 + 123 + [[package]] 124 + name = "cfg-if" 125 + version = "1.0.0" 126 + source = "registry+https://github.com/rust-lang/crates.io-index" 127 + checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 128 + 129 + [[package]] 130 + name = "clap" 131 + version = "4.5.4" 132 + source = "registry+https://github.com/rust-lang/crates.io-index" 133 + checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" 134 + dependencies = [ 135 + "clap_builder", 136 + "clap_derive", 137 + ] 138 + 139 + [[package]] 140 + name = "clap_builder" 141 + version = "4.5.2" 142 + source = "registry+https://github.com/rust-lang/crates.io-index" 143 + checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" 144 + dependencies = [ 145 + "anstream", 146 + "anstyle", 147 + "clap_lex", 148 + "strsim", 149 + ] 150 + 151 + [[package]] 152 + name = "clap_derive" 153 + version = "4.5.4" 154 + source = "registry+https://github.com/rust-lang/crates.io-index" 155 + checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" 156 + dependencies = [ 157 + "heck", 158 + "proc-macro2", 159 + "quote", 160 + "syn", 161 + ] 162 + 163 + [[package]] 164 + name = "clap_lex" 165 + version = "0.7.0" 166 + source = "registry+https://github.com/rust-lang/crates.io-index" 167 + checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" 168 + 169 + [[package]] 170 + name = "colorchoice" 171 + version = "1.0.1" 172 + source = "registry+https://github.com/rust-lang/crates.io-index" 173 + checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" 174 + 175 + [[package]] 176 + name = "console" 177 + version = "0.15.8" 178 + source = "registry+https://github.com/rust-lang/crates.io-index" 179 + checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" 180 + dependencies = [ 181 + "encode_unicode", 182 + "lazy_static", 183 + "libc", 184 + "unicode-width", 185 + "windows-sys 0.52.0", 186 + ] 187 + 188 + [[package]] 189 + name = "directories" 190 + version = "5.0.1" 191 + source = "registry+https://github.com/rust-lang/crates.io-index" 192 + checksum = "9a49173b84e034382284f27f1af4dcbbd231ffa358c0fe316541a7337f376a35" 193 + dependencies = [ 194 + "dirs-sys", 195 + ] 196 + 197 + [[package]] 198 + name = "dirs-sys" 199 + version = "0.4.1" 200 + source = "registry+https://github.com/rust-lang/crates.io-index" 201 + checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" 202 + dependencies = [ 203 + "libc", 204 + "option-ext", 205 + "redox_users", 206 + "windows-sys 0.48.0", 207 + ] 208 + 209 + [[package]] 210 + name = "encode_unicode" 211 + version = "0.3.6" 212 + source = "registry+https://github.com/rust-lang/crates.io-index" 213 + checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" 214 + 215 + [[package]] 216 + name = "getrandom" 217 + version = "0.2.15" 218 + source = "registry+https://github.com/rust-lang/crates.io-index" 219 + checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" 220 + dependencies = [ 221 + "cfg-if", 222 + "libc", 223 + "wasi", 224 + ] 225 + 226 + [[package]] 227 + name = "gimli" 228 + version = "0.29.0" 229 + source = "registry+https://github.com/rust-lang/crates.io-index" 230 + checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" 231 + 232 + [[package]] 233 + name = "heck" 234 + version = "0.5.0" 235 + source = "registry+https://github.com/rust-lang/crates.io-index" 236 + checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" 237 + 238 + [[package]] 239 + name = "hermit-abi" 240 + version = "0.3.9" 241 + source = "registry+https://github.com/rust-lang/crates.io-index" 242 + checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" 243 + 244 + [[package]] 245 + name = "hyper-jump" 246 + version = "0.1.0" 247 + dependencies = [ 248 + "clap", 249 + "directories", 250 + "miette", 251 + "tokio", 252 + "tracing", 253 + "tracing-indicatif", 254 + "tracing-subscriber", 255 + ] 256 + 257 + [[package]] 258 + name = "indicatif" 259 + version = "0.17.8" 260 + source = "registry+https://github.com/rust-lang/crates.io-index" 261 + checksum = "763a5a8f45087d6bcea4222e7b72c291a054edf80e4ef6efd2a4979878c7bea3" 262 + dependencies = [ 263 + "console", 264 + "instant", 265 + "number_prefix", 266 + "portable-atomic", 267 + "unicode-width", 268 + "vt100", 269 + ] 270 + 271 + [[package]] 272 + name = "instant" 273 + version = "0.1.13" 274 + source = "registry+https://github.com/rust-lang/crates.io-index" 275 + checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" 276 + dependencies = [ 277 + "cfg-if", 278 + ] 279 + 280 + [[package]] 281 + name = "is-terminal" 282 + version = "0.4.12" 283 + source = "registry+https://github.com/rust-lang/crates.io-index" 284 + checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" 285 + dependencies = [ 286 + "hermit-abi", 287 + "libc", 288 + "windows-sys 0.52.0", 289 + ] 290 + 291 + [[package]] 292 + name = "is_ci" 293 + version = "1.2.0" 294 + source = "registry+https://github.com/rust-lang/crates.io-index" 295 + checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" 296 + 297 + [[package]] 298 + name = "is_terminal_polyfill" 299 + version = "1.70.0" 300 + source = "registry+https://github.com/rust-lang/crates.io-index" 301 + checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" 302 + 303 + [[package]] 304 + name = "itoa" 305 + version = "1.0.11" 306 + source = "registry+https://github.com/rust-lang/crates.io-index" 307 + checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" 308 + 309 + [[package]] 310 + name = "lazy_static" 311 + version = "1.4.0" 312 + source = "registry+https://github.com/rust-lang/crates.io-index" 313 + checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 314 + 315 + [[package]] 316 + name = "libc" 317 + version = "0.2.155" 318 + source = "registry+https://github.com/rust-lang/crates.io-index" 319 + checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" 320 + 321 + [[package]] 322 + name = "libredox" 323 + version = "0.1.3" 324 + source = "registry+https://github.com/rust-lang/crates.io-index" 325 + checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" 326 + dependencies = [ 327 + "bitflags", 328 + "libc", 329 + ] 330 + 331 + [[package]] 332 + name = "lock_api" 333 + version = "0.4.12" 334 + source = "registry+https://github.com/rust-lang/crates.io-index" 335 + checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" 336 + dependencies = [ 337 + "autocfg", 338 + "scopeguard", 339 + ] 340 + 341 + [[package]] 342 + name = "log" 343 + version = "0.4.21" 344 + source = "registry+https://github.com/rust-lang/crates.io-index" 345 + checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" 346 + 347 + [[package]] 348 + name = "memchr" 349 + version = "2.7.2" 350 + source = "registry+https://github.com/rust-lang/crates.io-index" 351 + checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" 352 + 353 + [[package]] 354 + name = "miette" 355 + version = "5.10.0" 356 + source = "registry+https://github.com/rust-lang/crates.io-index" 357 + checksum = "59bb584eaeeab6bd0226ccf3509a69d7936d148cf3d036ad350abe35e8c6856e" 358 + dependencies = [ 359 + "backtrace", 360 + "backtrace-ext", 361 + "is-terminal", 362 + "miette-derive", 363 + "once_cell", 364 + "owo-colors", 365 + "supports-color", 366 + "supports-hyperlinks", 367 + "supports-unicode", 368 + "terminal_size", 369 + "textwrap", 370 + "thiserror", 371 + "unicode-width", 372 + ] 373 + 374 + [[package]] 375 + name = "miette-derive" 376 + version = "5.10.0" 377 + source = "registry+https://github.com/rust-lang/crates.io-index" 378 + checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" 379 + dependencies = [ 380 + "proc-macro2", 381 + "quote", 382 + "syn", 383 + ] 384 + 385 + [[package]] 386 + name = "miniz_oxide" 387 + version = "0.7.3" 388 + source = "registry+https://github.com/rust-lang/crates.io-index" 389 + checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" 390 + dependencies = [ 391 + "adler", 392 + ] 393 + 394 + [[package]] 395 + name = "mio" 396 + version = "0.8.11" 397 + source = "registry+https://github.com/rust-lang/crates.io-index" 398 + checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" 399 + dependencies = [ 400 + "libc", 401 + "wasi", 402 + "windows-sys 0.48.0", 403 + ] 404 + 405 + [[package]] 406 + name = "nu-ansi-term" 407 + version = "0.46.0" 408 + source = "registry+https://github.com/rust-lang/crates.io-index" 409 + checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" 410 + dependencies = [ 411 + "overload", 412 + "winapi", 413 + ] 414 + 415 + [[package]] 416 + name = "num_cpus" 417 + version = "1.16.0" 418 + source = "registry+https://github.com/rust-lang/crates.io-index" 419 + checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" 420 + dependencies = [ 421 + "hermit-abi", 422 + "libc", 423 + ] 424 + 425 + [[package]] 426 + name = "number_prefix" 427 + version = "0.4.0" 428 + source = "registry+https://github.com/rust-lang/crates.io-index" 429 + checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" 430 + 431 + [[package]] 432 + name = "object" 433 + version = "0.35.0" 434 + source = "registry+https://github.com/rust-lang/crates.io-index" 435 + checksum = "b8ec7ab813848ba4522158d5517a6093db1ded27575b070f4177b8d12b41db5e" 436 + dependencies = [ 437 + "memchr", 438 + ] 439 + 440 + [[package]] 441 + name = "once_cell" 442 + version = "1.19.0" 443 + source = "registry+https://github.com/rust-lang/crates.io-index" 444 + checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" 445 + 446 + [[package]] 447 + name = "option-ext" 448 + version = "0.2.0" 449 + source = "registry+https://github.com/rust-lang/crates.io-index" 450 + checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" 451 + 452 + [[package]] 453 + name = "overload" 454 + version = "0.1.1" 455 + source = "registry+https://github.com/rust-lang/crates.io-index" 456 + checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" 457 + 458 + [[package]] 459 + name = "owo-colors" 460 + version = "3.5.0" 461 + source = "registry+https://github.com/rust-lang/crates.io-index" 462 + checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" 463 + 464 + [[package]] 465 + name = "parking_lot" 466 + version = "0.12.3" 467 + source = "registry+https://github.com/rust-lang/crates.io-index" 468 + checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" 469 + dependencies = [ 470 + "lock_api", 471 + "parking_lot_core", 472 + ] 473 + 474 + [[package]] 475 + name = "parking_lot_core" 476 + version = "0.9.10" 477 + source = "registry+https://github.com/rust-lang/crates.io-index" 478 + checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" 479 + dependencies = [ 480 + "cfg-if", 481 + "libc", 482 + "redox_syscall", 483 + "smallvec", 484 + "windows-targets 0.52.5", 485 + ] 486 + 487 + [[package]] 488 + name = "pin-project-lite" 489 + version = "0.2.14" 490 + source = "registry+https://github.com/rust-lang/crates.io-index" 491 + checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" 492 + 493 + [[package]] 494 + name = "portable-atomic" 495 + version = "1.6.0" 496 + source = "registry+https://github.com/rust-lang/crates.io-index" 497 + checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" 498 + 499 + [[package]] 500 + name = "proc-macro2" 501 + version = "1.0.84" 502 + source = "registry+https://github.com/rust-lang/crates.io-index" 503 + checksum = "ec96c6a92621310b51366f1e28d05ef11489516e93be030060e5fc12024a49d6" 504 + dependencies = [ 505 + "unicode-ident", 506 + ] 507 + 508 + [[package]] 509 + name = "quote" 510 + version = "1.0.36" 511 + source = "registry+https://github.com/rust-lang/crates.io-index" 512 + checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" 513 + dependencies = [ 514 + "proc-macro2", 515 + ] 516 + 517 + [[package]] 518 + name = "redox_syscall" 519 + version = "0.5.1" 520 + source = "registry+https://github.com/rust-lang/crates.io-index" 521 + checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" 522 + dependencies = [ 523 + "bitflags", 524 + ] 525 + 526 + [[package]] 527 + name = "redox_users" 528 + version = "0.4.5" 529 + source = "registry+https://github.com/rust-lang/crates.io-index" 530 + checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" 531 + dependencies = [ 532 + "getrandom", 533 + "libredox", 534 + "thiserror", 535 + ] 536 + 537 + [[package]] 538 + name = "rustc-demangle" 539 + version = "0.1.24" 540 + source = "registry+https://github.com/rust-lang/crates.io-index" 541 + checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" 542 + 543 + [[package]] 544 + name = "scopeguard" 545 + version = "1.2.0" 546 + source = "registry+https://github.com/rust-lang/crates.io-index" 547 + checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" 548 + 549 + [[package]] 550 + name = "sharded-slab" 551 + version = "0.1.7" 552 + source = "registry+https://github.com/rust-lang/crates.io-index" 553 + checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" 554 + dependencies = [ 555 + "lazy_static", 556 + ] 557 + 558 + [[package]] 559 + name = "signal-hook-registry" 560 + version = "1.4.2" 561 + source = "registry+https://github.com/rust-lang/crates.io-index" 562 + checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" 563 + dependencies = [ 564 + "libc", 565 + ] 566 + 567 + [[package]] 568 + name = "smallvec" 569 + version = "1.13.2" 570 + source = "registry+https://github.com/rust-lang/crates.io-index" 571 + checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" 572 + 573 + [[package]] 574 + name = "smawk" 575 + version = "0.3.2" 576 + source = "registry+https://github.com/rust-lang/crates.io-index" 577 + checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" 578 + 579 + [[package]] 580 + name = "socket2" 581 + version = "0.5.7" 582 + source = "registry+https://github.com/rust-lang/crates.io-index" 583 + checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" 584 + dependencies = [ 585 + "libc", 586 + "windows-sys 0.52.0", 587 + ] 588 + 589 + [[package]] 590 + name = "strsim" 591 + version = "0.11.1" 592 + source = "registry+https://github.com/rust-lang/crates.io-index" 593 + checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" 594 + 595 + [[package]] 596 + name = "supports-color" 597 + version = "2.1.0" 598 + source = "registry+https://github.com/rust-lang/crates.io-index" 599 + checksum = "d6398cde53adc3c4557306a96ce67b302968513830a77a95b2b17305d9719a89" 600 + dependencies = [ 601 + "is-terminal", 602 + "is_ci", 603 + ] 604 + 605 + [[package]] 606 + name = "supports-hyperlinks" 607 + version = "2.1.0" 608 + source = "registry+https://github.com/rust-lang/crates.io-index" 609 + checksum = "f84231692eb0d4d41e4cdd0cabfdd2e6cd9e255e65f80c9aa7c98dd502b4233d" 610 + dependencies = [ 611 + "is-terminal", 612 + ] 613 + 614 + [[package]] 615 + name = "supports-unicode" 616 + version = "2.1.0" 617 + source = "registry+https://github.com/rust-lang/crates.io-index" 618 + checksum = "f850c19edd184a205e883199a261ed44471c81e39bd95b1357f5febbef00e77a" 619 + dependencies = [ 620 + "is-terminal", 621 + ] 622 + 623 + [[package]] 624 + name = "syn" 625 + version = "2.0.66" 626 + source = "registry+https://github.com/rust-lang/crates.io-index" 627 + checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" 628 + dependencies = [ 629 + "proc-macro2", 630 + "quote", 631 + "unicode-ident", 632 + ] 633 + 634 + [[package]] 635 + name = "terminal_size" 636 + version = "0.1.17" 637 + source = "registry+https://github.com/rust-lang/crates.io-index" 638 + checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" 639 + dependencies = [ 640 + "libc", 641 + "winapi", 642 + ] 643 + 644 + [[package]] 645 + name = "textwrap" 646 + version = "0.15.2" 647 + source = "registry+https://github.com/rust-lang/crates.io-index" 648 + checksum = "b7b3e525a49ec206798b40326a44121291b530c963cfb01018f63e135bac543d" 649 + dependencies = [ 650 + "smawk", 651 + "unicode-linebreak", 652 + "unicode-width", 653 + ] 654 + 655 + [[package]] 656 + name = "thiserror" 657 + version = "1.0.61" 658 + source = "registry+https://github.com/rust-lang/crates.io-index" 659 + checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" 660 + dependencies = [ 661 + "thiserror-impl", 662 + ] 663 + 664 + [[package]] 665 + name = "thiserror-impl" 666 + version = "1.0.61" 667 + source = "registry+https://github.com/rust-lang/crates.io-index" 668 + checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" 669 + dependencies = [ 670 + "proc-macro2", 671 + "quote", 672 + "syn", 673 + ] 674 + 675 + [[package]] 676 + name = "thread_local" 677 + version = "1.1.8" 678 + source = "registry+https://github.com/rust-lang/crates.io-index" 679 + checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" 680 + dependencies = [ 681 + "cfg-if", 682 + "once_cell", 683 + ] 684 + 685 + [[package]] 686 + name = "tokio" 687 + version = "1.37.0" 688 + source = "registry+https://github.com/rust-lang/crates.io-index" 689 + checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" 690 + dependencies = [ 691 + "backtrace", 692 + "bytes", 693 + "libc", 694 + "mio", 695 + "num_cpus", 696 + "parking_lot", 697 + "pin-project-lite", 698 + "signal-hook-registry", 699 + "socket2", 700 + "tokio-macros", 701 + "windows-sys 0.48.0", 702 + ] 703 + 704 + [[package]] 705 + name = "tokio-macros" 706 + version = "2.2.0" 707 + source = "registry+https://github.com/rust-lang/crates.io-index" 708 + checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" 709 + dependencies = [ 710 + "proc-macro2", 711 + "quote", 712 + "syn", 713 + ] 714 + 715 + [[package]] 716 + name = "tracing" 717 + version = "0.1.40" 718 + source = "registry+https://github.com/rust-lang/crates.io-index" 719 + checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" 720 + dependencies = [ 721 + "pin-project-lite", 722 + "tracing-attributes", 723 + "tracing-core", 724 + ] 725 + 726 + [[package]] 727 + name = "tracing-attributes" 728 + version = "0.1.27" 729 + source = "registry+https://github.com/rust-lang/crates.io-index" 730 + checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" 731 + dependencies = [ 732 + "proc-macro2", 733 + "quote", 734 + "syn", 735 + ] 736 + 737 + [[package]] 738 + name = "tracing-core" 739 + version = "0.1.32" 740 + source = "registry+https://github.com/rust-lang/crates.io-index" 741 + checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" 742 + dependencies = [ 743 + "once_cell", 744 + "valuable", 745 + ] 746 + 747 + [[package]] 748 + name = "tracing-indicatif" 749 + version = "0.3.6" 750 + source = "registry+https://github.com/rust-lang/crates.io-index" 751 + checksum = "069580424efe11d97c3fef4197fa98c004fa26672cc71ad8770d224e23b1951d" 752 + dependencies = [ 753 + "indicatif", 754 + "tracing", 755 + "tracing-core", 756 + "tracing-subscriber", 757 + ] 758 + 759 + [[package]] 760 + name = "tracing-log" 761 + version = "0.2.0" 762 + source = "registry+https://github.com/rust-lang/crates.io-index" 763 + checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" 764 + dependencies = [ 765 + "log", 766 + "once_cell", 767 + "tracing-core", 768 + ] 769 + 770 + [[package]] 771 + name = "tracing-subscriber" 772 + version = "0.3.18" 773 + source = "registry+https://github.com/rust-lang/crates.io-index" 774 + checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" 775 + dependencies = [ 776 + "nu-ansi-term", 777 + "sharded-slab", 778 + "smallvec", 779 + "thread_local", 780 + "tracing-core", 781 + "tracing-log", 782 + ] 783 + 784 + [[package]] 785 + name = "unicode-ident" 786 + version = "1.0.12" 787 + source = "registry+https://github.com/rust-lang/crates.io-index" 788 + checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" 789 + 790 + [[package]] 791 + name = "unicode-linebreak" 792 + version = "0.1.5" 793 + source = "registry+https://github.com/rust-lang/crates.io-index" 794 + checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" 795 + 796 + [[package]] 797 + name = "unicode-width" 798 + version = "0.1.12" 799 + source = "registry+https://github.com/rust-lang/crates.io-index" 800 + checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" 801 + 802 + [[package]] 803 + name = "utf8parse" 804 + version = "0.2.1" 805 + source = "registry+https://github.com/rust-lang/crates.io-index" 806 + checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" 807 + 808 + [[package]] 809 + name = "valuable" 810 + version = "0.1.0" 811 + source = "registry+https://github.com/rust-lang/crates.io-index" 812 + checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" 813 + 814 + [[package]] 815 + name = "vt100" 816 + version = "0.15.2" 817 + source = "registry+https://github.com/rust-lang/crates.io-index" 818 + checksum = "84cd863bf0db7e392ba3bd04994be3473491b31e66340672af5d11943c6274de" 819 + dependencies = [ 820 + "itoa", 821 + "log", 822 + "unicode-width", 823 + "vte", 824 + ] 825 + 826 + [[package]] 827 + name = "vte" 828 + version = "0.11.1" 829 + source = "registry+https://github.com/rust-lang/crates.io-index" 830 + checksum = "f5022b5fbf9407086c180e9557be968742d839e68346af7792b8592489732197" 831 + dependencies = [ 832 + "arrayvec", 833 + "utf8parse", 834 + "vte_generate_state_changes", 835 + ] 836 + 837 + [[package]] 838 + name = "vte_generate_state_changes" 839 + version = "0.1.1" 840 + source = "registry+https://github.com/rust-lang/crates.io-index" 841 + checksum = "d257817081c7dffcdbab24b9e62d2def62e2ff7d00b1c20062551e6cccc145ff" 842 + dependencies = [ 843 + "proc-macro2", 844 + "quote", 845 + ] 846 + 847 + [[package]] 848 + name = "wasi" 849 + version = "0.11.0+wasi-snapshot-preview1" 850 + source = "registry+https://github.com/rust-lang/crates.io-index" 851 + checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 852 + 853 + [[package]] 854 + name = "winapi" 855 + version = "0.3.9" 856 + source = "registry+https://github.com/rust-lang/crates.io-index" 857 + checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 858 + dependencies = [ 859 + "winapi-i686-pc-windows-gnu", 860 + "winapi-x86_64-pc-windows-gnu", 861 + ] 862 + 863 + [[package]] 864 + name = "winapi-i686-pc-windows-gnu" 865 + version = "0.4.0" 866 + source = "registry+https://github.com/rust-lang/crates.io-index" 867 + checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 868 + 869 + [[package]] 870 + name = "winapi-x86_64-pc-windows-gnu" 871 + version = "0.4.0" 872 + source = "registry+https://github.com/rust-lang/crates.io-index" 873 + checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 874 + 875 + [[package]] 876 + name = "windows-sys" 877 + version = "0.48.0" 878 + source = "registry+https://github.com/rust-lang/crates.io-index" 879 + checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" 880 + dependencies = [ 881 + "windows-targets 0.48.5", 882 + ] 883 + 884 + [[package]] 885 + name = "windows-sys" 886 + version = "0.52.0" 887 + source = "registry+https://github.com/rust-lang/crates.io-index" 888 + checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" 889 + dependencies = [ 890 + "windows-targets 0.52.5", 891 + ] 892 + 893 + [[package]] 894 + name = "windows-targets" 895 + version = "0.48.5" 896 + source = "registry+https://github.com/rust-lang/crates.io-index" 897 + checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" 898 + dependencies = [ 899 + "windows_aarch64_gnullvm 0.48.5", 900 + "windows_aarch64_msvc 0.48.5", 901 + "windows_i686_gnu 0.48.5", 902 + "windows_i686_msvc 0.48.5", 903 + "windows_x86_64_gnu 0.48.5", 904 + "windows_x86_64_gnullvm 0.48.5", 905 + "windows_x86_64_msvc 0.48.5", 906 + ] 907 + 908 + [[package]] 909 + name = "windows-targets" 910 + version = "0.52.5" 911 + source = "registry+https://github.com/rust-lang/crates.io-index" 912 + checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" 913 + dependencies = [ 914 + "windows_aarch64_gnullvm 0.52.5", 915 + "windows_aarch64_msvc 0.52.5", 916 + "windows_i686_gnu 0.52.5", 917 + "windows_i686_gnullvm", 918 + "windows_i686_msvc 0.52.5", 919 + "windows_x86_64_gnu 0.52.5", 920 + "windows_x86_64_gnullvm 0.52.5", 921 + "windows_x86_64_msvc 0.52.5", 922 + ] 923 + 924 + [[package]] 925 + name = "windows_aarch64_gnullvm" 926 + version = "0.48.5" 927 + source = "registry+https://github.com/rust-lang/crates.io-index" 928 + checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" 929 + 930 + [[package]] 931 + name = "windows_aarch64_gnullvm" 932 + version = "0.52.5" 933 + source = "registry+https://github.com/rust-lang/crates.io-index" 934 + checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" 935 + 936 + [[package]] 937 + name = "windows_aarch64_msvc" 938 + version = "0.48.5" 939 + source = "registry+https://github.com/rust-lang/crates.io-index" 940 + checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" 941 + 942 + [[package]] 943 + name = "windows_aarch64_msvc" 944 + version = "0.52.5" 945 + source = "registry+https://github.com/rust-lang/crates.io-index" 946 + checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" 947 + 948 + [[package]] 949 + name = "windows_i686_gnu" 950 + version = "0.48.5" 951 + source = "registry+https://github.com/rust-lang/crates.io-index" 952 + checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" 953 + 954 + [[package]] 955 + name = "windows_i686_gnu" 956 + version = "0.52.5" 957 + source = "registry+https://github.com/rust-lang/crates.io-index" 958 + checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" 959 + 960 + [[package]] 961 + name = "windows_i686_gnullvm" 962 + version = "0.52.5" 963 + source = "registry+https://github.com/rust-lang/crates.io-index" 964 + checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" 965 + 966 + [[package]] 967 + name = "windows_i686_msvc" 968 + version = "0.48.5" 969 + source = "registry+https://github.com/rust-lang/crates.io-index" 970 + checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" 971 + 972 + [[package]] 973 + name = "windows_i686_msvc" 974 + version = "0.52.5" 975 + source = "registry+https://github.com/rust-lang/crates.io-index" 976 + checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" 977 + 978 + [[package]] 979 + name = "windows_x86_64_gnu" 980 + version = "0.48.5" 981 + source = "registry+https://github.com/rust-lang/crates.io-index" 982 + checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" 983 + 984 + [[package]] 985 + name = "windows_x86_64_gnu" 986 + version = "0.52.5" 987 + source = "registry+https://github.com/rust-lang/crates.io-index" 988 + checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" 989 + 990 + [[package]] 991 + name = "windows_x86_64_gnullvm" 992 + version = "0.48.5" 993 + source = "registry+https://github.com/rust-lang/crates.io-index" 994 + checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" 995 + 996 + [[package]] 997 + name = "windows_x86_64_gnullvm" 998 + version = "0.52.5" 999 + source = "registry+https://github.com/rust-lang/crates.io-index" 1000 + checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" 1001 + 1002 + [[package]] 1003 + name = "windows_x86_64_msvc" 1004 + version = "0.48.5" 1005 + source = "registry+https://github.com/rust-lang/crates.io-index" 1006 + checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" 1007 + 1008 + [[package]] 1009 + name = "windows_x86_64_msvc" 1010 + version = "0.52.5" 1011 + source = "registry+https://github.com/rust-lang/crates.io-index" 1012 + checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0"
+13
Cargo.toml
··· 1 + [package] 2 + name = "hyper-jump" 3 + version = "0.1.0" 4 + edition = "2021" 5 + 6 + [dependencies] 7 + clap = { version = "4.5.4", features = ["derive", "env"] } 8 + tokio = { version = "1.37.0", features = ["full"] } 9 + miette = { version = "5.10.0", features = ["fancy"] } 10 + directories = "5.0.1" 11 + tracing = "0.1.40" 12 + tracing-indicatif = "0.3.5" 13 + tracing-subscriber = "0.3.17"
default.profraw

This is a binary file and will not be displayed.

+21
readme.md
··· 1 + # Hyper Jump 2 + 3 + The hyper-jump project. 4 + 5 + The current supported Cardano binaries are: 6 + 7 + - cardano-node; 8 + - cardano-cli; 9 + - mithril-client-cli; 10 + 11 + ## Installation 12 + 13 + ```bash 14 + cargo install hyper-jump 15 + ``` 16 + 17 + ## Usage 18 + 19 + ```bash 20 + hyper-jump --help 21 + ```
+40
src/cardano_cli/mod.rs
··· 1 + use clap::Parser; 2 + use tracing::instrument; 3 + 4 + #[derive(Parser)] 5 + pub struct Args { 6 + #[command(subcommand)] 7 + command: Commands, 8 + } 9 + 10 + #[derive(Parser)] 11 + pub struct Run { 12 + #[arg(short, long)] 13 + free: Vec<String>, 14 + } 15 + 16 + #[derive(Parser)] 17 + pub struct Bar { 18 + #[arg(short, long)] 19 + free: Vec<String>, 20 + } 21 + 22 + #[derive(Parser)] 23 + pub enum Commands { 24 + Run(Run), 25 + Bar(Bar), 26 + } 27 + 28 + #[instrument("cardano-cli", skip_all)] 29 + pub async fn run(args: Args, _ctx: &crate::Context) -> miette::Result<()> { 30 + match args.command { 31 + Commands::Run(run) => { 32 + println!("Running run with free: {:?}", run.free); 33 + } 34 + Commands::Bar(bar) => { 35 + println!("Running bar with free: {:?}", bar.free); 36 + } 37 + } 38 + 39 + Ok(()) 40 + }
+40
src/cardano_node/mod.rs
··· 1 + use clap::Parser; 2 + use tracing::instrument; 3 + 4 + #[derive(Parser)] 5 + pub struct Args { 6 + #[command(subcommand)] 7 + command: Commands, 8 + } 9 + 10 + #[derive(Parser)] 11 + pub enum Commands { 12 + Run(Run), 13 + Bar(Bar), 14 + } 15 + 16 + #[derive(Parser)] 17 + pub struct Run { 18 + #[arg(short, long)] 19 + free: Vec<String>, 20 + } 21 + 22 + #[derive(Parser)] 23 + pub struct Bar { 24 + #[arg(short, long)] 25 + free: Vec<String>, 26 + } 27 + 28 + #[instrument("cardano-node", skip_all)] 29 + pub async fn run(args: Args, _ctx: &crate::Context) -> miette::Result<()> { 30 + match args.command { 31 + Commands::Run(run) => { 32 + println!("Running run with free: {:?}", run.free); 33 + } 34 + Commands::Bar(bar) => { 35 + println!("Running bar with free: {:?}", bar.free); 36 + } 37 + } 38 + 39 + Ok(()) 40 + }
+34
src/dirs.rs
··· 1 + use miette::{bail, IntoDiagnostic}; 2 + use std::path::{Path, PathBuf}; 3 + 4 + const DEFAULT_PATH_NAME: &str = "hyper-jump"; 5 + 6 + fn default_root_dir() -> miette::Result<PathBuf> { 7 + if let Some(path) = directories::ProjectDirs::from("", "", DEFAULT_PATH_NAME) { 8 + return Ok(path.data_dir().into()); 9 + } 10 + 11 + bail!("Use root_dir parameter or env"); 12 + } 13 + 14 + pub fn ensure_root_dir(explicit: Option<&Path>) -> miette::Result<PathBuf> { 15 + let defined = explicit 16 + .map(|p| p.join(DEFAULT_PATH_NAME)) 17 + .unwrap_or(default_root_dir()?); 18 + 19 + std::fs::create_dir_all(&defined).into_diagnostic()?; 20 + 21 + Ok(defined) 22 + } 23 + 24 + pub struct Dirs { 25 + pub root_dir: PathBuf, 26 + } 27 + 28 + impl Dirs { 29 + pub fn try_new(root_dir: Option<&Path>) -> miette::Result<Self> { 30 + let root_dir = ensure_root_dir(root_dir)?; 31 + 32 + Ok(Self { root_dir }) 33 + } 34 + }
+91
src/main.rs
··· 1 + use std::path::PathBuf; 2 + 3 + use clap::{Parser, Subcommand, ValueEnum}; 4 + use tracing::Level; 5 + use tracing_indicatif::IndicatifLayer; 6 + use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt}; 7 + 8 + mod cardano_cli; 9 + mod cardano_node; 10 + mod dirs; 11 + mod mithril; 12 + 13 + #[derive(Parser)] 14 + #[command(author, version, about, long_about = None)] 15 + #[command(propagate_version = true)] 16 + struct Cli { 17 + #[command(subcommand)] 18 + command: Commands, 19 + 20 + #[arg( 21 + short, 22 + long, 23 + global = true, 24 + help = "root dir for config and data", 25 + env = "Hyper-jump_ROOT_DIR" 26 + )] 27 + root_dir: Option<PathBuf>, 28 + 29 + #[arg( 30 + short, 31 + long, 32 + global = true, 33 + help = "output format for command response", 34 + env = "Hyper-jump_OUTPUT_FORMAT" 35 + )] 36 + output_format: Option<OutputFormat>, 37 + } 38 + 39 + #[derive(ValueEnum, Clone)] 40 + pub enum OutputFormat { 41 + Json, 42 + Table, 43 + } 44 + 45 + #[derive(Subcommand)] 46 + enum Commands { 47 + Mithril(mithril::Args), 48 + CardanoNode(cardano_node::Args), 49 + CardanoCli(cardano_cli::Args), 50 + } 51 + 52 + pub struct Context { 53 + pub dirs: dirs::Dirs, 54 + pub output_format: OutputFormat, 55 + } 56 + 57 + impl Context { 58 + fn for_cli(cli: &Cli) -> miette::Result<Self> { 59 + let dirs = dirs::Dirs::try_new(cli.root_dir.as_deref())?; 60 + let output_format = cli.output_format.clone().unwrap_or(OutputFormat::Table); 61 + 62 + Ok(Context { 63 + dirs, 64 + output_format, 65 + }) 66 + } 67 + } 68 + 69 + pub fn with_tracing() { 70 + let indicatif_layer = IndicatifLayer::new(); 71 + 72 + tracing_subscriber::registry() 73 + .with(tracing_subscriber::filter::LevelFilter::INFO) 74 + .with(tracing_subscriber::filter::Targets::default().with_target("cardaminal", Level::INFO)) 75 + .with(tracing_subscriber::fmt::layer().with_writer(indicatif_layer.get_stderr_writer())) 76 + .with(indicatif_layer) 77 + .init(); 78 + } 79 + 80 + #[tokio::main] 81 + async fn main() -> miette::Result<()> { 82 + let cli = Cli::parse(); 83 + 84 + let ctx = Context::for_cli(&cli)?; 85 + 86 + match cli.command { 87 + Commands::Mithril(args) => mithril::run(args, &ctx).await, 88 + Commands::CardanoNode(args) => cardano_node::run(args, &ctx).await, 89 + Commands::CardanoCli(args) => todo!(), 90 + } 91 + }
+40
src/mithril/mod.rs
··· 1 + use clap::{command, Parser}; 2 + use tracing::instrument; 3 + 4 + #[derive(Parser)] 5 + pub struct Args { 6 + #[command(subcommand)] 7 + command: Commands, 8 + } 9 + 10 + #[derive(Parser)] 11 + pub struct Run { 12 + #[arg(short, long)] 13 + free: Vec<String>, 14 + } 15 + 16 + #[derive(Parser)] 17 + pub struct Bar { 18 + #[arg(short, long)] 19 + free: Vec<String>, 20 + } 21 + 22 + #[derive(Parser)] 23 + pub enum Commands { 24 + Run(Run), 25 + Bar(Bar), 26 + } 27 + 28 + #[instrument("mithril", skip_all)] 29 + pub async fn run(args: Args, _ctx: &crate::Context) -> miette::Result<()> { 30 + match args.command { 31 + Commands::Run(run) => { 32 + println!("Running run with free: {:?}", run.free); 33 + } 34 + Commands::Bar(bar) => { 35 + println!("Running bar with free: {:?}", bar.free); 36 + } 37 + } 38 + 39 + Ok(()) 40 + }