SQLite-backed Key / Value Store
1
fork

Configure Feed

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

refactor: trimmed the repo down to just safir

+358 -2795
+239 -245
Cargo.lock
··· 3 3 version = 3 4 4 5 5 [[package]] 6 - name = "addr2line" 7 - version = "0.21.0" 8 - source = "registry+https://github.com/rust-lang/crates.io-index" 9 - checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" 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 6 name = "anstream" 22 - version = "0.5.0" 7 + version = "0.3.2" 23 8 source = "registry+https://github.com/rust-lang/crates.io-index" 24 - checksum = "b1f58811cfac344940f1a400b6e6231ce35171f614f26439e80f8c1465c5cc0c" 9 + checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" 25 10 dependencies = [ 26 11 "anstyle", 27 12 "anstyle-parse", 28 13 "anstyle-query", 29 14 "anstyle-wincon", 30 15 "colorchoice", 16 + "is-terminal", 31 17 "utf8parse", 32 18 ] 33 19 34 20 [[package]] 35 21 name = "anstyle" 36 - version = "1.0.2" 22 + version = "1.0.0" 37 23 source = "registry+https://github.com/rust-lang/crates.io-index" 38 - checksum = "15c4c2c83f81532e5845a733998b6971faca23490340a418e9b72a3ec9de12ea" 24 + checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d" 39 25 40 26 [[package]] 41 27 name = "anstyle-parse" 42 - version = "0.2.1" 28 + version = "0.2.0" 43 29 source = "registry+https://github.com/rust-lang/crates.io-index" 44 - checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" 30 + checksum = "e765fd216e48e067936442276d1d57399e37bce53c264d6fefbe298080cb57ee" 45 31 dependencies = [ 46 32 "utf8parse", 47 33 ] ··· 52 38 source = "registry+https://github.com/rust-lang/crates.io-index" 53 39 checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" 54 40 dependencies = [ 55 - "windows-sys", 41 + "windows-sys 0.48.0", 56 42 ] 57 43 58 44 [[package]] 59 45 name = "anstyle-wincon" 60 - version = "2.1.0" 46 + version = "1.0.1" 61 47 source = "registry+https://github.com/rust-lang/crates.io-index" 62 - checksum = "58f54d10c6dfa51283a066ceab3ec1ab78d13fae00aa49243a45e4571fb79dfd" 48 + checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" 63 49 dependencies = [ 64 50 "anstyle", 65 - "windows-sys", 51 + "windows-sys 0.48.0", 66 52 ] 67 53 68 54 [[package]] 69 - name = "anyhow" 70 - version = "1.0.75" 71 - source = "registry+https://github.com/rust-lang/crates.io-index" 72 - checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" 73 - 74 - [[package]] 75 - name = "async-trait" 76 - version = "0.1.73" 55 + name = "atty" 56 + version = "0.2.14" 77 57 source = "registry+https://github.com/rust-lang/crates.io-index" 78 - checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" 58 + checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" 79 59 dependencies = [ 80 - "proc-macro2", 81 - "quote", 82 - "syn 2.0.29", 60 + "hermit-abi 0.1.19", 61 + "libc", 62 + "winapi", 83 63 ] 84 64 85 65 [[package]] ··· 89 69 checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 90 70 91 71 [[package]] 92 - name = "backtrace" 93 - version = "0.3.69" 94 - source = "registry+https://github.com/rust-lang/crates.io-index" 95 - checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" 96 - dependencies = [ 97 - "addr2line", 98 - "cc", 99 - "cfg-if", 100 - "libc", 101 - "miniz_oxide", 102 - "object", 103 - "rustc-demangle", 104 - ] 105 - 106 - [[package]] 107 72 name = "bitflags" 108 73 version = "1.3.2" 109 74 source = "registry+https://github.com/rust-lang/crates.io-index" 110 75 checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 111 76 112 77 [[package]] 113 - name = "bitflags" 114 - version = "2.4.0" 115 - source = "registry+https://github.com/rust-lang/crates.io-index" 116 - checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" 117 - 118 - [[package]] 119 78 name = "bytes" 120 79 version = "1.4.0" 121 80 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 123 82 124 83 [[package]] 125 84 name = "cc" 126 - version = "1.0.83" 85 + version = "1.0.79" 127 86 source = "registry+https://github.com/rust-lang/crates.io-index" 128 - checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" 129 - dependencies = [ 130 - "libc", 131 - ] 87 + checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" 132 88 133 89 [[package]] 134 90 name = "cfg-if" ··· 138 94 139 95 [[package]] 140 96 name = "clap" 141 - version = "4.4.1" 97 + version = "4.3.1" 142 98 source = "registry+https://github.com/rust-lang/crates.io-index" 143 - checksum = "7c8d502cbaec4595d2e7d5f61e318f05417bd2b66fdc3809498f0d3fdf0bea27" 99 + checksum = "b4ed2379f8603fa2b7509891660e802b88c70a79a6427a70abb5968054de2c28" 144 100 dependencies = [ 145 101 "clap_builder", 146 102 "clap_derive", ··· 149 105 150 106 [[package]] 151 107 name = "clap_builder" 152 - version = "4.4.1" 108 + version = "4.3.1" 153 109 source = "registry+https://github.com/rust-lang/crates.io-index" 154 - checksum = "5891c7bc0edb3e1c2204fc5e94009affabeb1821c9e5fdc3959536c5c0bb984d" 110 + checksum = "72394f3339a76daf211e57d4bcb374410f3965dcc606dd0e03738c7888766980" 155 111 dependencies = [ 156 112 "anstream", 157 113 "anstyle", 114 + "bitflags", 158 115 "clap_lex", 159 116 "strsim", 160 117 ] 161 118 162 119 [[package]] 163 120 name = "clap_derive" 164 - version = "4.4.0" 121 + version = "4.3.1" 165 122 source = "registry+https://github.com/rust-lang/crates.io-index" 166 - checksum = "c9fd1a5729c4548118d7d70ff234a44868d00489a4b6597b0b020918a0e91a1a" 123 + checksum = "59e9ef9a08ee1c0e1f2e162121665ac45ac3783b0f897db7244ae75ad9a8f65b" 167 124 dependencies = [ 168 125 "heck", 169 126 "proc-macro2", 170 127 "quote", 171 - "syn 2.0.29", 128 + "syn 2.0.18", 172 129 ] 173 130 174 131 [[package]] 175 132 name = "clap_lex" 176 - version = "0.5.1" 133 + version = "0.5.0" 177 134 source = "registry+https://github.com/rust-lang/crates.io-index" 178 - checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" 135 + checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" 179 136 180 137 [[package]] 181 138 name = "colorchoice" ··· 185 142 186 143 [[package]] 187 144 name = "colored" 188 - version = "2.0.4" 145 + version = "2.0.0" 189 146 source = "registry+https://github.com/rust-lang/crates.io-index" 190 - checksum = "2674ec482fbc38012cf31e6c42ba0177b431a0cb6f15fe40efa5aab1bda516f6" 147 + checksum = "b3616f750b84d8f0de8a58bda93e08e2a81ad3f523089b05f1dffecab48c6cbd" 191 148 dependencies = [ 192 - "is-terminal", 149 + "atty", 193 150 "lazy_static", 194 - "windows-sys", 151 + "winapi", 195 152 ] 196 153 197 154 [[package]] ··· 292 249 "libc", 293 250 "option-ext", 294 251 "redox_users", 295 - "windows-sys", 252 + "windows-sys 0.48.0", 296 253 ] 297 254 298 255 [[package]] 299 256 name = "either" 300 - version = "1.9.0" 257 + version = "1.8.1" 301 258 source = "registry+https://github.com/rust-lang/crates.io-index" 302 - checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" 259 + checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" 303 260 304 261 [[package]] 305 262 name = "errno" 306 - version = "0.3.3" 263 + version = "0.3.1" 307 264 source = "registry+https://github.com/rust-lang/crates.io-index" 308 - checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" 265 + checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" 309 266 dependencies = [ 310 267 "errno-dragonfly", 311 268 "libc", 312 - "windows-sys", 269 + "windows-sys 0.48.0", 313 270 ] 314 271 315 272 [[package]] ··· 324 281 325 282 [[package]] 326 283 name = "getrandom" 327 - version = "0.2.10" 284 + version = "0.2.9" 328 285 source = "registry+https://github.com/rust-lang/crates.io-index" 329 - checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" 286 + checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" 330 287 dependencies = [ 331 288 "cfg-if", 332 289 "libc", 333 290 "wasi", 334 291 ] 335 - 336 - [[package]] 337 - name = "gimli" 338 - version = "0.28.0" 339 - source = "registry+https://github.com/rust-lang/crates.io-index" 340 - checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" 341 292 342 293 [[package]] 343 294 name = "glob" ··· 353 304 354 305 [[package]] 355 306 name = "hermit-abi" 356 - version = "0.3.2" 307 + version = "0.1.19" 308 + source = "registry+https://github.com/rust-lang/crates.io-index" 309 + checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" 310 + dependencies = [ 311 + "libc", 312 + ] 313 + 314 + [[package]] 315 + name = "hermit-abi" 316 + version = "0.2.6" 317 + source = "registry+https://github.com/rust-lang/crates.io-index" 318 + checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" 319 + dependencies = [ 320 + "libc", 321 + ] 322 + 323 + [[package]] 324 + name = "hermit-abi" 325 + version = "0.3.1" 326 + source = "registry+https://github.com/rust-lang/crates.io-index" 327 + checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" 328 + 329 + [[package]] 330 + name = "io-lifetimes" 331 + version = "1.0.11" 357 332 source = "registry+https://github.com/rust-lang/crates.io-index" 358 - checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" 333 + checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" 334 + dependencies = [ 335 + "hermit-abi 0.3.1", 336 + "libc", 337 + "windows-sys 0.48.0", 338 + ] 359 339 360 340 [[package]] 361 341 name = "is-terminal" 362 - version = "0.4.9" 342 + version = "0.4.7" 363 343 source = "registry+https://github.com/rust-lang/crates.io-index" 364 - checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" 344 + checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" 365 345 dependencies = [ 366 - "hermit-abi", 346 + "hermit-abi 0.3.1", 347 + "io-lifetimes", 367 348 "rustix", 368 - "windows-sys", 349 + "windows-sys 0.48.0", 369 350 ] 370 351 371 352 [[package]] 372 353 name = "itoa" 373 - version = "1.0.9" 354 + version = "1.0.6" 374 355 source = "registry+https://github.com/rust-lang/crates.io-index" 375 - checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" 356 + checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" 376 357 377 358 [[package]] 378 359 name = "lazy_static" ··· 382 363 383 364 [[package]] 384 365 name = "libc" 385 - version = "0.2.147" 366 + version = "0.2.144" 386 367 source = "registry+https://github.com/rust-lang/crates.io-index" 387 - checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" 368 + checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" 388 369 389 370 [[package]] 390 371 name = "linux-raw-sys" 391 - version = "0.4.5" 372 + version = "0.3.8" 392 373 source = "registry+https://github.com/rust-lang/crates.io-index" 393 - checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" 374 + checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" 394 375 395 376 [[package]] 396 377 name = "lock_api" 397 - version = "0.4.10" 378 + version = "0.4.9" 398 379 source = "registry+https://github.com/rust-lang/crates.io-index" 399 - checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" 380 + checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" 400 381 dependencies = [ 401 382 "autocfg", 402 383 "scopeguard", ··· 404 385 405 386 [[package]] 406 387 name = "log" 407 - version = "0.4.20" 388 + version = "0.4.19" 408 389 source = "registry+https://github.com/rust-lang/crates.io-index" 409 - checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" 390 + checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" 410 391 411 392 [[package]] 412 393 name = "mach" ··· 419 400 420 401 [[package]] 421 402 name = "memchr" 422 - version = "2.6.1" 403 + version = "2.5.0" 423 404 source = "registry+https://github.com/rust-lang/crates.io-index" 424 - checksum = "f478948fd84d9f8e86967bf432640e46adfb5a4bd4f14ef7e864ab38220534ae" 405 + checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" 425 406 426 407 [[package]] 427 408 name = "memoffset" ··· 442 423 ] 443 424 444 425 [[package]] 445 - name = "miniz_oxide" 446 - version = "0.7.1" 447 - source = "registry+https://github.com/rust-lang/crates.io-index" 448 - checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" 449 - dependencies = [ 450 - "adler", 451 - ] 452 - 453 - [[package]] 454 426 name = "mio" 455 427 version = "0.8.8" 456 428 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 458 430 dependencies = [ 459 431 "libc", 460 432 "wasi", 461 - "windows-sys", 433 + "windows-sys 0.48.0", 462 434 ] 463 435 464 436 [[package]] ··· 467 439 source = "registry+https://github.com/rust-lang/crates.io-index" 468 440 checksum = "8f3790c00a0150112de0f4cd161e3d7fc4b2d8a5542ffc35f099a2562aecb35c" 469 441 dependencies = [ 470 - "bitflags 1.3.2", 442 + "bitflags", 471 443 "cc", 472 444 "cfg-if", 473 445 "libc", ··· 495 467 496 468 [[package]] 497 469 name = "num_cpus" 498 - version = "1.16.0" 470 + version = "1.15.0" 499 471 source = "registry+https://github.com/rust-lang/crates.io-index" 500 - checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" 472 + checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" 501 473 dependencies = [ 502 - "hermit-abi", 474 + "hermit-abi 0.2.6", 503 475 "libc", 504 476 ] 505 477 506 478 [[package]] 507 - name = "object" 508 - version = "0.32.0" 509 - source = "registry+https://github.com/rust-lang/crates.io-index" 510 - checksum = "77ac5bbd07aea88c60a577a1ce218075ffd59208b2d7ca97adf9bfc5aeb21ebe" 511 - dependencies = [ 512 - "memchr", 513 - ] 514 - 515 - [[package]] 516 479 name = "once_cell" 517 - version = "1.18.0" 480 + version = "1.17.2" 518 481 source = "registry+https://github.com/rust-lang/crates.io-index" 519 - checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" 482 + checksum = "9670a07f94779e00908f3e686eab508878ebb390ba6e604d3a284c00e8d0487b" 520 483 521 484 [[package]] 522 485 name = "option-ext" ··· 542 505 543 506 [[package]] 544 507 name = "parking_lot_core" 545 - version = "0.9.8" 508 + version = "0.9.7" 546 509 source = "registry+https://github.com/rust-lang/crates.io-index" 547 - checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" 510 + checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" 548 511 dependencies = [ 549 512 "cfg-if", 550 513 "libc", 551 - "redox_syscall 0.3.5", 514 + "redox_syscall", 552 515 "smallvec", 553 - "windows-targets", 516 + "windows-sys 0.45.0", 554 517 ] 555 518 556 519 [[package]] 557 520 name = "pin-project-lite" 558 - version = "0.2.13" 521 + version = "0.2.9" 559 522 source = "registry+https://github.com/rust-lang/crates.io-index" 560 - checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" 523 + checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" 561 524 562 525 [[package]] 563 526 name = "platforms" ··· 567 530 568 531 [[package]] 569 532 name = "proc-macro2" 570 - version = "1.0.66" 533 + version = "1.0.59" 571 534 source = "registry+https://github.com/rust-lang/crates.io-index" 572 - checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" 535 + checksum = "6aeca18b86b413c660b781aa319e4e2648a3e6f9eadc9b47e9038e6fe9f3451b" 573 536 dependencies = [ 574 537 "unicode-ident", 575 538 ] ··· 595 558 596 559 [[package]] 597 560 name = "quote" 598 - version = "1.0.33" 561 + version = "1.0.28" 599 562 source = "registry+https://github.com/rust-lang/crates.io-index" 600 - checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" 563 + checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" 601 564 dependencies = [ 602 565 "proc-macro2", 603 566 ] ··· 630 593 source = "registry+https://github.com/rust-lang/crates.io-index" 631 594 checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" 632 595 dependencies = [ 633 - "bitflags 1.3.2", 634 - ] 635 - 636 - [[package]] 637 - name = "redox_syscall" 638 - version = "0.3.5" 639 - source = "registry+https://github.com/rust-lang/crates.io-index" 640 - checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" 641 - dependencies = [ 642 - "bitflags 1.3.2", 596 + "bitflags", 643 597 ] 644 598 645 599 [[package]] ··· 649 603 checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" 650 604 dependencies = [ 651 605 "getrandom", 652 - "redox_syscall 0.2.16", 606 + "redox_syscall", 653 607 "thiserror", 654 608 ] 655 609 656 610 [[package]] 657 611 name = "rubin" 658 - version = "0.3.2" 612 + version = "0.3.1" 659 613 source = "registry+https://github.com/rust-lang/crates.io-index" 660 - checksum = "3946ce7c6e4cf2c4eb8ab177798cfd0a7f60bc7e54e432fc846300be2357d2c4" 614 + checksum = "42c54f8f7b8a32f0b361d6dab1933f931ea13e533f19cb33c09a6d1e7141d55b" 661 615 dependencies = [ 662 616 "serde", 663 617 "serde_json", ··· 667 621 ] 668 622 669 623 [[package]] 670 - name = "rustc-demangle" 671 - version = "0.1.23" 672 - source = "registry+https://github.com/rust-lang/crates.io-index" 673 - checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" 674 - 675 - [[package]] 676 624 name = "rustix" 677 - version = "0.38.10" 625 + version = "0.37.19" 678 626 source = "registry+https://github.com/rust-lang/crates.io-index" 679 - checksum = "ed6248e1caa625eb708e266e06159f135e8c26f2bb7ceb72dc4b2766d0340964" 627 + checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" 680 628 dependencies = [ 681 - "bitflags 2.4.0", 629 + "bitflags", 682 630 "errno", 631 + "io-lifetimes", 683 632 "libc", 684 633 "linux-raw-sys", 685 - "windows-sys", 634 + "windows-sys 0.48.0", 686 635 ] 687 636 688 637 [[package]] 689 638 name = "ryu" 690 - version = "1.0.15" 639 + version = "1.0.13" 691 640 source = "registry+https://github.com/rust-lang/crates.io-index" 692 - checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" 641 + checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" 693 642 694 643 [[package]] 695 644 name = "safir" 696 - version = "0.9.0" 645 + version = "0.5.0" 697 646 dependencies = [ 698 - "anyhow", 699 647 "clap", 700 - "dirs", 701 - "serde_json", 702 - ] 703 - 704 - [[package]] 705 - name = "safir-core" 706 - version = "0.2.2" 707 - dependencies = [ 708 - "anyhow", 709 - "async-trait", 710 648 "colored", 711 649 "dirs", 712 650 "psutil", ··· 719 657 ] 720 658 721 659 [[package]] 722 - name = "safir-mem" 723 - version = "0.3.1" 724 - dependencies = [ 725 - "anyhow", 726 - "clap", 727 - "safir-core", 728 - "tokio", 729 - ] 730 - 731 - [[package]] 732 660 name = "scopeguard" 733 - version = "1.2.0" 661 + version = "1.1.0" 734 662 source = "registry+https://github.com/rust-lang/crates.io-index" 735 - checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" 663 + checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" 736 664 737 665 [[package]] 738 666 name = "serde" 739 - version = "1.0.188" 667 + version = "1.0.163" 740 668 source = "registry+https://github.com/rust-lang/crates.io-index" 741 - checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" 669 + checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2" 742 670 dependencies = [ 743 671 "serde_derive", 744 672 ] 745 673 746 674 [[package]] 747 675 name = "serde_derive" 748 - version = "1.0.188" 676 + version = "1.0.163" 749 677 source = "registry+https://github.com/rust-lang/crates.io-index" 750 - checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" 678 + checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" 751 679 dependencies = [ 752 680 "proc-macro2", 753 681 "quote", 754 - "syn 2.0.29", 682 + "syn 2.0.18", 755 683 ] 756 684 757 685 [[package]] 758 686 name = "serde_json" 759 - version = "1.0.108" 687 + version = "1.0.96" 760 688 source = "registry+https://github.com/rust-lang/crates.io-index" 761 - checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" 689 + checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" 762 690 dependencies = [ 763 691 "itoa", 764 692 "ryu", ··· 785 713 786 714 [[package]] 787 715 name = "smallvec" 788 - version = "1.11.0" 716 + version = "1.10.0" 789 717 source = "registry+https://github.com/rust-lang/crates.io-index" 790 - checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" 718 + checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" 791 719 792 720 [[package]] 793 721 name = "socket2" 794 - version = "0.5.3" 722 + version = "0.4.9" 795 723 source = "registry+https://github.com/rust-lang/crates.io-index" 796 - checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" 724 + checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" 797 725 dependencies = [ 798 726 "libc", 799 - "windows-sys", 727 + "winapi", 800 728 ] 801 729 802 730 [[package]] ··· 818 746 819 747 [[package]] 820 748 name = "syn" 821 - version = "2.0.29" 749 + version = "2.0.18" 822 750 source = "registry+https://github.com/rust-lang/crates.io-index" 823 - checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a" 751 + checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" 824 752 dependencies = [ 825 753 "proc-macro2", 826 754 "quote", ··· 829 757 830 758 [[package]] 831 759 name = "sysinfo" 832 - version = "0.29.9" 760 + version = "0.29.3" 833 761 source = "registry+https://github.com/rust-lang/crates.io-index" 834 - checksum = "a8d0e9cc2273cc8d31377bdd638d72e3ac3e5607b18621062b169d02787f1bab" 762 + checksum = "5bcd0346f90b6bc83526c7b180039a8acd26a5c848cc556d457f6472eb148122" 835 763 dependencies = [ 836 764 "cfg-if", 837 765 "core-foundation-sys", ··· 844 772 845 773 [[package]] 846 774 name = "thiserror" 847 - version = "1.0.47" 775 + version = "1.0.40" 848 776 source = "registry+https://github.com/rust-lang/crates.io-index" 849 - checksum = "97a802ec30afc17eee47b2855fc72e0c4cd62be9b4efe6591edde0ec5bd68d8f" 777 + checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" 850 778 dependencies = [ 851 779 "thiserror-impl", 852 780 ] 853 781 854 782 [[package]] 855 783 name = "thiserror-impl" 856 - version = "1.0.47" 784 + version = "1.0.40" 857 785 source = "registry+https://github.com/rust-lang/crates.io-index" 858 - checksum = "6bb623b56e39ab7dcd4b1b98bb6c8f8d907ed255b18de254088016b27a8ee19b" 786 + checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" 859 787 dependencies = [ 860 788 "proc-macro2", 861 789 "quote", 862 - "syn 2.0.29", 790 + "syn 2.0.18", 863 791 ] 864 792 865 793 [[package]] ··· 874 802 875 803 [[package]] 876 804 name = "tokio" 877 - version = "1.32.0" 805 + version = "1.28.2" 878 806 source = "registry+https://github.com/rust-lang/crates.io-index" 879 - checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" 807 + checksum = "94d7b1cfd2aa4011f2de74c2c4c63665e27a71006b0a192dcd2710272e73dfa2" 880 808 dependencies = [ 881 - "backtrace", 809 + "autocfg", 882 810 "bytes", 883 811 "libc", 884 812 "mio", ··· 888 816 "signal-hook-registry", 889 817 "socket2", 890 818 "tokio-macros", 891 - "windows-sys", 819 + "windows-sys 0.48.0", 892 820 ] 893 821 894 822 [[package]] ··· 899 827 dependencies = [ 900 828 "proc-macro2", 901 829 "quote", 902 - "syn 2.0.29", 830 + "syn 2.0.18", 903 831 ] 904 832 905 833 [[package]] ··· 922 850 dependencies = [ 923 851 "proc-macro2", 924 852 "quote", 925 - "syn 2.0.29", 853 + "syn 2.0.18", 926 854 ] 927 855 928 856 [[package]] ··· 968 896 969 897 [[package]] 970 898 name = "unicode-ident" 971 - version = "1.0.11" 899 + version = "1.0.9" 972 900 source = "registry+https://github.com/rust-lang/crates.io-index" 973 - checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" 901 + checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" 974 902 975 903 [[package]] 976 904 name = "utf8parse" ··· 1022 950 version = "0.4.0" 1023 951 source = "registry+https://github.com/rust-lang/crates.io-index" 1024 952 checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 953 + 954 + [[package]] 955 + name = "windows-sys" 956 + version = "0.45.0" 957 + source = "registry+https://github.com/rust-lang/crates.io-index" 958 + checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" 959 + dependencies = [ 960 + "windows-targets 0.42.2", 961 + ] 1025 962 1026 963 [[package]] 1027 964 name = "windows-sys" ··· 1029 966 source = "registry+https://github.com/rust-lang/crates.io-index" 1030 967 checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" 1031 968 dependencies = [ 1032 - "windows-targets", 969 + "windows-targets 0.48.0", 970 + ] 971 + 972 + [[package]] 973 + name = "windows-targets" 974 + version = "0.42.2" 975 + source = "registry+https://github.com/rust-lang/crates.io-index" 976 + checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" 977 + dependencies = [ 978 + "windows_aarch64_gnullvm 0.42.2", 979 + "windows_aarch64_msvc 0.42.2", 980 + "windows_i686_gnu 0.42.2", 981 + "windows_i686_msvc 0.42.2", 982 + "windows_x86_64_gnu 0.42.2", 983 + "windows_x86_64_gnullvm 0.42.2", 984 + "windows_x86_64_msvc 0.42.2", 1033 985 ] 1034 986 1035 987 [[package]] 1036 988 name = "windows-targets" 1037 - version = "0.48.5" 989 + version = "0.48.0" 1038 990 source = "registry+https://github.com/rust-lang/crates.io-index" 1039 - checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" 991 + checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" 1040 992 dependencies = [ 1041 - "windows_aarch64_gnullvm", 1042 - "windows_aarch64_msvc", 1043 - "windows_i686_gnu", 1044 - "windows_i686_msvc", 1045 - "windows_x86_64_gnu", 1046 - "windows_x86_64_gnullvm", 1047 - "windows_x86_64_msvc", 993 + "windows_aarch64_gnullvm 0.48.0", 994 + "windows_aarch64_msvc 0.48.0", 995 + "windows_i686_gnu 0.48.0", 996 + "windows_i686_msvc 0.48.0", 997 + "windows_x86_64_gnu 0.48.0", 998 + "windows_x86_64_gnullvm 0.48.0", 999 + "windows_x86_64_msvc 0.48.0", 1048 1000 ] 1049 1001 1050 1002 [[package]] 1051 1003 name = "windows_aarch64_gnullvm" 1052 - version = "0.48.5" 1004 + version = "0.42.2" 1005 + source = "registry+https://github.com/rust-lang/crates.io-index" 1006 + checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" 1007 + 1008 + [[package]] 1009 + name = "windows_aarch64_gnullvm" 1010 + version = "0.48.0" 1011 + source = "registry+https://github.com/rust-lang/crates.io-index" 1012 + checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" 1013 + 1014 + [[package]] 1015 + name = "windows_aarch64_msvc" 1016 + version = "0.42.2" 1053 1017 source = "registry+https://github.com/rust-lang/crates.io-index" 1054 - checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" 1018 + checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" 1055 1019 1056 1020 [[package]] 1057 1021 name = "windows_aarch64_msvc" 1058 - version = "0.48.5" 1022 + version = "0.48.0" 1059 1023 source = "registry+https://github.com/rust-lang/crates.io-index" 1060 - checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" 1024 + checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" 1061 1025 1062 1026 [[package]] 1063 1027 name = "windows_i686_gnu" 1064 - version = "0.48.5" 1028 + version = "0.42.2" 1065 1029 source = "registry+https://github.com/rust-lang/crates.io-index" 1066 - checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" 1030 + checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" 1031 + 1032 + [[package]] 1033 + name = "windows_i686_gnu" 1034 + version = "0.48.0" 1035 + source = "registry+https://github.com/rust-lang/crates.io-index" 1036 + checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" 1067 1037 1068 1038 [[package]] 1069 1039 name = "windows_i686_msvc" 1070 - version = "0.48.5" 1040 + version = "0.42.2" 1041 + source = "registry+https://github.com/rust-lang/crates.io-index" 1042 + checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" 1043 + 1044 + [[package]] 1045 + name = "windows_i686_msvc" 1046 + version = "0.48.0" 1071 1047 source = "registry+https://github.com/rust-lang/crates.io-index" 1072 - checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" 1048 + checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" 1073 1049 1074 1050 [[package]] 1075 1051 name = "windows_x86_64_gnu" 1076 - version = "0.48.5" 1052 + version = "0.42.2" 1053 + source = "registry+https://github.com/rust-lang/crates.io-index" 1054 + checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" 1055 + 1056 + [[package]] 1057 + name = "windows_x86_64_gnu" 1058 + version = "0.48.0" 1077 1059 source = "registry+https://github.com/rust-lang/crates.io-index" 1078 - checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" 1060 + checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" 1079 1061 1080 1062 [[package]] 1081 1063 name = "windows_x86_64_gnullvm" 1082 - version = "0.48.5" 1064 + version = "0.42.2" 1083 1065 source = "registry+https://github.com/rust-lang/crates.io-index" 1084 - checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" 1066 + checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" 1067 + 1068 + [[package]] 1069 + name = "windows_x86_64_gnullvm" 1070 + version = "0.48.0" 1071 + source = "registry+https://github.com/rust-lang/crates.io-index" 1072 + checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" 1085 1073 1086 1074 [[package]] 1087 1075 name = "windows_x86_64_msvc" 1088 - version = "0.48.5" 1076 + version = "0.42.2" 1077 + source = "registry+https://github.com/rust-lang/crates.io-index" 1078 + checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" 1079 + 1080 + [[package]] 1081 + name = "windows_x86_64_msvc" 1082 + version = "0.48.0" 1089 1083 source = "registry+https://github.com/rust-lang/crates.io-index" 1090 - checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" 1084 + checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a"
+18 -3
Cargo.toml
··· 1 - [workspace] 2 - members = ["safir", "safir-mem", "safir-core"] 3 - resolver = "2" 1 + [package] 2 + name = "safir" 3 + version = "0.9.0" 4 + edition = "2021" 5 + authors = ["Graham Keenan graham.keenan@outlook.com"] 6 + license = "MIT OR Apache-2.0" 7 + description = "Key/Value store to share values between different shell sessions" 8 + readme = "README.md" 9 + homepage = "https://github.com/Tyrannican/safir" 10 + repository = "https://github.com/Tyrannican/safir" 11 + keywords = ["cli", "terminal", "utility", "key-value", "store"] 12 + categories = ["command-line-utilities"] 13 + 14 + [dependencies] 15 + clap = { version = "4.2.5" , features = ["derive"] } 16 + anyhow = "1.0.75" 17 + dirs = "5.0.1" 18 + serde_json = "1.0.108"
+101 -4
README.md
··· 1 1 # Safir 2 2 3 - Repo containing the source for `safir` and `safir-mem`. 3 + Simple CLI key/value store. 4 + 5 + Store key/value pairs in the terminal and retrieve them later for use like in different shell sessions. 6 + 7 + ## Install 8 + 9 + To install `safir`, run `cargo install safir`. 10 + 11 + To build from source, clone the repository and run: 12 + 13 + ```bash 14 + cargo build --release 15 + ``` 16 + 17 + Then move the binary to somewhere in your `$PATH` 18 + 19 + ## Usage 20 + 21 + When `safir` is run, it creates a store file in your `$HOME` directory (`$HOME/.safirstore/safirstore.json`). 22 + 23 + Run `safir --help` for usage: 24 + 25 + ```bash 26 + Key/Value store to share information between shell sessions 27 + 28 + Usage: safir <COMMAND> 29 + 30 + Commands: 31 + add Add a value to the store with the given key 32 + get Get values from the store 33 + rm Remove values from the store 34 + alias Output the alias command for key / value pairs 35 + export Output the export command for a key / value pairs 36 + list List all values in the store 37 + clear Clear all keys/values from the store 38 + purge Purges the .safirstore directory, removing it and its contents 39 + help Print this message or the help of the given subcommand(s) 40 + 41 + Options: 42 + -h, --help Print help 43 + -V, --version Print version 44 + ``` 45 + 46 + ## Examples 47 + 48 + Adding a key and value to the store: 49 + 50 + ```bash 51 + safir add api_key "api_key_value" 52 + ``` 53 + 54 + Retrieving a value from the store: 55 + 56 + ```bash 57 + safir get api_key 58 + # api_key="api_key_value" 59 + ``` 60 + 61 + Removing a value from the store: 4 62 5 - :warning: `safir-mem` and `safir-core` are NO LONGER MAINTAINED :warning: 63 + ```bash 64 + safir rm api_key 65 + ``` 6 66 7 - They will stay part of the repo for backward usage but the `safir` project has been reworked and brought back to its roots. 8 - Everything now lives in the `safir` project. 67 + List all values in the store: 68 + 69 + ```bash 70 + safir list 71 + 72 + # api_key="api_key_value" 73 + # another_api_key="another_value" 74 + ``` 75 + 76 + Exporting a value: 77 + 78 + ```bash 79 + safir export api_key 80 + # export api_key="api_key_value" 81 + 82 + $(safir export api_key) # <-- Will export the value to the current shell 83 + ``` 84 + 85 + Aliasing a value: 86 + 87 + ```bash 88 + safir alias long_command 89 + # alias long_command="cd build/ && make && sudo make install" 90 + 91 + $(safir alias long_command) # <-- Will alias the command in the current shell 92 + ``` 93 + 94 + Clear the store: 95 + 96 + ```bash 97 + safir clear 98 + # Will remove all contents in the store 99 + ``` 100 + 101 + Purge the store (remove EVERYTHING `safir` related) 102 + 103 + ```bash 104 + safir purge # Will remove the .safirstore directory 105 + ```
-25
safir-core/Cargo.toml
··· 1 - [package] 2 - name = "safir-core" 3 - version = "0.2.2" 4 - edition = "2021" 5 - description = "Internal lib used to build Safir and Safir-mem" 6 - authors = ["Graham Keenan graham.keenan@outlook.com"] 7 - license = "MIT OR Apache-2.0" 8 - readme = "README.md" 9 - homepage = "https://github.com/Tyrannican/safir" 10 - repository = "https://github.com/Tyrannican/safir" 11 - keywords = ["terminal", "utility", "key-value", "store", "library"] 12 - categories = ["command-line-interface"] 13 - 14 - [dependencies] 15 - anyhow = "1.0.75" 16 - async-trait = "0.1.73" 17 - colored = "2.0.4" 18 - dirs = "5.0.1" 19 - psutil = "3.2.2" 20 - rubin = "0.3.2" 21 - serde = { version = "1.0.188", features = ["derive"] } 22 - serde_json = "1.0.105" 23 - sysinfo = "0.29.9" 24 - tokio = { version = "1.32.0", features = ["full"] } 25 - which = "4.4.0"
-201
safir-core/LICENSE-APACHE
··· 1 - Apache License 2 - Version 2.0, January 2004 3 - http://www.apache.org/licenses/ 4 - 5 - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 - 7 - 1. Definitions. 8 - 9 - "License" shall mean the terms and conditions for use, reproduction, 10 - and distribution as defined by Sections 1 through 9 of this document. 11 - 12 - "Licensor" shall mean the copyright owner or entity authorized by 13 - the copyright owner that is granting the License. 14 - 15 - "Legal Entity" shall mean the union of the acting entity and all 16 - other entities that control, are controlled by, or are under common 17 - control with that entity. For the purposes of this definition, 18 - "control" means (i) the power, direct or indirect, to cause the 19 - direction or management of such entity, whether by contract or 20 - otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 - outstanding shares, or (iii) beneficial ownership of such entity. 22 - 23 - "You" (or "Your") shall mean an individual or Legal Entity 24 - exercising permissions granted by this License. 25 - 26 - "Source" form shall mean the preferred form for making modifications, 27 - including but not limited to software source code, documentation 28 - source, and configuration files. 29 - 30 - "Object" form shall mean any form resulting from mechanical 31 - transformation or translation of a Source form, including but 32 - not limited to compiled object code, generated documentation, 33 - and conversions to other media types. 34 - 35 - "Work" shall mean the work of authorship, whether in Source or 36 - Object form, made available under the License, as indicated by a 37 - copyright notice that is included in or attached to the work 38 - (an example is provided in the Appendix below). 39 - 40 - "Derivative Works" shall mean any work, whether in Source or Object 41 - form, that is based on (or derived from) the Work and for which the 42 - editorial revisions, annotations, elaborations, or other modifications 43 - represent, as a whole, an original work of authorship. For the purposes 44 - of this License, Derivative Works shall not include works that remain 45 - separable from, or merely link (or bind by name) to the interfaces of, 46 - the Work and Derivative Works thereof. 47 - 48 - "Contribution" shall mean any work of authorship, including 49 - the original version of the Work and any modifications or additions 50 - to that Work or Derivative Works thereof, that is intentionally 51 - submitted to Licensor for inclusion in the Work by the copyright owner 52 - or by an individual or Legal Entity authorized to submit on behalf of 53 - the copyright owner. For the purposes of this definition, "submitted" 54 - means any form of electronic, verbal, or written communication sent 55 - to the Licensor or its representatives, including but not limited to 56 - communication on electronic mailing lists, source code control systems, 57 - and issue tracking systems that are managed by, or on behalf of, the 58 - Licensor for the purpose of discussing and improving the Work, but 59 - excluding communication that is conspicuously marked or otherwise 60 - designated in writing by the copyright owner as "Not a Contribution." 61 - 62 - "Contributor" shall mean Licensor and any individual or Legal Entity 63 - on behalf of whom a Contribution has been received by Licensor and 64 - subsequently incorporated within the Work. 65 - 66 - 2. Grant of Copyright License. Subject to the terms and conditions of 67 - this License, each Contributor hereby grants to You a perpetual, 68 - worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 - copyright license to reproduce, prepare Derivative Works of, 70 - publicly display, publicly perform, sublicense, and distribute the 71 - Work and such Derivative Works in Source or Object form. 72 - 73 - 3. Grant of Patent License. Subject to the terms and conditions of 74 - this License, each Contributor hereby grants to You a perpetual, 75 - worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 - (except as stated in this section) patent license to make, have made, 77 - use, offer to sell, sell, import, and otherwise transfer the Work, 78 - where such license applies only to those patent claims licensable 79 - by such Contributor that are necessarily infringed by their 80 - Contribution(s) alone or by combination of their Contribution(s) 81 - with the Work to which such Contribution(s) was submitted. If You 82 - institute patent litigation against any entity (including a 83 - cross-claim or counterclaim in a lawsuit) alleging that the Work 84 - or a Contribution incorporated within the Work constitutes direct 85 - or contributory patent infringement, then any patent licenses 86 - granted to You under this License for that Work shall terminate 87 - as of the date such litigation is filed. 88 - 89 - 4. Redistribution. You may reproduce and distribute copies of the 90 - Work or Derivative Works thereof in any medium, with or without 91 - modifications, and in Source or Object form, provided that You 92 - meet the following conditions: 93 - 94 - (a) You must give any other recipients of the Work or 95 - Derivative Works a copy of this License; and 96 - 97 - (b) You must cause any modified files to carry prominent notices 98 - stating that You changed the files; and 99 - 100 - (c) You must retain, in the Source form of any Derivative Works 101 - that You distribute, all copyright, patent, trademark, and 102 - attribution notices from the Source form of the Work, 103 - excluding those notices that do not pertain to any part of 104 - the Derivative Works; and 105 - 106 - (d) If the Work includes a "NOTICE" text file as part of its 107 - distribution, then any Derivative Works that You distribute must 108 - include a readable copy of the attribution notices contained 109 - within such NOTICE file, excluding those notices that do not 110 - pertain to any part of the Derivative Works, in at least one 111 - of the following places: within a NOTICE text file distributed 112 - as part of the Derivative Works; within the Source form or 113 - documentation, if provided along with the Derivative Works; or, 114 - within a display generated by the Derivative Works, if and 115 - wherever such third-party notices normally appear. The contents 116 - of the NOTICE file are for informational purposes only and 117 - do not modify the License. You may add Your own attribution 118 - notices within Derivative Works that You distribute, alongside 119 - or as an addendum to the NOTICE text from the Work, provided 120 - that such additional attribution notices cannot be construed 121 - as modifying the License. 122 - 123 - You may add Your own copyright statement to Your modifications and 124 - may provide additional or different license terms and conditions 125 - for use, reproduction, or distribution of Your modifications, or 126 - for any such Derivative Works as a whole, provided Your use, 127 - reproduction, and distribution of the Work otherwise complies with 128 - the conditions stated in this License. 129 - 130 - 5. Submission of Contributions. Unless You explicitly state otherwise, 131 - any Contribution intentionally submitted for inclusion in the Work 132 - by You to the Licensor shall be under the terms and conditions of 133 - this License, without any additional terms or conditions. 134 - Notwithstanding the above, nothing herein shall supersede or modify 135 - the terms of any separate license agreement you may have executed 136 - with Licensor regarding such Contributions. 137 - 138 - 6. Trademarks. This License does not grant permission to use the trade 139 - names, trademarks, service marks, or product names of the Licensor, 140 - except as required for reasonable and customary use in describing the 141 - origin of the Work and reproducing the content of the NOTICE file. 142 - 143 - 7. Disclaimer of Warranty. Unless required by applicable law or 144 - agreed to in writing, Licensor provides the Work (and each 145 - Contributor provides its Contributions) on an "AS IS" BASIS, 146 - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 - implied, including, without limitation, any warranties or conditions 148 - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 - PARTICULAR PURPOSE. You are solely responsible for determining the 150 - appropriateness of using or redistributing the Work and assume any 151 - risks associated with Your exercise of permissions under this License. 152 - 153 - 8. Limitation of Liability. In no event and under no legal theory, 154 - whether in tort (including negligence), contract, or otherwise, 155 - unless required by applicable law (such as deliberate and grossly 156 - negligent acts) or agreed to in writing, shall any Contributor be 157 - liable to You for damages, including any direct, indirect, special, 158 - incidental, or consequential damages of any character arising as a 159 - result of this License or out of the use or inability to use the 160 - Work (including but not limited to damages for loss of goodwill, 161 - work stoppage, computer failure or malfunction, or any and all 162 - other commercial damages or losses), even if such Contributor 163 - has been advised of the possibility of such damages. 164 - 165 - 9. Accepting Warranty or Additional Liability. While redistributing 166 - the Work or Derivative Works thereof, You may choose to offer, 167 - and charge a fee for, acceptance of support, warranty, indemnity, 168 - or other liability obligations and/or rights consistent with this 169 - License. However, in accepting such obligations, You may act only 170 - on Your own behalf and on Your sole responsibility, not on behalf 171 - of any other Contributor, and only if You agree to indemnify, 172 - defend, and hold each Contributor harmless for any liability 173 - incurred by, or claims asserted against, such Contributor by reason 174 - of your accepting any such warranty or additional liability. 175 - 176 - END OF TERMS AND CONDITIONS 177 - 178 - APPENDIX: How to apply the Apache License to your work. 179 - 180 - To apply the Apache License to your work, attach the following 181 - boilerplate notice, with the fields enclosed by brackets "[]" 182 - replaced with your own identifying information. (Don't include 183 - the brackets!) The text should be enclosed in the appropriate 184 - comment syntax for the file format. We also recommend that a 185 - file or class name and description of purpose be included on the 186 - same "printed page" as the copyright notice for easier 187 - identification within third-party archives. 188 - 189 - Copyright [yyyy] [name of copyright owner] 190 - 191 - Licensed under the Apache License, Version 2.0 (the "License"); 192 - you may not use this file except in compliance with the License. 193 - You may obtain a copy of the License at 194 - 195 - http://www.apache.org/licenses/LICENSE-2.0 196 - 197 - Unless required by applicable law or agreed to in writing, software 198 - distributed under the License is distributed on an "AS IS" BASIS, 199 - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 - See the License for the specific language governing permissions and 201 - limitations under the License.
-21
safir-core/LICENSE-MIT
··· 1 - MIT License 2 - 3 - Copyright (c) 2023 Graham Keenan 4 - 5 - Permission is hereby granted, free of charge, to any person obtaining a copy 6 - of this software and associated documentation files (the "Software"), to deal 7 - in the Software without restriction, including without limitation the rights 8 - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 - copies of the Software, and to permit persons to whom the Software is 10 - furnished to do so, subject to the following conditions: 11 - 12 - The above copyright notice and this permission notice shall be included in all 13 - copies or substantial portions of the Software. 14 - 15 - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 - SOFTWARE.
-12
safir-core/README.md
··· 1 - # Safir Core 2 - 3 - ## Notice 4 - 5 - :warning: This is now archived and no longer updated :warning: 6 - 7 - It was ambitious (and worked kinda) but became far too unweildy and complicated when it didn't have to. 8 - Maybe a rewrite in the future but for now, it's now archived. 9 - 10 - Internal library used by `safir` and `safir-mem` found [here](https://github.com/Tyrannican/safir) 11 - 12 - Not intended for public use unless you want to contribute!
-53
safir-core/src/config.rs
··· 1 - use serde::{Deserialize, Serialize}; 2 - use std::{ 3 - io::Result, 4 - path::{Path, PathBuf}, 5 - }; 6 - use tokio::{fs, io::AsyncWriteExt}; 7 - 8 - #[derive(Default, Serialize, Deserialize, Debug)] 9 - pub struct SafirConfig { 10 - #[serde(skip)] 11 - pub root_path: PathBuf, 12 - #[serde(skip)] 13 - pub config_path: PathBuf, 14 - pub memcache_pid: Option<u32>, 15 - pub headless_mode: Option<bool>, 16 - } 17 - 18 - impl SafirConfig { 19 - pub fn new() -> Self { 20 - let mut cfg = Self::default(); 21 - cfg.headless_mode = Some(false); 22 - cfg 23 - } 24 - 25 - pub async fn load(cfg_path: impl AsRef<Path>) -> Result<Self> { 26 - let cfg_str = fs::read_to_string(cfg_path).await?; 27 - let mut cfg: SafirConfig = 28 - serde_json::from_str(&cfg_str).expect("unable to deserialize safir config"); 29 - 30 - // Backwards compat with older Safir configs 31 - if cfg.headless_mode.is_none() { 32 - cfg.headless_mode = Some(false); 33 - } 34 - 35 - Ok(cfg) 36 - } 37 - 38 - pub async fn write(&self) -> Result<()> { 39 - let data = serde_json::to_string_pretty(&self).expect("unable to serialize safir config"); 40 - let mut file = fs::File::create(&self.config_path).await?; 41 - file.write_all(data.as_bytes()).await?; 42 - 43 - Ok(()) 44 - } 45 - 46 - pub fn get_headless_mode(&self) -> bool { 47 - if self.headless_mode.is_some() { 48 - self.headless_mode.unwrap() 49 - } else { 50 - false 51 - } 52 - } 53 - }
-156
safir-core/src/disk.rs
··· 1 - //! Safir handles the logic of writing key/value pairs to disk 2 - //! 3 - //! Provides a simple wrapper around a Hash Map which stores values with given keys 4 - //! to a JSON file on disk so that you can load them up in other shell sessions. 5 - //! 6 - //! Prevents the faff around having to add rely on shell history or RC files for items 7 - //! that you don't usually want to persist around. 8 - //! 9 - //! Safir gives you the option to add / get / remove items from the store 10 - //! and to clear / purge when you're finished with them. 11 - use anyhow::Result; 12 - 13 - use async_trait::async_trait; 14 - use colored::*; 15 - 16 - use crate::config::SafirConfig; 17 - use crate::utils::{confirm_entry, print_header, print_headless, print_output}; 18 - use crate::SafirEngine; 19 - use rubin::store::persistence::PersistentStore; 20 - 21 - /// Safir Store (fancy wrapper around reading and writing to a JSON file) 22 - pub struct SafirStore { 23 - pub store: PersistentStore, 24 - pub headless: bool, 25 - } 26 - 27 - impl SafirStore { 28 - /// Initialises the Safirstore if not already initialised 29 - pub async fn new(config: &SafirConfig) -> Result<Self> { 30 - let store_path = config.root_path.join("safirstore.json"); 31 - let mut ps = if store_path.exists() { 32 - PersistentStore::from_existing(store_path).await? 33 - } else { 34 - PersistentStore::new(store_path).await? 35 - }; 36 - 37 - ps.set_write_on_update(true); 38 - let headless = config.get_headless_mode(); 39 - 40 - Ok(Self { 41 - store: ps, 42 - headless, 43 - }) 44 - } 45 - 46 - /// Display all key/values in the store 47 - pub fn display_all(&self) { 48 - let strings = self.store.get_string_store_ref(); 49 - if self.headless { 50 - for (key, value) in strings.iter() { 51 - print_headless("", key, value); 52 - } 53 - 54 - return; 55 - } 56 - 57 - print_header(); 58 - let mut output: String; 59 - for (key, value) in strings.iter() { 60 - output = format!("{}: \"{}\"", key.bold().yellow(), value); 61 - print_output(&output); 62 - } 63 - } 64 - 65 - /// Remove the store directory and all contents 66 - pub fn purge(&self) { 67 - if confirm_entry("Are you sure you want to purge Safirstore?") { 68 - std::fs::remove_dir_all(&self.store.path) 69 - .expect("unable to remove safirstore directory"); 70 - } 71 - } 72 - } 73 - 74 - #[async_trait] 75 - impl SafirEngine for SafirStore { 76 - /// Add an entry to the store and write it out to disk 77 - async fn add_entry(&mut self, key: String, value: String) -> Result<()> { 78 - self.store.insert_string(&key, &value).await?; 79 - Ok(()) 80 - } 81 - 82 - /// Get an entry form the store by loading it from disk and displaying it 83 - async fn get_entry(&self, key: String) -> Result<()> { 84 - let value = if let Ok(val) = self.store.get_string(&key) { 85 - val 86 - } else { 87 - String::from("") 88 - }; 89 - 90 - if self.headless { 91 - print_headless("", &key, &value); 92 - return Ok(()); 93 - } 94 - 95 - print_header(); 96 - let output = if !value.is_empty() { 97 - format!("{}: \"{}\"", key.bold().yellow(), value) 98 - } else { 99 - format!("{}: ", key.bold().yellow()) 100 - }; 101 - 102 - print_output(&output); 103 - 104 - Ok(()) 105 - } 106 - 107 - /// Remove a key/value pair from the store and update onto disk 108 - async fn remove_entry(&mut self, keys: Vec<String>) -> Result<()> { 109 - for key in &keys { 110 - self.store.remove_string(key).await?; 111 - } 112 - 113 - Ok(()) 114 - } 115 - 116 - /// Outputs the key/value pair as a command with the prefix 117 - /// 118 - /// E.g. With a prefix of `alias` this will display the command as 119 - /// `alias {key}="{value}"` with {key} / {value} replaced with their values from the store 120 - async fn set_commands(&mut self, prefix: &str, keys: &Vec<String>) { 121 - if self.headless { 122 - for key in keys { 123 - if let Ok(value) = self.store.get_string(key) { 124 - print_headless(prefix, key, &value); 125 - } 126 - } 127 - 128 - return; 129 - } 130 - 131 - print_header(); 132 - let prefix = match prefix { 133 - "alias" => "alias".bold().green(), 134 - "export" => "export".bold().magenta(), 135 - _ => prefix.bold(), 136 - }; 137 - for key in keys { 138 - if let Ok(value) = self.store.get_string(key) { 139 - println!("{} {}=\"{}\"\n", prefix, key.bold().yellow(), value); 140 - } 141 - } 142 - } 143 - 144 - /// Clear the the contents of the store and update onto disk 145 - async fn clear_entries(&mut self) -> Result<()> { 146 - if confirm_entry("Are you sure you want to clear the store?") { 147 - self.store.clear_strings().await?; 148 - } 149 - 150 - Ok(()) 151 - } 152 - 153 - fn to_type(&self) -> &dyn std::any::Any { 154 - self 155 - } 156 - }
-93
safir-core/src/lib.rs
··· 1 - pub mod config; 2 - pub mod disk; 3 - pub mod mem; 4 - pub mod utils; 5 - 6 - use anyhow::Result; 7 - use async_trait::async_trait; 8 - use std::any::Any; 9 - 10 - use config::SafirConfig; 11 - use disk::SafirStore; 12 - use mem::SafirMemcache; 13 - 14 - #[derive(Debug, PartialEq)] 15 - pub enum SafirEngineType { 16 - Store, 17 - Memcache, 18 - } 19 - 20 - #[async_trait] 21 - pub trait SafirEngine { 22 - async fn add_entry(&mut self, key: String, value: String) -> Result<()>; 23 - async fn get_entry(&self, key: String) -> Result<()>; 24 - async fn remove_entry(&mut self, keys: Vec<String>) -> Result<()>; 25 - async fn clear_entries(&mut self) -> Result<()>; 26 - async fn set_commands(&mut self, prefix: &str, keys: &Vec<String>); 27 - fn to_type(&self) -> &dyn Any; 28 - } 29 - 30 - pub struct Safir { 31 - pub engine: Box<dyn SafirEngine>, 32 - pub config: SafirConfig, 33 - } 34 - 35 - impl Safir { 36 - pub async fn new(engine_type: SafirEngineType) -> Result<Self> { 37 - let config = utils::init().await?; 38 - match engine_type { 39 - SafirEngineType::Store => { 40 - let e = crate::disk::SafirStore::new(&config).await?; 41 - Ok(Self { 42 - engine: Box::new(e), 43 - config, 44 - }) 45 - } 46 - SafirEngineType::Memcache => { 47 - let e = crate::mem::SafirMemcache::new(&config).await?; 48 - Ok(Self { 49 - engine: Box::new(e), 50 - config, 51 - }) 52 - } 53 - } 54 - } 55 - 56 - pub async fn add_entry(&mut self, key: String, value: String) -> Result<()> { 57 - self.engine.add_entry(key, value).await?; 58 - Ok(()) 59 - } 60 - 61 - pub async fn get_entry(&self, key: String) -> Result<()> { 62 - self.engine.get_entry(key).await?; 63 - Ok(()) 64 - } 65 - 66 - pub async fn remove_entry(&mut self, keys: Vec<String>) -> Result<()> { 67 - self.engine.remove_entry(keys).await?; 68 - Ok(()) 69 - } 70 - 71 - pub async fn clear_entries(&mut self) -> Result<()> { 72 - self.engine.clear_entries().await?; 73 - Ok(()) 74 - } 75 - 76 - pub async fn set_commands(&mut self, prefix: &str, keys: &Vec<String>) { 77 - self.engine.set_commands(prefix, keys).await; 78 - } 79 - 80 - pub fn as_safir_store(&self) -> &SafirStore { 81 - self.engine 82 - .to_type() 83 - .downcast_ref::<SafirStore>() 84 - .expect("unable to get Safir store type") 85 - } 86 - 87 - pub fn as_safir_memcache(&self) -> &SafirMemcache { 88 - self.engine 89 - .to_type() 90 - .downcast_ref::<SafirMemcache>() 91 - .expect("unable to get Safir memcache type") 92 - } 93 - }
-113
safir-core/src/mem.rs
··· 1 - use anyhow::Result; 2 - 3 - use async_trait::async_trait; 4 - 5 - use crate::config::SafirConfig; 6 - use crate::utils::{self, confirm_entry, print_headless}; 7 - use crate::SafirEngine; 8 - use rubin::net::client::RubinClient; 9 - 10 - fn safir_offline() { 11 - eprintln!( 12 - "Safir Memcache does not appear to be online.\nStart it by running `safir-mem start`." 13 - ); 14 - } 15 - 16 - pub struct SafirMemcache { 17 - is_online: bool, 18 - client: RubinClient, 19 - } 20 - 21 - impl SafirMemcache { 22 - pub async fn new(cfg: &SafirConfig) -> Result<Self> { 23 - Ok(Self { 24 - is_online: utils::is_safir_running(cfg.memcache_pid), 25 - client: RubinClient::new("127.0.0.1", 9876), 26 - }) 27 - } 28 - 29 - pub async fn dump_store(&self, path: &str) -> Result<()> { 30 - if !self.is_online { 31 - safir_offline(); 32 - return Ok(()); 33 - } 34 - 35 - self.client.dump_store(path).await?; 36 - println!("Safir memcache dumped to {}", path); 37 - 38 - Ok(()) 39 - } 40 - } 41 - 42 - #[async_trait] 43 - impl SafirEngine for SafirMemcache { 44 - async fn add_entry(&mut self, key: String, value: String) -> Result<()> { 45 - if !self.is_online { 46 - safir_offline(); 47 - return Ok(()); 48 - } 49 - 50 - self.client.insert_string(&key, &value).await?; 51 - Ok(()) 52 - } 53 - 54 - async fn get_entry(&self, key: String) -> Result<()> { 55 - if !self.is_online { 56 - safir_offline(); 57 - return Ok(()); 58 - } 59 - 60 - let value = if let Ok(val) = self.client.get_string(&key).await { 61 - val 62 - } else { 63 - String::from("") 64 - }; 65 - 66 - print_headless("", &key, &value); 67 - 68 - Ok(()) 69 - } 70 - 71 - async fn remove_entry(&mut self, keys: Vec<String>) -> Result<()> { 72 - if !self.is_online { 73 - safir_offline(); 74 - return Ok(()); 75 - } 76 - 77 - for key in &keys { 78 - self.client.remove_string(key).await?; 79 - } 80 - 81 - Ok(()) 82 - } 83 - 84 - async fn set_commands(&mut self, prefix: &str, keys: &Vec<String>) { 85 - if !self.is_online { 86 - safir_offline(); 87 - return; 88 - } 89 - 90 - for key in keys { 91 - if let Ok(value) = self.client.get_string(key).await { 92 - print_headless(prefix, key, &value); 93 - } 94 - } 95 - } 96 - 97 - async fn clear_entries(&mut self) -> Result<()> { 98 - if !self.is_online { 99 - safir_offline(); 100 - return Ok(()); 101 - } 102 - 103 - if confirm_entry("Are you sure you want to clear the store?") { 104 - self.client.clear_strings().await?; 105 - } 106 - 107 - Ok(()) 108 - } 109 - 110 - fn to_type(&self) -> &dyn std::any::Any { 111 - self 112 - } 113 - }
-150
safir-core/src/utils.rs
··· 1 - use anyhow::Result; 2 - use std::io::Write; 3 - use std::path::{Path, PathBuf}; 4 - 5 - use crate::config::SafirConfig; 6 - 7 - use colored::*; 8 - use sysinfo::{Pid, System, SystemExt}; 9 - use tokio::fs; 10 - 11 - pub async fn init() -> Result<SafirConfig> { 12 - let store_dir = create_safir_directory().await?; 13 - let cfg = load_safir_config(&store_dir).await?; 14 - Ok(cfg) 15 - } 16 - 17 - pub fn check_rubin_installed() -> bool { 18 - if which::which("rubin").is_ok() { 19 - return true; 20 - } 21 - 22 - false 23 - } 24 - 25 - pub fn check_process_running(pid: u32) -> bool { 26 - let mut system = System::new_all(); 27 - system.refresh_all(); 28 - if system.process(Pid::from(pid as usize)).is_some() { 29 - return true; 30 - } 31 - 32 - false 33 - } 34 - 35 - pub fn is_safir_running(pid: Option<u32>) -> bool { 36 - match pid { 37 - Some(pid) => check_process_running(pid), 38 - None => false, 39 - } 40 - } 41 - 42 - pub async fn path_exists(path: impl AsRef<Path>) -> bool { 43 - path.as_ref().exists() 44 - } 45 - 46 - pub async fn create_safir_directory() -> Result<PathBuf> { 47 - let home_dir = dirs::home_dir().unwrap(); 48 - let store_path = home_dir.join(".safirstore"); 49 - fs::create_dir_all(&store_path).await?; 50 - 51 - Ok(store_path) 52 - } 53 - 54 - #[cfg(target_family = "unix")] 55 - pub async fn kill_process(pid: u32) -> Result<()> { 56 - if let Ok(process) = psutil::process::Process::new(pid) { 57 - if let Err(err) = process.kill() { 58 - eprintln!("failed to kill process: {}", err); 59 - } 60 - } else { 61 - eprintln!("failed to get process information"); 62 - } 63 - 64 - Ok(()) 65 - } 66 - 67 - #[cfg(target_os = "windows")] 68 - pub async fn kill_process(pid: u32) { 69 - println!("*** Windows -- This is experimental and may not work as intended! ***"); 70 - let output = Command::new("taskkill") 71 - .arg("/F") 72 - .arg("/PID") 73 - .arg(pid.to_string()) 74 - .output() 75 - .expect("failed to call taskkill"); 76 - 77 - if !output.status.success() { 78 - eprintln!("failed to terminate process"); 79 - } 80 - } 81 - 82 - /// Formats and prints the message to stdout 83 - pub fn print_output(msg: &str) { 84 - println!("{}\n", msg); 85 - } 86 - 87 - /// Prints the Safirstore header 88 - pub fn print_header() { 89 - println!("{}", "--=Safirstore=--\n".bold()); 90 - } 91 - 92 - pub fn print_headless(prefix: &str, key: &str, value: &str) { 93 - if value == "" { 94 - return; 95 - } 96 - 97 - let has_whitespace = value.contains(char::is_whitespace); 98 - 99 - let output = if has_whitespace { 100 - format!("{}=\"{}\"", key, value) 101 - } else { 102 - format!("{}={}", key, value) 103 - }; 104 - 105 - if !prefix.is_empty() { 106 - println!("{} {}", prefix, output); 107 - } else { 108 - println!("{}", output); 109 - } 110 - } 111 - 112 - /// Confirmation dialog for important calls 113 - pub fn confirm_entry(msg: &str) -> bool { 114 - let mut answer = String::new(); 115 - print!("{} (y/n) ", msg); 116 - std::io::stdout().flush().expect("failed to flush buffer"); 117 - 118 - let _ = std::io::stdin() 119 - .read_line(&mut answer) 120 - .expect("unable to get input from user"); 121 - 122 - let answer = answer.trim().to_lowercase(); 123 - if answer == "y" || answer == "yes" { 124 - return true; 125 - } 126 - 127 - false 128 - } 129 - 130 - pub async fn load_safir_config(store_dir: impl AsRef<Path>) -> Result<SafirConfig> { 131 - let cfg_path = &store_dir.as_ref().join("safir.cfg"); 132 - let mut cfg = if path_exists(&cfg_path).await { 133 - SafirConfig::load(&cfg_path).await? 134 - } else { 135 - SafirConfig::new() 136 - }; 137 - 138 - cfg.root_path = store_dir.as_ref().to_owned(); 139 - cfg.config_path = cfg_path.to_owned(); 140 - 141 - // Used in cases where the process has ended ungracefully and the config hasnt been updated 142 - if let Some(pid) = cfg.memcache_pid { 143 - if !check_process_running(pid) { 144 - cfg = SafirConfig::new(); 145 - cfg.write().await?; 146 - } 147 - } 148 - 149 - Ok(cfg) 150 - }
-21
safir-mem/CHANGELOG.md
··· 1 - # Change Log 2 - 3 - Documenting changes between versions 4 - 5 - ## v0.3.0 6 - 7 - Removed formatted output 8 - 9 - This makes more sense in the for safir-mem as it means you can easily evaluate output in the terminal 10 - 11 - Better suits the use case. 12 - 13 - ## v0.2.1 14 - 15 - Changes to the internal code structure, no changes to operation 16 - 17 - ## v0.2.0 18 - 19 - Moved the core of the control to a new internal library called `safir-core` 20 - 21 - No changes to operation but merits a version bump
-20
safir-mem/Cargo.toml
··· 1 - [package] 2 - name = "safir-mem" 3 - version = "0.3.1" 4 - edition = "2021" 5 - authors = ["Graham Keenan graham.keenan@outlook.com"] 6 - license = "MIT OR Apache-2.0" 7 - description = "In-memory key/value store to share values between different shell sessions" 8 - readme = "README.md" 9 - homepage = "https://github.com/Tyrannican/safir" 10 - repository = "https://github.com/Tyrannican/safir" 11 - keywords = ["cli", "terminal", "utility", "key-value", "store"] 12 - categories = ["command-line-utilities"] 13 - 14 - # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 15 - 16 - [dependencies] 17 - clap = { version = "4.2.5" , features = ["derive"] } 18 - tokio = { version = "1.28.2", features = ["full"] } 19 - safir-core = { version = "0.2.2", path = "../safir-core" } 20 - anyhow = "1.0.75"
-201
safir-mem/LICENSE-APACHE
··· 1 - Apache License 2 - Version 2.0, January 2004 3 - http://www.apache.org/licenses/ 4 - 5 - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 - 7 - 1. Definitions. 8 - 9 - "License" shall mean the terms and conditions for use, reproduction, 10 - and distribution as defined by Sections 1 through 9 of this document. 11 - 12 - "Licensor" shall mean the copyright owner or entity authorized by 13 - the copyright owner that is granting the License. 14 - 15 - "Legal Entity" shall mean the union of the acting entity and all 16 - other entities that control, are controlled by, or are under common 17 - control with that entity. For the purposes of this definition, 18 - "control" means (i) the power, direct or indirect, to cause the 19 - direction or management of such entity, whether by contract or 20 - otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 - outstanding shares, or (iii) beneficial ownership of such entity. 22 - 23 - "You" (or "Your") shall mean an individual or Legal Entity 24 - exercising permissions granted by this License. 25 - 26 - "Source" form shall mean the preferred form for making modifications, 27 - including but not limited to software source code, documentation 28 - source, and configuration files. 29 - 30 - "Object" form shall mean any form resulting from mechanical 31 - transformation or translation of a Source form, including but 32 - not limited to compiled object code, generated documentation, 33 - and conversions to other media types. 34 - 35 - "Work" shall mean the work of authorship, whether in Source or 36 - Object form, made available under the License, as indicated by a 37 - copyright notice that is included in or attached to the work 38 - (an example is provided in the Appendix below). 39 - 40 - "Derivative Works" shall mean any work, whether in Source or Object 41 - form, that is based on (or derived from) the Work and for which the 42 - editorial revisions, annotations, elaborations, or other modifications 43 - represent, as a whole, an original work of authorship. For the purposes 44 - of this License, Derivative Works shall not include works that remain 45 - separable from, or merely link (or bind by name) to the interfaces of, 46 - the Work and Derivative Works thereof. 47 - 48 - "Contribution" shall mean any work of authorship, including 49 - the original version of the Work and any modifications or additions 50 - to that Work or Derivative Works thereof, that is intentionally 51 - submitted to Licensor for inclusion in the Work by the copyright owner 52 - or by an individual or Legal Entity authorized to submit on behalf of 53 - the copyright owner. For the purposes of this definition, "submitted" 54 - means any form of electronic, verbal, or written communication sent 55 - to the Licensor or its representatives, including but not limited to 56 - communication on electronic mailing lists, source code control systems, 57 - and issue tracking systems that are managed by, or on behalf of, the 58 - Licensor for the purpose of discussing and improving the Work, but 59 - excluding communication that is conspicuously marked or otherwise 60 - designated in writing by the copyright owner as "Not a Contribution." 61 - 62 - "Contributor" shall mean Licensor and any individual or Legal Entity 63 - on behalf of whom a Contribution has been received by Licensor and 64 - subsequently incorporated within the Work. 65 - 66 - 2. Grant of Copyright License. Subject to the terms and conditions of 67 - this License, each Contributor hereby grants to You a perpetual, 68 - worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 - copyright license to reproduce, prepare Derivative Works of, 70 - publicly display, publicly perform, sublicense, and distribute the 71 - Work and such Derivative Works in Source or Object form. 72 - 73 - 3. Grant of Patent License. Subject to the terms and conditions of 74 - this License, each Contributor hereby grants to You a perpetual, 75 - worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 - (except as stated in this section) patent license to make, have made, 77 - use, offer to sell, sell, import, and otherwise transfer the Work, 78 - where such license applies only to those patent claims licensable 79 - by such Contributor that are necessarily infringed by their 80 - Contribution(s) alone or by combination of their Contribution(s) 81 - with the Work to which such Contribution(s) was submitted. If You 82 - institute patent litigation against any entity (including a 83 - cross-claim or counterclaim in a lawsuit) alleging that the Work 84 - or a Contribution incorporated within the Work constitutes direct 85 - or contributory patent infringement, then any patent licenses 86 - granted to You under this License for that Work shall terminate 87 - as of the date such litigation is filed. 88 - 89 - 4. Redistribution. You may reproduce and distribute copies of the 90 - Work or Derivative Works thereof in any medium, with or without 91 - modifications, and in Source or Object form, provided that You 92 - meet the following conditions: 93 - 94 - (a) You must give any other recipients of the Work or 95 - Derivative Works a copy of this License; and 96 - 97 - (b) You must cause any modified files to carry prominent notices 98 - stating that You changed the files; and 99 - 100 - (c) You must retain, in the Source form of any Derivative Works 101 - that You distribute, all copyright, patent, trademark, and 102 - attribution notices from the Source form of the Work, 103 - excluding those notices that do not pertain to any part of 104 - the Derivative Works; and 105 - 106 - (d) If the Work includes a "NOTICE" text file as part of its 107 - distribution, then any Derivative Works that You distribute must 108 - include a readable copy of the attribution notices contained 109 - within such NOTICE file, excluding those notices that do not 110 - pertain to any part of the Derivative Works, in at least one 111 - of the following places: within a NOTICE text file distributed 112 - as part of the Derivative Works; within the Source form or 113 - documentation, if provided along with the Derivative Works; or, 114 - within a display generated by the Derivative Works, if and 115 - wherever such third-party notices normally appear. The contents 116 - of the NOTICE file are for informational purposes only and 117 - do not modify the License. You may add Your own attribution 118 - notices within Derivative Works that You distribute, alongside 119 - or as an addendum to the NOTICE text from the Work, provided 120 - that such additional attribution notices cannot be construed 121 - as modifying the License. 122 - 123 - You may add Your own copyright statement to Your modifications and 124 - may provide additional or different license terms and conditions 125 - for use, reproduction, or distribution of Your modifications, or 126 - for any such Derivative Works as a whole, provided Your use, 127 - reproduction, and distribution of the Work otherwise complies with 128 - the conditions stated in this License. 129 - 130 - 5. Submission of Contributions. Unless You explicitly state otherwise, 131 - any Contribution intentionally submitted for inclusion in the Work 132 - by You to the Licensor shall be under the terms and conditions of 133 - this License, without any additional terms or conditions. 134 - Notwithstanding the above, nothing herein shall supersede or modify 135 - the terms of any separate license agreement you may have executed 136 - with Licensor regarding such Contributions. 137 - 138 - 6. Trademarks. This License does not grant permission to use the trade 139 - names, trademarks, service marks, or product names of the Licensor, 140 - except as required for reasonable and customary use in describing the 141 - origin of the Work and reproducing the content of the NOTICE file. 142 - 143 - 7. Disclaimer of Warranty. Unless required by applicable law or 144 - agreed to in writing, Licensor provides the Work (and each 145 - Contributor provides its Contributions) on an "AS IS" BASIS, 146 - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 - implied, including, without limitation, any warranties or conditions 148 - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 - PARTICULAR PURPOSE. You are solely responsible for determining the 150 - appropriateness of using or redistributing the Work and assume any 151 - risks associated with Your exercise of permissions under this License. 152 - 153 - 8. Limitation of Liability. In no event and under no legal theory, 154 - whether in tort (including negligence), contract, or otherwise, 155 - unless required by applicable law (such as deliberate and grossly 156 - negligent acts) or agreed to in writing, shall any Contributor be 157 - liable to You for damages, including any direct, indirect, special, 158 - incidental, or consequential damages of any character arising as a 159 - result of this License or out of the use or inability to use the 160 - Work (including but not limited to damages for loss of goodwill, 161 - work stoppage, computer failure or malfunction, or any and all 162 - other commercial damages or losses), even if such Contributor 163 - has been advised of the possibility of such damages. 164 - 165 - 9. Accepting Warranty or Additional Liability. While redistributing 166 - the Work or Derivative Works thereof, You may choose to offer, 167 - and charge a fee for, acceptance of support, warranty, indemnity, 168 - or other liability obligations and/or rights consistent with this 169 - License. However, in accepting such obligations, You may act only 170 - on Your own behalf and on Your sole responsibility, not on behalf 171 - of any other Contributor, and only if You agree to indemnify, 172 - defend, and hold each Contributor harmless for any liability 173 - incurred by, or claims asserted against, such Contributor by reason 174 - of your accepting any such warranty or additional liability. 175 - 176 - END OF TERMS AND CONDITIONS 177 - 178 - APPENDIX: How to apply the Apache License to your work. 179 - 180 - To apply the Apache License to your work, attach the following 181 - boilerplate notice, with the fields enclosed by brackets "[]" 182 - replaced with your own identifying information. (Don't include 183 - the brackets!) The text should be enclosed in the appropriate 184 - comment syntax for the file format. We also recommend that a 185 - file or class name and description of purpose be included on the 186 - same "printed page" as the copyright notice for easier 187 - identification within third-party archives. 188 - 189 - Copyright [yyyy] [name of copyright owner] 190 - 191 - Licensed under the Apache License, Version 2.0 (the "License"); 192 - you may not use this file except in compliance with the License. 193 - You may obtain a copy of the License at 194 - 195 - http://www.apache.org/licenses/LICENSE-2.0 196 - 197 - Unless required by applicable law or agreed to in writing, software 198 - distributed under the License is distributed on an "AS IS" BASIS, 199 - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 - See the License for the specific language governing permissions and 201 - limitations under the License.
-21
safir-mem/LICENSE-MIT
··· 1 - MIT License 2 - 3 - Copyright (c) 2023 Graham Keenan 4 - 5 - Permission is hereby granted, free of charge, to any person obtaining a copy 6 - of this software and associated documentation files (the "Software"), to deal 7 - in the Software without restriction, including without limitation the rights 8 - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 - copies of the Software, and to permit persons to whom the Software is 10 - furnished to do so, subject to the following conditions: 11 - 12 - The above copyright notice and this permission notice shall be included in all 13 - copies or substantial portions of the Software. 14 - 15 - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 - SOFTWARE.
-56
safir-mem/README.md
··· 1 - # Safir-mem 2 - 3 - ## Notice 4 - 5 - :warning: This is now archived and no longer updated :warning: 6 - 7 - It was ambitious (and worked kinda) but became far too unweildy and complicated when it didn't have to. 8 - Maybe a rewrite in the future but for now, it's now archived. 9 - 10 - Simple in-memory CLI key/value store. 11 - 12 - The in-memory version of [Safir](https://crates.io/crates/safir)! 13 - 14 - `safir-mem` starts a service which runs on `localhost` or `127.0.0.1` on dedicated port `9876`. 15 - 16 - This can be enabled / diabled with the `start` and `stop` commands respectively. 17 - Note that when the memcache service is disabled, ALL data contained within it is lost so use wisely. 18 - 19 - In cases where you want to save the contents of the memcache, the `dump` command will allow for the contents to be saved out to disk in JSON format. 20 - This behaves as a snapshot as the contents of the cache persist after usage. 21 - 22 - ## Install 23 - 24 - To install `safir-mem`, run `cargo install safir-mem`. 25 - 26 - ### Requirements 27 - 28 - Using this requires that the [Rubin CLI](https://crates.io/crates/rubin-cli) be installed. 29 - 30 - ```bash 31 - cargo install rubin-cli 32 - ``` 33 - 34 - ## Usage 35 - 36 - ```bash 37 - In-memory key/value store to share information between shell sessions 38 - 39 - Usage: safir-mem <COMMAND> 40 - 41 - Commands: 42 - add Add a value to the store with the given key 43 - get Get a value from the store 44 - rm Remove values from the store 45 - alias Output the alias command for a key / value pair to be entered into a shell session 46 - export Output the export command for a key / value pair to be entered into a shell session 47 - clear Clear all keys/values from the store 48 - start Start the memcache server 49 - stop Stop the memcache server 50 - dump Dump contents of memcache to disk 51 - help Print this message or the help of the given subcommand(s) 52 - 53 - Options: 54 - -h, --help Print help 55 - -V, --version Print version 56 - ```
-85
safir-mem/src/cli.rs
··· 1 - //! CLI for using the Safir binary 2 - pub use clap::{Args, Parser, Subcommand}; 3 - 4 - /// CLI arguments for running the program 5 - #[derive(Parser, Debug)] 6 - #[command(author, version)] 7 - #[command(propagate_version = true)] 8 - #[command(about = "In-memory key/value store to share information between shell sessions", long_about = None)] 9 - pub struct Cli { 10 - /// Subcommands 11 - #[command(subcommand)] 12 - pub command: Commands, 13 - } 14 - 15 - /// Subcommands for running the program 16 - #[derive(Subcommand, Debug, PartialEq)] 17 - pub enum Commands { 18 - /// Add a value to the store with the given key 19 - Add(AddArgs), 20 - 21 - /// Get a value from the store 22 - Get(GetArgs), 23 - 24 - /// Remove values from the store 25 - Rm(RemoveArgs), 26 - 27 - /// Output the alias command for a key / value pair to be entered into a shell session 28 - Alias(SetArgs), 29 - 30 - /// Output the export command for a key / value pair to be entered into a shell session 31 - Export(SetArgs), 32 - 33 - /// Clear all keys/values from the store 34 - Clear, 35 - 36 - /// Start the memcache server 37 - Start, 38 - 39 - /// Stop the memcache server 40 - Stop, 41 - 42 - /// Dump contents of memcache to disk 43 - Dump(DumpArgs), 44 - } 45 - 46 - /// Arguments for adding a value to the store with a given key 47 - #[derive(Args, Debug, PartialEq)] 48 - pub struct AddArgs { 49 - /// Name of the item to store 50 - pub key: String, 51 - 52 - /// Value to store 53 - pub value: String, 54 - } 55 - 56 - /// Arguments for retrieving a value from the store with a given key 57 - #[derive(Args, Debug, PartialEq)] 58 - pub struct GetArgs { 59 - /// Name of the value to retrieve from the store 60 - /// 61 - /// Returns nothing if the key does not exist 62 - pub key: Option<String>, 63 - } 64 - 65 - /// Arguments for removing values from the store with given keys 66 - #[derive(Args, Debug, PartialEq)] 67 - pub struct RemoveArgs { 68 - /// Name of the keys to remove from the store 69 - /// 70 - /// Does nothing if the keys do not exist 71 - pub key: Vec<String>, 72 - } 73 - 74 - /// Arguments for outputting commands with a given prefix 75 - #[derive(Args, Debug, PartialEq)] 76 - pub struct SetArgs { 77 - /// Name of the keys to display (e.g. alias / export) 78 - pub keys: Vec<String>, 79 - } 80 - 81 - #[derive(Args, Debug, PartialEq)] 82 - pub struct DumpArgs { 83 - /// Path to save the store to 84 - pub path: String, 85 - }
-108
safir-mem/src/main.rs
··· 1 - mod cli; 2 - 3 - use cli::*; 4 - use safir_core::{utils, Safir, SafirEngineType}; 5 - 6 - use anyhow::Result; 7 - use std::process::{Command, Stdio}; 8 - 9 - #[tokio::main] 10 - async fn main() -> Result<()> { 11 - let cli = Cli::parse(); 12 - let mut safir_mem = Safir::new(SafirEngineType::Memcache).await?; 13 - 14 - match &cli.command { 15 - Commands::Add(args) => { 16 - safir_mem 17 - .add_entry(args.key.to_owned(), args.value.to_owned()) 18 - .await? 19 - } 20 - Commands::Get(args) => { 21 - if let Some(key) = &args.key { 22 - safir_mem.get_entry(key.to_string()).await?; 23 - } else { 24 - println!("A key is required for memcache GET command!"); 25 - } 26 - } 27 - Commands::Rm(args) => { 28 - safir_mem.remove_entry(args.key.clone()).await?; 29 - } 30 - Commands::Alias(args) => { 31 - safir_mem.set_commands("alias", &args.keys).await; 32 - } 33 - Commands::Export(args) => { 34 - safir_mem.set_commands("export", &args.keys).await; 35 - } 36 - Commands::Clear => { 37 - safir_mem.clear_entries().await?; 38 - } 39 - Commands::Start => { 40 - if !utils::check_rubin_installed() { 41 - eprintln!( 42 - "The Rubin binary must be installed to use this feature, please install it via cargo using `cargo install rubin-cli`" 43 - ); 44 - return Ok(()); 45 - } 46 - 47 - let config = &mut safir_mem.config; 48 - if let Some(pid) = config.memcache_pid { 49 - println!( 50 - "Safir memcache service is already running on 127.0.0.1:9876 - PID {}", 51 - pid 52 - ); 53 - 54 - return Ok(()); 55 - } 56 - 57 - let child = Command::new("rubin") 58 - .args(["server"]) 59 - .stdout(Stdio::null()) 60 - .stderr(Stdio::null()) 61 - .stdin(Stdio::null()) 62 - .spawn() 63 - .expect("unable to spawn child process"); 64 - 65 - let pid = child.id(); 66 - config.memcache_pid = Some(pid); 67 - config.write().await?; 68 - println!( 69 - "Safir memcache service started at 127.0.0.1:9876 - PID {}", 70 - pid 71 - ); 72 - } 73 - Commands::Stop => { 74 - if !utils::check_rubin_installed() { 75 - eprintln!("The Rubin binary must be installed to use this feature, please install it via cargo using `cargo install rubin-cli`"); 76 - return Ok(()); 77 - } 78 - 79 - let config = &mut safir_mem.config; 80 - let pid = match config.memcache_pid { 81 - Some(pid) => pid, 82 - None => { 83 - println!("Safir memcache service does not seem to be running."); 84 - return Ok(()); 85 - } 86 - }; 87 - 88 - if let Err(err) = utils::kill_process(pid).await { 89 - eprintln!( 90 - "Safir memcache service failed to stop, manual removal may be necessary - {}", 91 - err 92 - ); 93 - } else { 94 - config.memcache_pid = None; 95 - config.write().await?; 96 - println!("Stopping Safir memcache service!"); 97 - } 98 - } 99 - Commands::Dump(args) => { 100 - let inner = safir_mem.as_safir_memcache(); 101 - if let Err(e) = inner.dump_store(&args.path).await { 102 - eprintln!("unable to dump Safir memcache service: {}", e); 103 - } 104 - } 105 - } 106 - 107 - Ok(()) 108 - }
safir/CHANGELOG.md CHANGELOG.md
-1084
safir/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 = "anstream" 7 - version = "0.3.2" 8 - source = "registry+https://github.com/rust-lang/crates.io-index" 9 - checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" 10 - dependencies = [ 11 - "anstyle", 12 - "anstyle-parse", 13 - "anstyle-query", 14 - "anstyle-wincon", 15 - "colorchoice", 16 - "is-terminal", 17 - "utf8parse", 18 - ] 19 - 20 - [[package]] 21 - name = "anstyle" 22 - version = "1.0.0" 23 - source = "registry+https://github.com/rust-lang/crates.io-index" 24 - checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d" 25 - 26 - [[package]] 27 - name = "anstyle-parse" 28 - version = "0.2.0" 29 - source = "registry+https://github.com/rust-lang/crates.io-index" 30 - checksum = "e765fd216e48e067936442276d1d57399e37bce53c264d6fefbe298080cb57ee" 31 - dependencies = [ 32 - "utf8parse", 33 - ] 34 - 35 - [[package]] 36 - name = "anstyle-query" 37 - version = "1.0.0" 38 - source = "registry+https://github.com/rust-lang/crates.io-index" 39 - checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" 40 - dependencies = [ 41 - "windows-sys 0.48.0", 42 - ] 43 - 44 - [[package]] 45 - name = "anstyle-wincon" 46 - version = "1.0.1" 47 - source = "registry+https://github.com/rust-lang/crates.io-index" 48 - checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" 49 - dependencies = [ 50 - "anstyle", 51 - "windows-sys 0.48.0", 52 - ] 53 - 54 - [[package]] 55 - name = "atty" 56 - version = "0.2.14" 57 - source = "registry+https://github.com/rust-lang/crates.io-index" 58 - checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" 59 - dependencies = [ 60 - "hermit-abi 0.1.19", 61 - "libc", 62 - "winapi", 63 - ] 64 - 65 - [[package]] 66 - name = "autocfg" 67 - version = "1.1.0" 68 - source = "registry+https://github.com/rust-lang/crates.io-index" 69 - checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 70 - 71 - [[package]] 72 - name = "bitflags" 73 - version = "1.3.2" 74 - source = "registry+https://github.com/rust-lang/crates.io-index" 75 - checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 76 - 77 - [[package]] 78 - name = "bytes" 79 - version = "1.4.0" 80 - source = "registry+https://github.com/rust-lang/crates.io-index" 81 - checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" 82 - 83 - [[package]] 84 - name = "cc" 85 - version = "1.0.79" 86 - source = "registry+https://github.com/rust-lang/crates.io-index" 87 - checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" 88 - 89 - [[package]] 90 - name = "cfg-if" 91 - version = "1.0.0" 92 - source = "registry+https://github.com/rust-lang/crates.io-index" 93 - checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 94 - 95 - [[package]] 96 - name = "clap" 97 - version = "4.3.1" 98 - source = "registry+https://github.com/rust-lang/crates.io-index" 99 - checksum = "b4ed2379f8603fa2b7509891660e802b88c70a79a6427a70abb5968054de2c28" 100 - dependencies = [ 101 - "clap_builder", 102 - "clap_derive", 103 - "once_cell", 104 - ] 105 - 106 - [[package]] 107 - name = "clap_builder" 108 - version = "4.3.1" 109 - source = "registry+https://github.com/rust-lang/crates.io-index" 110 - checksum = "72394f3339a76daf211e57d4bcb374410f3965dcc606dd0e03738c7888766980" 111 - dependencies = [ 112 - "anstream", 113 - "anstyle", 114 - "bitflags", 115 - "clap_lex", 116 - "strsim", 117 - ] 118 - 119 - [[package]] 120 - name = "clap_derive" 121 - version = "4.3.1" 122 - source = "registry+https://github.com/rust-lang/crates.io-index" 123 - checksum = "59e9ef9a08ee1c0e1f2e162121665ac45ac3783b0f897db7244ae75ad9a8f65b" 124 - dependencies = [ 125 - "heck", 126 - "proc-macro2", 127 - "quote", 128 - "syn 2.0.18", 129 - ] 130 - 131 - [[package]] 132 - name = "clap_lex" 133 - version = "0.5.0" 134 - source = "registry+https://github.com/rust-lang/crates.io-index" 135 - checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" 136 - 137 - [[package]] 138 - name = "colorchoice" 139 - version = "1.0.0" 140 - source = "registry+https://github.com/rust-lang/crates.io-index" 141 - checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" 142 - 143 - [[package]] 144 - name = "colored" 145 - version = "2.0.0" 146 - source = "registry+https://github.com/rust-lang/crates.io-index" 147 - checksum = "b3616f750b84d8f0de8a58bda93e08e2a81ad3f523089b05f1dffecab48c6cbd" 148 - dependencies = [ 149 - "atty", 150 - "lazy_static", 151 - "winapi", 152 - ] 153 - 154 - [[package]] 155 - name = "core-foundation-sys" 156 - version = "0.8.4" 157 - source = "registry+https://github.com/rust-lang/crates.io-index" 158 - checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" 159 - 160 - [[package]] 161 - name = "crossbeam-channel" 162 - version = "0.5.8" 163 - source = "registry+https://github.com/rust-lang/crates.io-index" 164 - checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" 165 - dependencies = [ 166 - "cfg-if", 167 - "crossbeam-utils", 168 - ] 169 - 170 - [[package]] 171 - name = "crossbeam-deque" 172 - version = "0.8.3" 173 - source = "registry+https://github.com/rust-lang/crates.io-index" 174 - checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" 175 - dependencies = [ 176 - "cfg-if", 177 - "crossbeam-epoch", 178 - "crossbeam-utils", 179 - ] 180 - 181 - [[package]] 182 - name = "crossbeam-epoch" 183 - version = "0.9.15" 184 - source = "registry+https://github.com/rust-lang/crates.io-index" 185 - checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" 186 - dependencies = [ 187 - "autocfg", 188 - "cfg-if", 189 - "crossbeam-utils", 190 - "memoffset 0.9.0", 191 - "scopeguard", 192 - ] 193 - 194 - [[package]] 195 - name = "crossbeam-utils" 196 - version = "0.8.16" 197 - source = "registry+https://github.com/rust-lang/crates.io-index" 198 - checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" 199 - dependencies = [ 200 - "cfg-if", 201 - ] 202 - 203 - [[package]] 204 - name = "darwin-libproc" 205 - version = "0.1.2" 206 - source = "registry+https://github.com/rust-lang/crates.io-index" 207 - checksum = "9fb90051930c9a0f09e585762152048e23ac74d20c10590ef7cf01c0343c3046" 208 - dependencies = [ 209 - "darwin-libproc-sys", 210 - "libc", 211 - "memchr", 212 - ] 213 - 214 - [[package]] 215 - name = "darwin-libproc-sys" 216 - version = "0.1.2" 217 - source = "registry+https://github.com/rust-lang/crates.io-index" 218 - checksum = "57cebb5bde66eecdd30ddc4b9cd208238b15db4982ccc72db59d699ea10867c1" 219 - dependencies = [ 220 - "libc", 221 - ] 222 - 223 - [[package]] 224 - name = "derive_more" 225 - version = "0.99.17" 226 - source = "registry+https://github.com/rust-lang/crates.io-index" 227 - checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" 228 - dependencies = [ 229 - "proc-macro2", 230 - "quote", 231 - "syn 1.0.109", 232 - ] 233 - 234 - [[package]] 235 - name = "dirs" 236 - version = "5.0.1" 237 - source = "registry+https://github.com/rust-lang/crates.io-index" 238 - checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" 239 - dependencies = [ 240 - "dirs-sys", 241 - ] 242 - 243 - [[package]] 244 - name = "dirs-sys" 245 - version = "0.4.1" 246 - source = "registry+https://github.com/rust-lang/crates.io-index" 247 - checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" 248 - dependencies = [ 249 - "libc", 250 - "option-ext", 251 - "redox_users", 252 - "windows-sys 0.48.0", 253 - ] 254 - 255 - [[package]] 256 - name = "either" 257 - version = "1.8.1" 258 - source = "registry+https://github.com/rust-lang/crates.io-index" 259 - checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" 260 - 261 - [[package]] 262 - name = "errno" 263 - version = "0.3.1" 264 - source = "registry+https://github.com/rust-lang/crates.io-index" 265 - checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" 266 - dependencies = [ 267 - "errno-dragonfly", 268 - "libc", 269 - "windows-sys 0.48.0", 270 - ] 271 - 272 - [[package]] 273 - name = "errno-dragonfly" 274 - version = "0.1.2" 275 - source = "registry+https://github.com/rust-lang/crates.io-index" 276 - checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" 277 - dependencies = [ 278 - "cc", 279 - "libc", 280 - ] 281 - 282 - [[package]] 283 - name = "getrandom" 284 - version = "0.2.9" 285 - source = "registry+https://github.com/rust-lang/crates.io-index" 286 - checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" 287 - dependencies = [ 288 - "cfg-if", 289 - "libc", 290 - "wasi", 291 - ] 292 - 293 - [[package]] 294 - name = "glob" 295 - version = "0.3.1" 296 - source = "registry+https://github.com/rust-lang/crates.io-index" 297 - checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" 298 - 299 - [[package]] 300 - name = "heck" 301 - version = "0.4.1" 302 - source = "registry+https://github.com/rust-lang/crates.io-index" 303 - checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" 304 - 305 - [[package]] 306 - name = "hermit-abi" 307 - version = "0.1.19" 308 - source = "registry+https://github.com/rust-lang/crates.io-index" 309 - checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" 310 - dependencies = [ 311 - "libc", 312 - ] 313 - 314 - [[package]] 315 - name = "hermit-abi" 316 - version = "0.2.6" 317 - source = "registry+https://github.com/rust-lang/crates.io-index" 318 - checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" 319 - dependencies = [ 320 - "libc", 321 - ] 322 - 323 - [[package]] 324 - name = "hermit-abi" 325 - version = "0.3.1" 326 - source = "registry+https://github.com/rust-lang/crates.io-index" 327 - checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" 328 - 329 - [[package]] 330 - name = "io-lifetimes" 331 - version = "1.0.11" 332 - source = "registry+https://github.com/rust-lang/crates.io-index" 333 - checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" 334 - dependencies = [ 335 - "hermit-abi 0.3.1", 336 - "libc", 337 - "windows-sys 0.48.0", 338 - ] 339 - 340 - [[package]] 341 - name = "is-terminal" 342 - version = "0.4.7" 343 - source = "registry+https://github.com/rust-lang/crates.io-index" 344 - checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" 345 - dependencies = [ 346 - "hermit-abi 0.3.1", 347 - "io-lifetimes", 348 - "rustix", 349 - "windows-sys 0.48.0", 350 - ] 351 - 352 - [[package]] 353 - name = "itoa" 354 - version = "1.0.6" 355 - source = "registry+https://github.com/rust-lang/crates.io-index" 356 - checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" 357 - 358 - [[package]] 359 - name = "lazy_static" 360 - version = "1.4.0" 361 - source = "registry+https://github.com/rust-lang/crates.io-index" 362 - checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 363 - 364 - [[package]] 365 - name = "libc" 366 - version = "0.2.144" 367 - source = "registry+https://github.com/rust-lang/crates.io-index" 368 - checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" 369 - 370 - [[package]] 371 - name = "linux-raw-sys" 372 - version = "0.3.8" 373 - source = "registry+https://github.com/rust-lang/crates.io-index" 374 - checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" 375 - 376 - [[package]] 377 - name = "lock_api" 378 - version = "0.4.9" 379 - source = "registry+https://github.com/rust-lang/crates.io-index" 380 - checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" 381 - dependencies = [ 382 - "autocfg", 383 - "scopeguard", 384 - ] 385 - 386 - [[package]] 387 - name = "log" 388 - version = "0.4.19" 389 - source = "registry+https://github.com/rust-lang/crates.io-index" 390 - checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" 391 - 392 - [[package]] 393 - name = "mach" 394 - version = "0.3.2" 395 - source = "registry+https://github.com/rust-lang/crates.io-index" 396 - checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" 397 - dependencies = [ 398 - "libc", 399 - ] 400 - 401 - [[package]] 402 - name = "memchr" 403 - version = "2.5.0" 404 - source = "registry+https://github.com/rust-lang/crates.io-index" 405 - checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" 406 - 407 - [[package]] 408 - name = "memoffset" 409 - version = "0.6.5" 410 - source = "registry+https://github.com/rust-lang/crates.io-index" 411 - checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" 412 - dependencies = [ 413 - "autocfg", 414 - ] 415 - 416 - [[package]] 417 - name = "memoffset" 418 - version = "0.9.0" 419 - source = "registry+https://github.com/rust-lang/crates.io-index" 420 - checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" 421 - dependencies = [ 422 - "autocfg", 423 - ] 424 - 425 - [[package]] 426 - name = "mio" 427 - version = "0.8.8" 428 - source = "registry+https://github.com/rust-lang/crates.io-index" 429 - checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" 430 - dependencies = [ 431 - "libc", 432 - "wasi", 433 - "windows-sys 0.48.0", 434 - ] 435 - 436 - [[package]] 437 - name = "nix" 438 - version = "0.23.2" 439 - source = "registry+https://github.com/rust-lang/crates.io-index" 440 - checksum = "8f3790c00a0150112de0f4cd161e3d7fc4b2d8a5542ffc35f099a2562aecb35c" 441 - dependencies = [ 442 - "bitflags", 443 - "cc", 444 - "cfg-if", 445 - "libc", 446 - "memoffset 0.6.5", 447 - ] 448 - 449 - [[package]] 450 - name = "ntapi" 451 - version = "0.4.1" 452 - source = "registry+https://github.com/rust-lang/crates.io-index" 453 - checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4" 454 - dependencies = [ 455 - "winapi", 456 - ] 457 - 458 - [[package]] 459 - name = "nu-ansi-term" 460 - version = "0.46.0" 461 - source = "registry+https://github.com/rust-lang/crates.io-index" 462 - checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" 463 - dependencies = [ 464 - "overload", 465 - "winapi", 466 - ] 467 - 468 - [[package]] 469 - name = "num_cpus" 470 - version = "1.15.0" 471 - source = "registry+https://github.com/rust-lang/crates.io-index" 472 - checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" 473 - dependencies = [ 474 - "hermit-abi 0.2.6", 475 - "libc", 476 - ] 477 - 478 - [[package]] 479 - name = "once_cell" 480 - version = "1.17.2" 481 - source = "registry+https://github.com/rust-lang/crates.io-index" 482 - checksum = "9670a07f94779e00908f3e686eab508878ebb390ba6e604d3a284c00e8d0487b" 483 - 484 - [[package]] 485 - name = "option-ext" 486 - version = "0.2.0" 487 - source = "registry+https://github.com/rust-lang/crates.io-index" 488 - checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" 489 - 490 - [[package]] 491 - name = "overload" 492 - version = "0.1.1" 493 - source = "registry+https://github.com/rust-lang/crates.io-index" 494 - checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" 495 - 496 - [[package]] 497 - name = "parking_lot" 498 - version = "0.12.1" 499 - source = "registry+https://github.com/rust-lang/crates.io-index" 500 - checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" 501 - dependencies = [ 502 - "lock_api", 503 - "parking_lot_core", 504 - ] 505 - 506 - [[package]] 507 - name = "parking_lot_core" 508 - version = "0.9.7" 509 - source = "registry+https://github.com/rust-lang/crates.io-index" 510 - checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" 511 - dependencies = [ 512 - "cfg-if", 513 - "libc", 514 - "redox_syscall", 515 - "smallvec", 516 - "windows-sys 0.45.0", 517 - ] 518 - 519 - [[package]] 520 - name = "pin-project-lite" 521 - version = "0.2.9" 522 - source = "registry+https://github.com/rust-lang/crates.io-index" 523 - checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" 524 - 525 - [[package]] 526 - name = "platforms" 527 - version = "2.0.0" 528 - source = "registry+https://github.com/rust-lang/crates.io-index" 529 - checksum = "e8d0eef3571242013a0d5dc84861c3ae4a652e56e12adf8bdc26ff5f8cb34c94" 530 - 531 - [[package]] 532 - name = "proc-macro2" 533 - version = "1.0.59" 534 - source = "registry+https://github.com/rust-lang/crates.io-index" 535 - checksum = "6aeca18b86b413c660b781aa319e4e2648a3e6f9eadc9b47e9038e6fe9f3451b" 536 - dependencies = [ 537 - "unicode-ident", 538 - ] 539 - 540 - [[package]] 541 - name = "psutil" 542 - version = "3.2.2" 543 - source = "registry+https://github.com/rust-lang/crates.io-index" 544 - checksum = "f866af2b0f8e4b0d2d00aad8a9c5fc48fad33466cd99a64cbb3a4c1505f1a62d" 545 - dependencies = [ 546 - "cfg-if", 547 - "darwin-libproc", 548 - "derive_more", 549 - "glob", 550 - "mach", 551 - "nix", 552 - "num_cpus", 553 - "once_cell", 554 - "platforms", 555 - "thiserror", 556 - "unescape", 557 - ] 558 - 559 - [[package]] 560 - name = "quote" 561 - version = "1.0.28" 562 - source = "registry+https://github.com/rust-lang/crates.io-index" 563 - checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" 564 - dependencies = [ 565 - "proc-macro2", 566 - ] 567 - 568 - [[package]] 569 - name = "rayon" 570 - version = "1.7.0" 571 - source = "registry+https://github.com/rust-lang/crates.io-index" 572 - checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" 573 - dependencies = [ 574 - "either", 575 - "rayon-core", 576 - ] 577 - 578 - [[package]] 579 - name = "rayon-core" 580 - version = "1.11.0" 581 - source = "registry+https://github.com/rust-lang/crates.io-index" 582 - checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" 583 - dependencies = [ 584 - "crossbeam-channel", 585 - "crossbeam-deque", 586 - "crossbeam-utils", 587 - "num_cpus", 588 - ] 589 - 590 - [[package]] 591 - name = "redox_syscall" 592 - version = "0.2.16" 593 - source = "registry+https://github.com/rust-lang/crates.io-index" 594 - checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" 595 - dependencies = [ 596 - "bitflags", 597 - ] 598 - 599 - [[package]] 600 - name = "redox_users" 601 - version = "0.4.3" 602 - source = "registry+https://github.com/rust-lang/crates.io-index" 603 - checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" 604 - dependencies = [ 605 - "getrandom", 606 - "redox_syscall", 607 - "thiserror", 608 - ] 609 - 610 - [[package]] 611 - name = "rubin" 612 - version = "0.3.1" 613 - source = "registry+https://github.com/rust-lang/crates.io-index" 614 - checksum = "42c54f8f7b8a32f0b361d6dab1933f931ea13e533f19cb33c09a6d1e7141d55b" 615 - dependencies = [ 616 - "serde", 617 - "serde_json", 618 - "tokio", 619 - "tracing", 620 - "tracing-subscriber", 621 - ] 622 - 623 - [[package]] 624 - name = "rustix" 625 - version = "0.37.19" 626 - source = "registry+https://github.com/rust-lang/crates.io-index" 627 - checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" 628 - dependencies = [ 629 - "bitflags", 630 - "errno", 631 - "io-lifetimes", 632 - "libc", 633 - "linux-raw-sys", 634 - "windows-sys 0.48.0", 635 - ] 636 - 637 - [[package]] 638 - name = "ryu" 639 - version = "1.0.13" 640 - source = "registry+https://github.com/rust-lang/crates.io-index" 641 - checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" 642 - 643 - [[package]] 644 - name = "safir" 645 - version = "0.5.0" 646 - dependencies = [ 647 - "clap", 648 - "colored", 649 - "dirs", 650 - "psutil", 651 - "rubin", 652 - "serde", 653 - "serde_json", 654 - "sysinfo", 655 - "tokio", 656 - "which", 657 - ] 658 - 659 - [[package]] 660 - name = "scopeguard" 661 - version = "1.1.0" 662 - source = "registry+https://github.com/rust-lang/crates.io-index" 663 - checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" 664 - 665 - [[package]] 666 - name = "serde" 667 - version = "1.0.163" 668 - source = "registry+https://github.com/rust-lang/crates.io-index" 669 - checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2" 670 - dependencies = [ 671 - "serde_derive", 672 - ] 673 - 674 - [[package]] 675 - name = "serde_derive" 676 - version = "1.0.163" 677 - source = "registry+https://github.com/rust-lang/crates.io-index" 678 - checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" 679 - dependencies = [ 680 - "proc-macro2", 681 - "quote", 682 - "syn 2.0.18", 683 - ] 684 - 685 - [[package]] 686 - name = "serde_json" 687 - version = "1.0.96" 688 - source = "registry+https://github.com/rust-lang/crates.io-index" 689 - checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" 690 - dependencies = [ 691 - "itoa", 692 - "ryu", 693 - "serde", 694 - ] 695 - 696 - [[package]] 697 - name = "sharded-slab" 698 - version = "0.1.4" 699 - source = "registry+https://github.com/rust-lang/crates.io-index" 700 - checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" 701 - dependencies = [ 702 - "lazy_static", 703 - ] 704 - 705 - [[package]] 706 - name = "signal-hook-registry" 707 - version = "1.4.1" 708 - source = "registry+https://github.com/rust-lang/crates.io-index" 709 - checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" 710 - dependencies = [ 711 - "libc", 712 - ] 713 - 714 - [[package]] 715 - name = "smallvec" 716 - version = "1.10.0" 717 - source = "registry+https://github.com/rust-lang/crates.io-index" 718 - checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" 719 - 720 - [[package]] 721 - name = "socket2" 722 - version = "0.4.9" 723 - source = "registry+https://github.com/rust-lang/crates.io-index" 724 - checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" 725 - dependencies = [ 726 - "libc", 727 - "winapi", 728 - ] 729 - 730 - [[package]] 731 - name = "strsim" 732 - version = "0.10.0" 733 - source = "registry+https://github.com/rust-lang/crates.io-index" 734 - checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" 735 - 736 - [[package]] 737 - name = "syn" 738 - version = "1.0.109" 739 - source = "registry+https://github.com/rust-lang/crates.io-index" 740 - checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" 741 - dependencies = [ 742 - "proc-macro2", 743 - "quote", 744 - "unicode-ident", 745 - ] 746 - 747 - [[package]] 748 - name = "syn" 749 - version = "2.0.18" 750 - source = "registry+https://github.com/rust-lang/crates.io-index" 751 - checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" 752 - dependencies = [ 753 - "proc-macro2", 754 - "quote", 755 - "unicode-ident", 756 - ] 757 - 758 - [[package]] 759 - name = "sysinfo" 760 - version = "0.29.3" 761 - source = "registry+https://github.com/rust-lang/crates.io-index" 762 - checksum = "5bcd0346f90b6bc83526c7b180039a8acd26a5c848cc556d457f6472eb148122" 763 - dependencies = [ 764 - "cfg-if", 765 - "core-foundation-sys", 766 - "libc", 767 - "ntapi", 768 - "once_cell", 769 - "rayon", 770 - "winapi", 771 - ] 772 - 773 - [[package]] 774 - name = "thiserror" 775 - version = "1.0.40" 776 - source = "registry+https://github.com/rust-lang/crates.io-index" 777 - checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" 778 - dependencies = [ 779 - "thiserror-impl", 780 - ] 781 - 782 - [[package]] 783 - name = "thiserror-impl" 784 - version = "1.0.40" 785 - source = "registry+https://github.com/rust-lang/crates.io-index" 786 - checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" 787 - dependencies = [ 788 - "proc-macro2", 789 - "quote", 790 - "syn 2.0.18", 791 - ] 792 - 793 - [[package]] 794 - name = "thread_local" 795 - version = "1.1.7" 796 - source = "registry+https://github.com/rust-lang/crates.io-index" 797 - checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" 798 - dependencies = [ 799 - "cfg-if", 800 - "once_cell", 801 - ] 802 - 803 - [[package]] 804 - name = "tokio" 805 - version = "1.28.2" 806 - source = "registry+https://github.com/rust-lang/crates.io-index" 807 - checksum = "94d7b1cfd2aa4011f2de74c2c4c63665e27a71006b0a192dcd2710272e73dfa2" 808 - dependencies = [ 809 - "autocfg", 810 - "bytes", 811 - "libc", 812 - "mio", 813 - "num_cpus", 814 - "parking_lot", 815 - "pin-project-lite", 816 - "signal-hook-registry", 817 - "socket2", 818 - "tokio-macros", 819 - "windows-sys 0.48.0", 820 - ] 821 - 822 - [[package]] 823 - name = "tokio-macros" 824 - version = "2.1.0" 825 - source = "registry+https://github.com/rust-lang/crates.io-index" 826 - checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" 827 - dependencies = [ 828 - "proc-macro2", 829 - "quote", 830 - "syn 2.0.18", 831 - ] 832 - 833 - [[package]] 834 - name = "tracing" 835 - version = "0.1.37" 836 - source = "registry+https://github.com/rust-lang/crates.io-index" 837 - checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" 838 - dependencies = [ 839 - "cfg-if", 840 - "pin-project-lite", 841 - "tracing-attributes", 842 - "tracing-core", 843 - ] 844 - 845 - [[package]] 846 - name = "tracing-attributes" 847 - version = "0.1.26" 848 - source = "registry+https://github.com/rust-lang/crates.io-index" 849 - checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" 850 - dependencies = [ 851 - "proc-macro2", 852 - "quote", 853 - "syn 2.0.18", 854 - ] 855 - 856 - [[package]] 857 - name = "tracing-core" 858 - version = "0.1.31" 859 - source = "registry+https://github.com/rust-lang/crates.io-index" 860 - checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" 861 - dependencies = [ 862 - "once_cell", 863 - "valuable", 864 - ] 865 - 866 - [[package]] 867 - name = "tracing-log" 868 - version = "0.1.3" 869 - source = "registry+https://github.com/rust-lang/crates.io-index" 870 - checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" 871 - dependencies = [ 872 - "lazy_static", 873 - "log", 874 - "tracing-core", 875 - ] 876 - 877 - [[package]] 878 - name = "tracing-subscriber" 879 - version = "0.3.17" 880 - source = "registry+https://github.com/rust-lang/crates.io-index" 881 - checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" 882 - dependencies = [ 883 - "nu-ansi-term", 884 - "sharded-slab", 885 - "smallvec", 886 - "thread_local", 887 - "tracing-core", 888 - "tracing-log", 889 - ] 890 - 891 - [[package]] 892 - name = "unescape" 893 - version = "0.1.0" 894 - source = "registry+https://github.com/rust-lang/crates.io-index" 895 - checksum = "ccb97dac3243214f8d8507998906ca3e2e0b900bf9bf4870477f125b82e68f6e" 896 - 897 - [[package]] 898 - name = "unicode-ident" 899 - version = "1.0.9" 900 - source = "registry+https://github.com/rust-lang/crates.io-index" 901 - checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" 902 - 903 - [[package]] 904 - name = "utf8parse" 905 - version = "0.2.1" 906 - source = "registry+https://github.com/rust-lang/crates.io-index" 907 - checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" 908 - 909 - [[package]] 910 - name = "valuable" 911 - version = "0.1.0" 912 - source = "registry+https://github.com/rust-lang/crates.io-index" 913 - checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" 914 - 915 - [[package]] 916 - name = "wasi" 917 - version = "0.11.0+wasi-snapshot-preview1" 918 - source = "registry+https://github.com/rust-lang/crates.io-index" 919 - checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 920 - 921 - [[package]] 922 - name = "which" 923 - version = "4.4.0" 924 - source = "registry+https://github.com/rust-lang/crates.io-index" 925 - checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" 926 - dependencies = [ 927 - "either", 928 - "libc", 929 - "once_cell", 930 - ] 931 - 932 - [[package]] 933 - name = "winapi" 934 - version = "0.3.9" 935 - source = "registry+https://github.com/rust-lang/crates.io-index" 936 - checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 937 - dependencies = [ 938 - "winapi-i686-pc-windows-gnu", 939 - "winapi-x86_64-pc-windows-gnu", 940 - ] 941 - 942 - [[package]] 943 - name = "winapi-i686-pc-windows-gnu" 944 - version = "0.4.0" 945 - source = "registry+https://github.com/rust-lang/crates.io-index" 946 - checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 947 - 948 - [[package]] 949 - name = "winapi-x86_64-pc-windows-gnu" 950 - version = "0.4.0" 951 - source = "registry+https://github.com/rust-lang/crates.io-index" 952 - checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 953 - 954 - [[package]] 955 - name = "windows-sys" 956 - version = "0.45.0" 957 - source = "registry+https://github.com/rust-lang/crates.io-index" 958 - checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" 959 - dependencies = [ 960 - "windows-targets 0.42.2", 961 - ] 962 - 963 - [[package]] 964 - name = "windows-sys" 965 - version = "0.48.0" 966 - source = "registry+https://github.com/rust-lang/crates.io-index" 967 - checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" 968 - dependencies = [ 969 - "windows-targets 0.48.0", 970 - ] 971 - 972 - [[package]] 973 - name = "windows-targets" 974 - version = "0.42.2" 975 - source = "registry+https://github.com/rust-lang/crates.io-index" 976 - checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" 977 - dependencies = [ 978 - "windows_aarch64_gnullvm 0.42.2", 979 - "windows_aarch64_msvc 0.42.2", 980 - "windows_i686_gnu 0.42.2", 981 - "windows_i686_msvc 0.42.2", 982 - "windows_x86_64_gnu 0.42.2", 983 - "windows_x86_64_gnullvm 0.42.2", 984 - "windows_x86_64_msvc 0.42.2", 985 - ] 986 - 987 - [[package]] 988 - name = "windows-targets" 989 - version = "0.48.0" 990 - source = "registry+https://github.com/rust-lang/crates.io-index" 991 - checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" 992 - dependencies = [ 993 - "windows_aarch64_gnullvm 0.48.0", 994 - "windows_aarch64_msvc 0.48.0", 995 - "windows_i686_gnu 0.48.0", 996 - "windows_i686_msvc 0.48.0", 997 - "windows_x86_64_gnu 0.48.0", 998 - "windows_x86_64_gnullvm 0.48.0", 999 - "windows_x86_64_msvc 0.48.0", 1000 - ] 1001 - 1002 - [[package]] 1003 - name = "windows_aarch64_gnullvm" 1004 - version = "0.42.2" 1005 - source = "registry+https://github.com/rust-lang/crates.io-index" 1006 - checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" 1007 - 1008 - [[package]] 1009 - name = "windows_aarch64_gnullvm" 1010 - version = "0.48.0" 1011 - source = "registry+https://github.com/rust-lang/crates.io-index" 1012 - checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" 1013 - 1014 - [[package]] 1015 - name = "windows_aarch64_msvc" 1016 - version = "0.42.2" 1017 - source = "registry+https://github.com/rust-lang/crates.io-index" 1018 - checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" 1019 - 1020 - [[package]] 1021 - name = "windows_aarch64_msvc" 1022 - version = "0.48.0" 1023 - source = "registry+https://github.com/rust-lang/crates.io-index" 1024 - checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" 1025 - 1026 - [[package]] 1027 - name = "windows_i686_gnu" 1028 - version = "0.42.2" 1029 - source = "registry+https://github.com/rust-lang/crates.io-index" 1030 - checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" 1031 - 1032 - [[package]] 1033 - name = "windows_i686_gnu" 1034 - version = "0.48.0" 1035 - source = "registry+https://github.com/rust-lang/crates.io-index" 1036 - checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" 1037 - 1038 - [[package]] 1039 - name = "windows_i686_msvc" 1040 - version = "0.42.2" 1041 - source = "registry+https://github.com/rust-lang/crates.io-index" 1042 - checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" 1043 - 1044 - [[package]] 1045 - name = "windows_i686_msvc" 1046 - version = "0.48.0" 1047 - source = "registry+https://github.com/rust-lang/crates.io-index" 1048 - checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" 1049 - 1050 - [[package]] 1051 - name = "windows_x86_64_gnu" 1052 - version = "0.42.2" 1053 - source = "registry+https://github.com/rust-lang/crates.io-index" 1054 - checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" 1055 - 1056 - [[package]] 1057 - name = "windows_x86_64_gnu" 1058 - version = "0.48.0" 1059 - source = "registry+https://github.com/rust-lang/crates.io-index" 1060 - checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" 1061 - 1062 - [[package]] 1063 - name = "windows_x86_64_gnullvm" 1064 - version = "0.42.2" 1065 - source = "registry+https://github.com/rust-lang/crates.io-index" 1066 - checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" 1067 - 1068 - [[package]] 1069 - name = "windows_x86_64_gnullvm" 1070 - version = "0.48.0" 1071 - source = "registry+https://github.com/rust-lang/crates.io-index" 1072 - checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" 1073 - 1074 - [[package]] 1075 - name = "windows_x86_64_msvc" 1076 - version = "0.42.2" 1077 - source = "registry+https://github.com/rust-lang/crates.io-index" 1078 - checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" 1079 - 1080 - [[package]] 1081 - name = "windows_x86_64_msvc" 1082 - version = "0.48.0" 1083 - source = "registry+https://github.com/rust-lang/crates.io-index" 1084 - checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a"
-18
safir/Cargo.toml
··· 1 - [package] 2 - name = "safir" 3 - version = "0.9.0" 4 - edition = "2021" 5 - authors = ["Graham Keenan graham.keenan@outlook.com"] 6 - license = "MIT OR Apache-2.0" 7 - description = "Key/Value store to share values between different shell sessions" 8 - readme = "README.md" 9 - homepage = "https://github.com/Tyrannican/safir" 10 - repository = "https://github.com/Tyrannican/safir" 11 - keywords = ["cli", "terminal", "utility", "key-value", "store"] 12 - categories = ["command-line-utilities"] 13 - 14 - [dependencies] 15 - clap = { version = "4.2.5" , features = ["derive"] } 16 - anyhow = "1.0.75" 17 - dirs = "5.0.1" 18 - serde_json = "1.0.108"
safir/LICENSE-APACHE LICENSE-APACHE
safir/LICENSE-MIT LICENSE-MIT
-105
safir/README.md
··· 1 - # Safir 2 - 3 - Simple CLI key/value store. 4 - 5 - Store key/value pairs in the terminal and retrieve them later for use like in different shell sessions. 6 - 7 - ## Install 8 - 9 - To install `safir`, run `cargo install safir`. 10 - 11 - To build from source, clone the repository and run: 12 - 13 - ```bash 14 - cargo build --release 15 - ``` 16 - 17 - Then move the binary to somewhere in your `$PATH` 18 - 19 - ## Usage 20 - 21 - When `safir` is run, it creates a store file in your `$HOME` directory (`$HOME/.safirstore/safirstore.json`). 22 - 23 - Run `safir --help` for usage: 24 - 25 - ```bash 26 - Key/Value store to share information between shell sessions 27 - 28 - Usage: safir <COMMAND> 29 - 30 - Commands: 31 - add Add a value to the store with the given key 32 - get Get values from the store 33 - rm Remove values from the store 34 - alias Output the alias command for key / value pairs 35 - export Output the export command for a key / value pairs 36 - list List all values in the store 37 - clear Clear all keys/values from the store 38 - purge Purges the .safirstore directory, removing it and its contents 39 - help Print this message or the help of the given subcommand(s) 40 - 41 - Options: 42 - -h, --help Print help 43 - -V, --version Print version 44 - ``` 45 - 46 - ## Examples 47 - 48 - Adding a key and value to the store: 49 - 50 - ```bash 51 - safir add api_key "api_key_value" 52 - ``` 53 - 54 - Retrieving a value from the store: 55 - 56 - ```bash 57 - safir get api_key 58 - # api_key="api_key_value" 59 - ``` 60 - 61 - Removing a value from the store: 62 - 63 - ```bash 64 - safir rm api_key 65 - ``` 66 - 67 - List all values in the store: 68 - 69 - ```bash 70 - safir list 71 - 72 - # api_key="api_key_value" 73 - # another_api_key="another_value" 74 - ``` 75 - 76 - Exporting a value: 77 - 78 - ```bash 79 - safir export api_key 80 - # export api_key="api_key_value" 81 - 82 - $(safir export api_key) # <-- Will export the value to the current shell 83 - ``` 84 - 85 - Aliasing a value: 86 - 87 - ```bash 88 - safir alias long_command 89 - # alias long_command="cd build/ && make && sudo make install" 90 - 91 - $(safir alias long_command) # <-- Will alias the command in the current shell 92 - ``` 93 - 94 - Clear the store: 95 - 96 - ```bash 97 - safir clear 98 - # Will remove all contents in the store 99 - ``` 100 - 101 - Purge the store (remove EVERYTHING `safir` related) 102 - 103 - ```bash 104 - safir purge # Will remove the .safirstore directory 105 - ```
safir/src/cli.rs src/cli.rs
safir/src/main.rs src/main.rs
safir/src/store.rs src/store.rs
safir/src/utils.rs src/utils.rs