├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── NOTICE ├── README.md ├── install.sh └── src ├── args.rs ├── macros.rs ├── main.rs └── utils.rs /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | **/*.rs.bk 3 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "adler32" 5 | version = "1.0.4" 6 | source = "registry+https://github.com/rust-lang/crates.io-index" 7 | 8 | [[package]] 9 | name = "aho-corasick" 10 | version = "0.7.6" 11 | source = "registry+https://github.com/rust-lang/crates.io-index" 12 | dependencies = [ 13 | "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 14 | ] 15 | 16 | [[package]] 17 | name = "ansi_term" 18 | version = "0.11.0" 19 | source = "registry+https://github.com/rust-lang/crates.io-index" 20 | dependencies = [ 21 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", 22 | ] 23 | 24 | [[package]] 25 | name = "arrayref" 26 | version = "0.3.5" 27 | source = "registry+https://github.com/rust-lang/crates.io-index" 28 | 29 | [[package]] 30 | name = "arrayvec" 31 | version = "0.4.12" 32 | source = "registry+https://github.com/rust-lang/crates.io-index" 33 | dependencies = [ 34 | "nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", 35 | ] 36 | 37 | [[package]] 38 | name = "atty" 39 | version = "0.2.13" 40 | source = "registry+https://github.com/rust-lang/crates.io-index" 41 | dependencies = [ 42 | "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", 43 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", 44 | ] 45 | 46 | [[package]] 47 | name = "autocfg" 48 | version = "0.1.7" 49 | source = "registry+https://github.com/rust-lang/crates.io-index" 50 | 51 | [[package]] 52 | name = "backtrace" 53 | version = "0.3.40" 54 | source = "registry+https://github.com/rust-lang/crates.io-index" 55 | dependencies = [ 56 | "backtrace-sys 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", 57 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", 58 | "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", 59 | "rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", 60 | ] 61 | 62 | [[package]] 63 | name = "backtrace-sys" 64 | version = "0.1.32" 65 | source = "registry+https://github.com/rust-lang/crates.io-index" 66 | dependencies = [ 67 | "cc 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", 68 | "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", 69 | ] 70 | 71 | [[package]] 72 | name = "base64" 73 | version = "0.10.1" 74 | source = "registry+https://github.com/rust-lang/crates.io-index" 75 | dependencies = [ 76 | "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", 77 | ] 78 | 79 | [[package]] 80 | name = "bitflags" 81 | version = "1.2.1" 82 | source = "registry+https://github.com/rust-lang/crates.io-index" 83 | 84 | [[package]] 85 | name = "blake2b_simd" 86 | version = "0.5.8" 87 | source = "registry+https://github.com/rust-lang/crates.io-index" 88 | dependencies = [ 89 | "arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 90 | "arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", 91 | "constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 92 | ] 93 | 94 | [[package]] 95 | name = "byteorder" 96 | version = "1.3.2" 97 | source = "registry+https://github.com/rust-lang/crates.io-index" 98 | 99 | [[package]] 100 | name = "c2-chacha" 101 | version = "0.2.3" 102 | source = "registry+https://github.com/rust-lang/crates.io-index" 103 | dependencies = [ 104 | "ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", 105 | ] 106 | 107 | [[package]] 108 | name = "cc" 109 | version = "1.0.46" 110 | source = "registry+https://github.com/rust-lang/crates.io-index" 111 | 112 | [[package]] 113 | name = "cfg-if" 114 | version = "0.1.10" 115 | source = "registry+https://github.com/rust-lang/crates.io-index" 116 | 117 | [[package]] 118 | name = "checked_int_cast" 119 | version = "1.0.0" 120 | source = "registry+https://github.com/rust-lang/crates.io-index" 121 | 122 | [[package]] 123 | name = "clap" 124 | version = "2.33.0" 125 | source = "registry+https://github.com/rust-lang/crates.io-index" 126 | dependencies = [ 127 | "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", 128 | "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", 129 | "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 130 | "strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", 131 | "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", 132 | "unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", 133 | "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", 134 | ] 135 | 136 | [[package]] 137 | name = "cloudabi" 138 | version = "0.0.3" 139 | source = "registry+https://github.com/rust-lang/crates.io-index" 140 | dependencies = [ 141 | "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 142 | ] 143 | 144 | [[package]] 145 | name = "color_quant" 146 | version = "1.0.1" 147 | source = "registry+https://github.com/rust-lang/crates.io-index" 148 | 149 | [[package]] 150 | name = "colorskill" 151 | version = "1.1.3" 152 | source = "registry+https://github.com/rust-lang/crates.io-index" 153 | dependencies = [ 154 | "colorsys 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", 155 | "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", 156 | ] 157 | 158 | [[package]] 159 | name = "colorsys" 160 | version = "0.5.3" 161 | source = "registry+https://github.com/rust-lang/crates.io-index" 162 | 163 | [[package]] 164 | name = "constant_time_eq" 165 | version = "0.1.4" 166 | source = "registry+https://github.com/rust-lang/crates.io-index" 167 | 168 | [[package]] 169 | name = "crc32fast" 170 | version = "1.2.0" 171 | source = "registry+https://github.com/rust-lang/crates.io-index" 172 | dependencies = [ 173 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", 174 | ] 175 | 176 | [[package]] 177 | name = "crossbeam-deque" 178 | version = "0.7.1" 179 | source = "registry+https://github.com/rust-lang/crates.io-index" 180 | dependencies = [ 181 | "crossbeam-epoch 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", 182 | "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", 183 | ] 184 | 185 | [[package]] 186 | name = "crossbeam-epoch" 187 | version = "0.7.2" 188 | source = "registry+https://github.com/rust-lang/crates.io-index" 189 | dependencies = [ 190 | "arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", 191 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", 192 | "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", 193 | "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 194 | "memoffset 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", 195 | "scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 196 | ] 197 | 198 | [[package]] 199 | name = "crossbeam-queue" 200 | version = "0.1.2" 201 | source = "registry+https://github.com/rust-lang/crates.io-index" 202 | dependencies = [ 203 | "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", 204 | ] 205 | 206 | [[package]] 207 | name = "crossbeam-utils" 208 | version = "0.6.6" 209 | source = "registry+https://github.com/rust-lang/crates.io-index" 210 | dependencies = [ 211 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", 212 | "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 213 | ] 214 | 215 | [[package]] 216 | name = "deflate" 217 | version = "0.7.20" 218 | source = "registry+https://github.com/rust-lang/crates.io-index" 219 | dependencies = [ 220 | "adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", 221 | "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", 222 | ] 223 | 224 | [[package]] 225 | name = "dirs" 226 | version = "2.0.2" 227 | source = "registry+https://github.com/rust-lang/crates.io-index" 228 | dependencies = [ 229 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", 230 | "dirs-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 231 | ] 232 | 233 | [[package]] 234 | name = "dirs-sys" 235 | version = "0.3.4" 236 | source = "registry+https://github.com/rust-lang/crates.io-index" 237 | dependencies = [ 238 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", 239 | "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", 240 | "redox_users 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", 241 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", 242 | ] 243 | 244 | [[package]] 245 | name = "either" 246 | version = "1.5.3" 247 | source = "registry+https://github.com/rust-lang/crates.io-index" 248 | 249 | [[package]] 250 | name = "failure" 251 | version = "0.1.6" 252 | source = "registry+https://github.com/rust-lang/crates.io-index" 253 | dependencies = [ 254 | "backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)", 255 | "failure_derive 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", 256 | ] 257 | 258 | [[package]] 259 | name = "failure_derive" 260 | version = "0.1.6" 261 | source = "registry+https://github.com/rust-lang/crates.io-index" 262 | dependencies = [ 263 | "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", 264 | "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 265 | "syn 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", 266 | "synstructure 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", 267 | ] 268 | 269 | [[package]] 270 | name = "fuchsia-cprng" 271 | version = "0.1.1" 272 | source = "registry+https://github.com/rust-lang/crates.io-index" 273 | 274 | [[package]] 275 | name = "getrandom" 276 | version = "0.1.13" 277 | source = "registry+https://github.com/rust-lang/crates.io-index" 278 | dependencies = [ 279 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", 280 | "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", 281 | "wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", 282 | ] 283 | 284 | [[package]] 285 | name = "gif" 286 | version = "0.10.3" 287 | source = "registry+https://github.com/rust-lang/crates.io-index" 288 | dependencies = [ 289 | "color_quant 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", 290 | "lzw 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", 291 | ] 292 | 293 | [[package]] 294 | name = "hermit-abi" 295 | version = "0.1.3" 296 | source = "registry+https://github.com/rust-lang/crates.io-index" 297 | dependencies = [ 298 | "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", 299 | ] 300 | 301 | [[package]] 302 | name = "image" 303 | version = "0.22.3" 304 | source = "registry+https://github.com/rust-lang/crates.io-index" 305 | dependencies = [ 306 | "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", 307 | "gif 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)", 308 | "jpeg-decoder 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", 309 | "num-iter 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", 310 | "num-rational 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 311 | "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 312 | "png 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", 313 | "scoped_threadpool 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", 314 | "tiff 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", 315 | ] 316 | 317 | [[package]] 318 | name = "inflate" 319 | version = "0.4.5" 320 | source = "registry+https://github.com/rust-lang/crates.io-index" 321 | dependencies = [ 322 | "adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", 323 | ] 324 | 325 | [[package]] 326 | name = "jpeg-decoder" 327 | version = "0.1.16" 328 | source = "registry+https://github.com/rust-lang/crates.io-index" 329 | dependencies = [ 330 | "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", 331 | "rayon 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 332 | ] 333 | 334 | [[package]] 335 | name = "lazy_static" 336 | version = "1.4.0" 337 | source = "registry+https://github.com/rust-lang/crates.io-index" 338 | 339 | [[package]] 340 | name = "libc" 341 | version = "0.2.65" 342 | source = "registry+https://github.com/rust-lang/crates.io-index" 343 | 344 | [[package]] 345 | name = "lzw" 346 | version = "0.10.0" 347 | source = "registry+https://github.com/rust-lang/crates.io-index" 348 | 349 | [[package]] 350 | name = "memchr" 351 | version = "2.2.1" 352 | source = "registry+https://github.com/rust-lang/crates.io-index" 353 | 354 | [[package]] 355 | name = "memoffset" 356 | version = "0.5.2" 357 | source = "registry+https://github.com/rust-lang/crates.io-index" 358 | dependencies = [ 359 | "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", 360 | ] 361 | 362 | [[package]] 363 | name = "nodrop" 364 | version = "0.1.14" 365 | source = "registry+https://github.com/rust-lang/crates.io-index" 366 | 367 | [[package]] 368 | name = "num-derive" 369 | version = "0.2.5" 370 | source = "registry+https://github.com/rust-lang/crates.io-index" 371 | dependencies = [ 372 | "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", 373 | "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", 374 | "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", 375 | ] 376 | 377 | [[package]] 378 | name = "num-integer" 379 | version = "0.1.41" 380 | source = "registry+https://github.com/rust-lang/crates.io-index" 381 | dependencies = [ 382 | "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", 383 | "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 384 | ] 385 | 386 | [[package]] 387 | name = "num-iter" 388 | version = "0.1.39" 389 | source = "registry+https://github.com/rust-lang/crates.io-index" 390 | dependencies = [ 391 | "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", 392 | "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", 393 | "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 394 | ] 395 | 396 | [[package]] 397 | name = "num-rational" 398 | version = "0.2.2" 399 | source = "registry+https://github.com/rust-lang/crates.io-index" 400 | dependencies = [ 401 | "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", 402 | "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", 403 | "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 404 | ] 405 | 406 | [[package]] 407 | name = "num-traits" 408 | version = "0.2.8" 409 | source = "registry+https://github.com/rust-lang/crates.io-index" 410 | dependencies = [ 411 | "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", 412 | ] 413 | 414 | [[package]] 415 | name = "num_cpus" 416 | version = "1.11.0" 417 | source = "registry+https://github.com/rust-lang/crates.io-index" 418 | dependencies = [ 419 | "hermit-abi 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", 420 | "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", 421 | ] 422 | 423 | [[package]] 424 | name = "numtoa" 425 | version = "0.1.0" 426 | source = "registry+https://github.com/rust-lang/crates.io-index" 427 | 428 | [[package]] 429 | name = "png" 430 | version = "0.15.0" 431 | source = "registry+https://github.com/rust-lang/crates.io-index" 432 | dependencies = [ 433 | "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 434 | "crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 435 | "deflate 0.7.20 (registry+https://github.com/rust-lang/crates.io-index)", 436 | "inflate 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", 437 | ] 438 | 439 | [[package]] 440 | name = "ppv-lite86" 441 | version = "0.2.6" 442 | source = "registry+https://github.com/rust-lang/crates.io-index" 443 | 444 | [[package]] 445 | name = "proc-macro2" 446 | version = "0.4.30" 447 | source = "registry+https://github.com/rust-lang/crates.io-index" 448 | dependencies = [ 449 | "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 450 | ] 451 | 452 | [[package]] 453 | name = "proc-macro2" 454 | version = "1.0.6" 455 | source = "registry+https://github.com/rust-lang/crates.io-index" 456 | dependencies = [ 457 | "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 458 | ] 459 | 460 | [[package]] 461 | name = "qool" 462 | version = "0.1.0" 463 | dependencies = [ 464 | "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", 465 | "colorskill 1.1.3 (registry+https://github.com/rust-lang/crates.io-index)", 466 | "dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 467 | "image 0.22.3 (registry+https://github.com/rust-lang/crates.io-index)", 468 | "qrcode 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", 469 | "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", 470 | "termion 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", 471 | ] 472 | 473 | [[package]] 474 | name = "qrcode" 475 | version = "0.11.0" 476 | source = "registry+https://github.com/rust-lang/crates.io-index" 477 | dependencies = [ 478 | "checked_int_cast 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 479 | "image 0.22.3 (registry+https://github.com/rust-lang/crates.io-index)", 480 | ] 481 | 482 | [[package]] 483 | name = "quote" 484 | version = "0.6.13" 485 | source = "registry+https://github.com/rust-lang/crates.io-index" 486 | dependencies = [ 487 | "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", 488 | ] 489 | 490 | [[package]] 491 | name = "quote" 492 | version = "1.0.2" 493 | source = "registry+https://github.com/rust-lang/crates.io-index" 494 | dependencies = [ 495 | "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", 496 | ] 497 | 498 | [[package]] 499 | name = "rand" 500 | version = "0.7.2" 501 | source = "registry+https://github.com/rust-lang/crates.io-index" 502 | dependencies = [ 503 | "getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", 504 | "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", 505 | "rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 506 | "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", 507 | "rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 508 | ] 509 | 510 | [[package]] 511 | name = "rand_chacha" 512 | version = "0.2.1" 513 | source = "registry+https://github.com/rust-lang/crates.io-index" 514 | dependencies = [ 515 | "c2-chacha 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", 516 | "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", 517 | ] 518 | 519 | [[package]] 520 | name = "rand_core" 521 | version = "0.3.1" 522 | source = "registry+https://github.com/rust-lang/crates.io-index" 523 | dependencies = [ 524 | "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", 525 | ] 526 | 527 | [[package]] 528 | name = "rand_core" 529 | version = "0.4.2" 530 | source = "registry+https://github.com/rust-lang/crates.io-index" 531 | 532 | [[package]] 533 | name = "rand_core" 534 | version = "0.5.1" 535 | source = "registry+https://github.com/rust-lang/crates.io-index" 536 | dependencies = [ 537 | "getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", 538 | ] 539 | 540 | [[package]] 541 | name = "rand_hc" 542 | version = "0.2.0" 543 | source = "registry+https://github.com/rust-lang/crates.io-index" 544 | dependencies = [ 545 | "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", 546 | ] 547 | 548 | [[package]] 549 | name = "rand_os" 550 | version = "0.1.3" 551 | source = "registry+https://github.com/rust-lang/crates.io-index" 552 | dependencies = [ 553 | "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", 554 | "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 555 | "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", 556 | "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", 557 | "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 558 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", 559 | ] 560 | 561 | [[package]] 562 | name = "rayon" 563 | version = "1.2.0" 564 | source = "registry+https://github.com/rust-lang/crates.io-index" 565 | dependencies = [ 566 | "crossbeam-deque 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", 567 | "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", 568 | "rayon-core 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)", 569 | ] 570 | 571 | [[package]] 572 | name = "rayon-core" 573 | version = "1.6.0" 574 | source = "registry+https://github.com/rust-lang/crates.io-index" 575 | dependencies = [ 576 | "crossbeam-deque 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", 577 | "crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", 578 | "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", 579 | "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 580 | "num_cpus 1.11.0 (registry+https://github.com/rust-lang/crates.io-index)", 581 | ] 582 | 583 | [[package]] 584 | name = "rdrand" 585 | version = "0.4.0" 586 | source = "registry+https://github.com/rust-lang/crates.io-index" 587 | dependencies = [ 588 | "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", 589 | ] 590 | 591 | [[package]] 592 | name = "redox_syscall" 593 | version = "0.1.56" 594 | source = "registry+https://github.com/rust-lang/crates.io-index" 595 | 596 | [[package]] 597 | name = "redox_termios" 598 | version = "0.1.1" 599 | source = "registry+https://github.com/rust-lang/crates.io-index" 600 | dependencies = [ 601 | "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", 602 | ] 603 | 604 | [[package]] 605 | name = "redox_users" 606 | version = "0.3.1" 607 | source = "registry+https://github.com/rust-lang/crates.io-index" 608 | dependencies = [ 609 | "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", 610 | "rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", 611 | "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", 612 | "rust-argon2 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", 613 | ] 614 | 615 | [[package]] 616 | name = "regex" 617 | version = "1.3.1" 618 | source = "registry+https://github.com/rust-lang/crates.io-index" 619 | dependencies = [ 620 | "aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", 621 | "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 622 | "regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", 623 | "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", 624 | ] 625 | 626 | [[package]] 627 | name = "regex-syntax" 628 | version = "0.6.12" 629 | source = "registry+https://github.com/rust-lang/crates.io-index" 630 | 631 | [[package]] 632 | name = "rust-argon2" 633 | version = "0.5.1" 634 | source = "registry+https://github.com/rust-lang/crates.io-index" 635 | dependencies = [ 636 | "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", 637 | "blake2b_simd 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)", 638 | "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", 639 | ] 640 | 641 | [[package]] 642 | name = "rustc-demangle" 643 | version = "0.1.16" 644 | source = "registry+https://github.com/rust-lang/crates.io-index" 645 | 646 | [[package]] 647 | name = "rustc_version" 648 | version = "0.2.3" 649 | source = "registry+https://github.com/rust-lang/crates.io-index" 650 | dependencies = [ 651 | "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", 652 | ] 653 | 654 | [[package]] 655 | name = "scoped_threadpool" 656 | version = "0.1.9" 657 | source = "registry+https://github.com/rust-lang/crates.io-index" 658 | 659 | [[package]] 660 | name = "scopeguard" 661 | version = "1.0.0" 662 | source = "registry+https://github.com/rust-lang/crates.io-index" 663 | 664 | [[package]] 665 | name = "semver" 666 | version = "0.9.0" 667 | source = "registry+https://github.com/rust-lang/crates.io-index" 668 | dependencies = [ 669 | "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", 670 | ] 671 | 672 | [[package]] 673 | name = "semver-parser" 674 | version = "0.7.0" 675 | source = "registry+https://github.com/rust-lang/crates.io-index" 676 | 677 | [[package]] 678 | name = "strsim" 679 | version = "0.8.0" 680 | source = "registry+https://github.com/rust-lang/crates.io-index" 681 | 682 | [[package]] 683 | name = "syn" 684 | version = "0.15.44" 685 | source = "registry+https://github.com/rust-lang/crates.io-index" 686 | dependencies = [ 687 | "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", 688 | "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", 689 | "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 690 | ] 691 | 692 | [[package]] 693 | name = "syn" 694 | version = "1.0.7" 695 | source = "registry+https://github.com/rust-lang/crates.io-index" 696 | dependencies = [ 697 | "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", 698 | "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 699 | "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 700 | ] 701 | 702 | [[package]] 703 | name = "synstructure" 704 | version = "0.12.1" 705 | source = "registry+https://github.com/rust-lang/crates.io-index" 706 | dependencies = [ 707 | "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", 708 | "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 709 | "syn 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", 710 | "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 711 | ] 712 | 713 | [[package]] 714 | name = "termion" 715 | version = "1.5.3" 716 | source = "registry+https://github.com/rust-lang/crates.io-index" 717 | dependencies = [ 718 | "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", 719 | "numtoa 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 720 | "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", 721 | "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 722 | ] 723 | 724 | [[package]] 725 | name = "textwrap" 726 | version = "0.11.0" 727 | source = "registry+https://github.com/rust-lang/crates.io-index" 728 | dependencies = [ 729 | "unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", 730 | ] 731 | 732 | [[package]] 733 | name = "thread_local" 734 | version = "0.3.6" 735 | source = "registry+https://github.com/rust-lang/crates.io-index" 736 | dependencies = [ 737 | "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 738 | ] 739 | 740 | [[package]] 741 | name = "tiff" 742 | version = "0.3.1" 743 | source = "registry+https://github.com/rust-lang/crates.io-index" 744 | dependencies = [ 745 | "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", 746 | "lzw 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", 747 | "num-derive 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", 748 | "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 749 | ] 750 | 751 | [[package]] 752 | name = "unicode-width" 753 | version = "0.1.6" 754 | source = "registry+https://github.com/rust-lang/crates.io-index" 755 | 756 | [[package]] 757 | name = "unicode-xid" 758 | version = "0.1.0" 759 | source = "registry+https://github.com/rust-lang/crates.io-index" 760 | 761 | [[package]] 762 | name = "unicode-xid" 763 | version = "0.2.0" 764 | source = "registry+https://github.com/rust-lang/crates.io-index" 765 | 766 | [[package]] 767 | name = "vec_map" 768 | version = "0.8.1" 769 | source = "registry+https://github.com/rust-lang/crates.io-index" 770 | 771 | [[package]] 772 | name = "wasi" 773 | version = "0.7.0" 774 | source = "registry+https://github.com/rust-lang/crates.io-index" 775 | 776 | [[package]] 777 | name = "winapi" 778 | version = "0.3.8" 779 | source = "registry+https://github.com/rust-lang/crates.io-index" 780 | dependencies = [ 781 | "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 782 | "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 783 | ] 784 | 785 | [[package]] 786 | name = "winapi-i686-pc-windows-gnu" 787 | version = "0.4.0" 788 | source = "registry+https://github.com/rust-lang/crates.io-index" 789 | 790 | [[package]] 791 | name = "winapi-x86_64-pc-windows-gnu" 792 | version = "0.4.0" 793 | source = "registry+https://github.com/rust-lang/crates.io-index" 794 | 795 | [metadata] 796 | "checksum adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5d2e7343e7fc9de883d1b0341e0b13970f764c14101234857d2ddafa1cb1cac2" 797 | "checksum aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "58fb5e95d83b38284460a5fda7d6470aa0b8844d283a0b614b8535e880800d2d" 798 | "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" 799 | "checksum arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0d382e583f07208808f6b1249e60848879ba3543f57c32277bf52d69c2f0f0ee" 800 | "checksum arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" 801 | "checksum atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1803c647a3ec87095e7ae7acfca019e98de5ec9a7d01343f611cf3152ed71a90" 802 | "checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" 803 | "checksum backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)" = "924c76597f0d9ca25d762c25a4d369d51267536465dc5064bdf0eb073ed477ea" 804 | "checksum backtrace-sys 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "5d6575f128516de27e3ce99689419835fce9643a9b215a14d2b5b685be018491" 805 | "checksum base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" 806 | "checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" 807 | "checksum blake2b_simd 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)" = "5850aeee1552f495dd0250014cf64b82b7c8879a89d83b33bbdace2cc4f63182" 808 | "checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" 809 | "checksum c2-chacha 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "214238caa1bf3a496ec3392968969cab8549f96ff30652c9e56885329315f6bb" 810 | "checksum cc 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)" = "0213d356d3c4ea2c18c40b037c3be23cd639825c18f25ee670ac7813beeef99c" 811 | "checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" 812 | "checksum checked_int_cast 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17cc5e6b5ab06331c33589842070416baa137e8b0eb912b008cfd4a78ada7919" 813 | "checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" 814 | "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" 815 | "checksum color_quant 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0dbbb57365263e881e805dc77d94697c9118fd94d8da011240555aa7b23445bd" 816 | "checksum colorskill 1.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e966ca2b0e941d8e8a16df9d9406a1615e65ff6a329535ce6acc922dc8af4aa9" 817 | "checksum colorsys 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a3d957eac53570fcf87197c233f103464dd5ec8e3f5e32a1adeb03cd20fd3d2c" 818 | "checksum constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "995a44c877f9212528ccc74b21a232f66ad69001e40ede5bcee2ac9ef2657120" 819 | "checksum crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" 820 | "checksum crossbeam-deque 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b18cd2e169ad86297e6bc0ad9aa679aee9daa4f19e8163860faf7c164e4f5a71" 821 | "checksum crossbeam-epoch 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "fedcd6772e37f3da2a9af9bf12ebe046c0dfe657992377b4df982a2b54cd37a9" 822 | "checksum crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7c979cd6cfe72335896575c6b5688da489e420d36a27a0b9eb0c73db574b4a4b" 823 | "checksum crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6" 824 | "checksum deflate 0.7.20 (registry+https://github.com/rust-lang/crates.io-index)" = "707b6a7b384888a70c8d2e8650b3e60170dfc6a67bb4aa67b6dfca57af4bedb4" 825 | "checksum dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "13aea89a5c93364a98e9b37b2fa237effbb694d5cfe01c5b70941f7eb087d5e3" 826 | "checksum dirs-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "afa0b23de8fd801745c471deffa6e12d248f962c9fd4b4c33787b055599bde7b" 827 | "checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" 828 | "checksum failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "f8273f13c977665c5db7eb2b99ae520952fe5ac831ae4cd09d80c4c7042b5ed9" 829 | "checksum failure_derive 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0bc225b78e0391e4b8683440bf2e63c2deeeb2ce5189eab46e2b68c6d3725d08" 830 | "checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" 831 | "checksum getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "e7db7ca94ed4cd01190ceee0d8a8052f08a247aa1b469a7f68c6a3b71afcf407" 832 | "checksum gif 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)" = "471d90201b3b223f3451cd4ad53e34295f16a1df17b1edf3736d47761c3981af" 833 | "checksum hermit-abi 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "307c3c9f937f38e3534b1d6447ecf090cafcc9744e4a6360e8b037b2cf5af120" 834 | "checksum image 0.22.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7b4be8aaefbe7545dc42ae925afb55a0098f226a3fe5ef721872806f44f57826" 835 | "checksum inflate 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "1cdb29978cc5797bd8dcc8e5bf7de604891df2a8dc576973d71a281e916db2ff" 836 | "checksum jpeg-decoder 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "c1aae18ffeeae409c6622c3b6a7ee49792a7e5a062eea1b135fbb74e301792ba" 837 | "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 838 | "checksum libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)" = "1a31a0627fdf1f6a39ec0dd577e101440b7db22672c0901fe00a9a6fbb5c24e8" 839 | "checksum lzw 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7d947cbb889ed21c2a84be6ffbaebf5b4e0f4340638cba0444907e38b56be084" 840 | "checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" 841 | "checksum memoffset 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a85c1a8c329f11437034d7313dca647c79096523533a1c79e86f1d0f657c7cc" 842 | "checksum nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" 843 | "checksum num-derive 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "eafd0b45c5537c3ba526f79d3e75120036502bebacbb3f3220914067ce39dbf2" 844 | "checksum num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" = "b85e541ef8255f6cf42bbfe4ef361305c6c135d10919ecc26126c4e5ae94bc09" 845 | "checksum num-iter 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "76bd5272412d173d6bf9afdf98db8612bbabc9a7a830b7bfc9c188911716132e" 846 | "checksum num-rational 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f2885278d5fe2adc2f75ced642d52d879bffaceb5a2e0b1d4309ffdfb239b454" 847 | "checksum num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "6ba9a427cfca2be13aa6f6403b0b7e7368fe982bfa16fccc450ce74c46cd9b32" 848 | "checksum num_cpus 1.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "155394f924cdddf08149da25bfb932d226b4a593ca7468b08191ff6335941af5" 849 | "checksum numtoa 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b8f8bdf33df195859076e54ab11ee78a1b208382d3a26ec40d142ffc1ecc49ef" 850 | "checksum png 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8422b27bb2c013dd97b9aef69e161ce262236f49aaf46a0489011c8ff0264602" 851 | "checksum ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" 852 | "checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" 853 | "checksum proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9c9e470a8dc4aeae2dee2f335e8f533e2d4b347e1434e5671afc49b054592f27" 854 | "checksum qrcode 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a0015bbb688c03b1ccc0b236fe1a1696d6481a309ca70941efb5e9417ae33de7" 855 | "checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" 856 | "checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" 857 | "checksum rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3ae1b169243eaf61759b8475a998f0a385e42042370f3a7dbaf35246eacc8412" 858 | "checksum rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "03a2a90da8c7523f554344f921aa97283eadf6ac484a6d2a7d0212fa7f8d6853" 859 | "checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" 860 | "checksum rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" 861 | "checksum rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" 862 | "checksum rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" 863 | "checksum rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" 864 | "checksum rayon 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "83a27732a533a1be0a0035a111fe76db89ad312f6f0347004c220c57f209a123" 865 | "checksum rayon-core 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "98dcf634205083b17d0861252431eb2acbfb698ab7478a2d20de07954f47ec7b" 866 | "checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" 867 | "checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" 868 | "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" 869 | "checksum redox_users 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ecedbca3bf205f8d8f5c2b44d83cd0690e39ee84b951ed649e9f1841132b66d" 870 | "checksum regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dc220bd33bdce8f093101afe22a037b8eb0e5af33592e6a9caafff0d4cb81cbd" 871 | "checksum regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "11a7e20d1cce64ef2fed88b66d347f88bd9babb82845b2b858f3edbf59a4f716" 872 | "checksum rust-argon2 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ca4eaef519b494d1f2848fc602d18816fed808a981aedf4f1f00ceb7c9d32cf" 873 | "checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" 874 | "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" 875 | "checksum scoped_threadpool 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "1d51f5df5af43ab3f1360b429fa5e0152ac5ce8c0bd6485cae490332e96846a8" 876 | "checksum scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d" 877 | "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" 878 | "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" 879 | "checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" 880 | "checksum syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)" = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" 881 | "checksum syn 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "0e7bedb3320d0f3035594b0b723c8a28d7d336a3eda3881db79e61d676fb644c" 882 | "checksum synstructure 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3f085a5855930c0441ca1288cf044ea4aecf4f43a91668abdb870b4ba546a203" 883 | "checksum termion 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6a8fb22f7cde82c8220e5aeacb3258ed7ce996142c77cba193f203515e26c330" 884 | "checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" 885 | "checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" 886 | "checksum tiff 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d7b7c2cfc4742bd8a32f2e614339dd8ce30dbcf676bb262bd63a2327bc5df57d" 887 | "checksum unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7007dbd421b92cc6e28410fe7362e2e0a2503394908f417b68ec8d1c364c4e20" 888 | "checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" 889 | "checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" 890 | "checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" 891 | "checksum wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b89c3ce4ce14bdc6fb6beaf9ec7928ca331de5df7e5ea278375642a2f478570d" 892 | "checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" 893 | "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 894 | "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 895 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "qool" 3 | version = "0.1.0" 4 | authors = ["madprops "] 5 | edition = "2018" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | colorskill = "1.1.3" 11 | qrcode = "0.11.0" 12 | image = "0.22.3" 13 | clap = "2.33.0" 14 | dirs = "2.0.2" 15 | regex = "1.3.1" 16 | termion = "1.5.3" -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 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, and distribution as defined by Sections 1 through 9 of this document. 10 | 11 | "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. 12 | 13 | "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. 14 | 15 | "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. 16 | 17 | "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. 18 | 19 | "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. 20 | 21 | "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). 22 | 23 | "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. 24 | 25 | "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." 26 | 27 | "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 28 | 29 | 2. Grant of Copyright License. 30 | 31 | Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 32 | 33 | 3. Grant of Patent License. 34 | 35 | Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 36 | 37 | 4. Redistribution. 38 | 39 | You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: 40 | 41 | You must give any other recipients of the Work or Derivative Works a copy of this License; and 42 | You must cause any modified files to carry prominent notices stating that You changed the files; and 43 | You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and 44 | If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. 45 | You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 46 | 47 | 5. Submission of Contributions. 48 | 49 | Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 50 | 51 | 6. Trademarks. 52 | 53 | This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 54 | 55 | 7. Disclaimer of Warranty. 56 | 57 | Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 58 | 59 | 8. Limitation of Liability. 60 | 61 | In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 62 | 63 | 9. Accepting Warranty or Additional Liability. 64 | 65 | While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. 66 | 67 | END OF TERMS AND CONDITIONS -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2019 Merkoba 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This is a frontend to [qrcode-rust](https://github.com/kennytm/qrcode-rust) that allows you to generate QR Code images and save them to a file. 2 | 3 | # Options 4 | 5 | - Text to encode 6 | - Path to save image 7 | - Approximate size of image 8 | - Dark color to use 9 | - Light color to use 10 | - Disable border space 11 | 12 | # Usage 13 | 14 | Basic use is: `qool "something to encode"` 15 | 16 | Quotation marks are necessary for text that contains spaces. 17 | 18 | With a path: `qool mySite /home/me/pics/qrimg.png` 19 | 20 | If no path is provided it will save images in `~/qool-codes/123.png` using the unix seconds for file names. 21 | 22 | ![](https://i.imgur.com/LrDnIzKl.jpg) 23 | 24 | Colors can be changed, though it might cause problems when scanning: 25 | 26 | `qool "this is some text to encode" --dark-color purple --light-color pink` 27 | 28 | ![](https://i.imgur.com/mdbOyiAl.jpg) 29 | 30 | # More Examples 31 | 32 | `qool cats ~/qr/cat.jpg --no-border` 33 | 34 | `qool squirrels /home/me/pics/qr/sq.png --size 900 --dark-color grey` 35 | 36 | # Print 37 | 38 | The code can be printed to the terminal instead. 39 | 40 | ![](https://i.imgur.com/gZjmn1Rl.jpg) 41 | 42 | # Installation 43 | 44 | The Rust compiler is required. 45 | 46 | Download zip and execute `install.sh` 47 | 48 | This will place an executable in /bin/qool 49 | 50 | # Help 51 | 52 | run `qool --help` to check all available arguments. -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | cargo build --release 2 | sudo mv target/release/qool /bin/qool 3 | -------------------------------------------------------------------------------- /src/args.rs: -------------------------------------------------------------------------------- 1 | use crate:: 2 | { 3 | s, exit, 4 | VERSION, 5 | utils::*, 6 | }; 7 | 8 | use std:: 9 | { 10 | path::{PathBuf}, 11 | }; 12 | 13 | use clap::{App, Arg}; 14 | 15 | // Struct for settings 16 | pub struct Args 17 | { 18 | pub text: String, 19 | pub path: PathBuf, 20 | pub size: u32, 21 | pub dark_color: String, 22 | pub light_color: String, 23 | pub border: bool, 24 | pub print: bool, 25 | } 26 | 27 | // Start the argument system 28 | pub fn start_args() -> Args 29 | { 30 | let matches = App::new("qool") 31 | .version(VERSION) 32 | .about("Encrypted CLI Notepad") 33 | .arg(Arg::with_name("Text") 34 | .help("Text to be encoded") 35 | .required(true) 36 | .index(1)) 37 | .arg(Arg::with_name("Path") 38 | .help("File path to save the image") 39 | .required(false) 40 | .index(2)) 41 | .arg(Arg::with_name("size") 42 | .long("size") 43 | .value_name("size") 44 | .help("Approximate size of the image") 45 | .takes_value(true)) 46 | .arg(Arg::with_name("dark-color") 47 | .long("dark-color") 48 | .value_name("dark-color") 49 | .help("The dark color. This could be a name like red, green, blue, etc") 50 | .takes_value(true)) 51 | .arg(Arg::with_name("light-color") 52 | .long("light-color") 53 | .value_name("light-color") 54 | .help("The light color. This could be a name like red, green, blue, etc") 55 | .takes_value(true)) 56 | .arg(Arg::with_name("no-border") 57 | .long("no-border") 58 | .multiple(false) 59 | .help("Don't show a border around the QR code")) 60 | .arg(Arg::with_name("print") 61 | .long("print") 62 | .multiple(false) 63 | .help("Only print output to the terminal")) 64 | .get_matches(); 65 | 66 | let text = s!(matches.value_of("Text").unwrap()); 67 | 68 | let path = match matches.value_of("Path") 69 | { 70 | Some(pth) => PathBuf::from(pth), 71 | None => 72 | { 73 | home().join(PathBuf::from("qool-codes")) 74 | .join(format!("{}.png", name(&text))) 75 | } 76 | }; 77 | 78 | let size = match matches.value_of("size") 79 | { 80 | Some(sze) => 81 | { 82 | sze.parse::().unwrap_or_else(|_| 83 | { 84 | exit("Wrong size format."); 85 | }) 86 | }, 87 | None => 800 88 | }; 89 | 90 | let dark_color = match matches.value_of("dark-color") 91 | { 92 | Some(color) => s!(color), 93 | None => s!("black") 94 | }; 95 | 96 | let light_color = match matches.value_of("light-color") 97 | { 98 | Some(color) => s!(color), 99 | None => s!("white") 100 | }; 101 | 102 | let border = matches.occurrences_of("no-border") == 0; 103 | let print = matches.occurrences_of("print") > 0; 104 | 105 | Args 106 | { 107 | text, path, size, dark_color, 108 | light_color, border, print, 109 | } 110 | } -------------------------------------------------------------------------------- /src/macros.rs: -------------------------------------------------------------------------------- 1 | #[macro_export] 2 | macro_rules! p 3 | { 4 | ($left:expr, $right:expr) => 5 | { 6 | println!($left, $right); 7 | }; 8 | 9 | ($left:expr) => 10 | { 11 | println!("{}", $left); 12 | }; 13 | } 14 | 15 | #[macro_export] 16 | macro_rules! pp 17 | { 18 | ($left:expr, $right:expr) => 19 | { 20 | print!($left, $right); 21 | }; 22 | 23 | ($left:expr) => 24 | { 25 | print!("{}", $left); 26 | }; 27 | } 28 | 29 | #[macro_export] 30 | macro_rules! s 31 | { 32 | ($s: expr) => 33 | { 34 | $s.to_string() 35 | }; 36 | 37 | () => 38 | { 39 | String::new() 40 | }; 41 | } 42 | 43 | #[macro_export] 44 | macro_rules! hashmap 45 | { 46 | ($( $key: expr => $val: expr ),*) => {{ 47 | let mut map = ::std::collections::HashMap::new(); 48 | $( map.insert($key, $val); )* 49 | map 50 | }} 51 | } -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | pub const VERSION: &str = "1.2.0"; 2 | 3 | mod macros; 4 | mod args; 5 | mod utils; 6 | 7 | use crate:: 8 | { 9 | args::*, 10 | utils::*, 11 | }; 12 | 13 | use std:: 14 | { 15 | fs, process, 16 | }; 17 | 18 | use qrcode::QrCode; 19 | use image::Rgb; 20 | 21 | // Program starts here 22 | fn main() 23 | { 24 | let args = start_args(); 25 | if args.print {print_code(args)} 26 | else {make_image(args)} 27 | } 28 | 29 | // Exit the program 30 | fn exit(s: &str) -> ! 31 | { 32 | p!(s); 33 | process::exit(0) 34 | } 35 | 36 | // Make the QR Code image 37 | // using the specified settings 38 | fn make_image(args: Args) 39 | { 40 | // Render the bits into an image. 41 | let image = QrCode::new(args.text.as_bytes()).unwrap() 42 | .render::>() 43 | .dark_color(color(&args.dark_color)) 44 | .light_color(color(&args.light_color)) 45 | .min_dimensions(args.size, args.size) 46 | .max_dimensions(args.size, args.size) 47 | .quiet_zone(args.border) 48 | .build(); 49 | 50 | // Get the file's parent directory 51 | let parent = &args.path.parent().unwrap_or_else(|| 52 | { 53 | exit("Can't get file's parent."); 54 | }); 55 | 56 | // Create directories if they don't exist 57 | fs::create_dir_all(parent).unwrap_or_else(|_| 58 | { 59 | exit("Couldn't create directories."); 60 | }); 61 | 62 | // Save the image. 63 | image.save(&args.path).unwrap_or_else(|_| 64 | { 65 | exit("Couldn't save image."); 66 | }); 67 | 68 | let s = format!("\n{}Saved{} {}\n", 69 | termion::color::Fg(termion::color::Green), 70 | termion::color::Fg(termion::color::Reset), 71 | args.path.to_str().unwrap()); 72 | 73 | p!(s); 74 | } 75 | 76 | fn print_code(args: Args) 77 | { 78 | let code = QrCode::new(args.text.as_bytes()).unwrap(); 79 | 80 | let string = code.render::() 81 | .quiet_zone(args.border) 82 | .module_dimensions(2, 1) 83 | .build(); 84 | 85 | println!("{}", string); 86 | } -------------------------------------------------------------------------------- /src/utils.rs: -------------------------------------------------------------------------------- 1 | use crate:: 2 | { 3 | s, 4 | }; 5 | 6 | use std:: 7 | { 8 | path::{PathBuf}, 9 | time::{SystemTime, UNIX_EPOCH}, 10 | }; 11 | 12 | use image::Rgb; 13 | use regex::Regex; 14 | use colorskill::color_name_to_rgb; 15 | 16 | // Get the home directory 17 | pub fn home() -> PathBuf 18 | { 19 | dirs::home_dir().unwrap() 20 | } 21 | 22 | // Get the unix time in seconds 23 | pub fn now() -> u64 24 | { 25 | SystemTime::now().duration_since(UNIX_EPOCH) 26 | .unwrap().as_secs() 27 | } 28 | 29 | // Get a color Rgb by name 30 | pub fn color(s: &str) -> Rgb 31 | { 32 | let t = color_name_to_rgb(s, (0, 0, 0)); 33 | Rgb([t.0, t.1, t.2]) 34 | } 35 | 36 | // Get a proper file name 37 | pub fn name(s: &str) -> String 38 | { 39 | let mut name = s.replace("https://", ""); 40 | name = name.replace("http://", ""); 41 | name = name.replace(".", ""); 42 | let re = Regex::new(r"[^A-Za-z]").unwrap(); 43 | let res = re.replace_all(&name, ""); 44 | format!("{}-{}", s!(res[..10.min(res.len())]), now()) 45 | } --------------------------------------------------------------------------------