├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── README.md ├── assets └── rotator.gif └── src ├── main.rs └── rotator ├── mod.rs └── rotator.rs /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "atty" 5 | version = "0.2.14" 6 | source = "registry+https://github.com/rust-lang/crates.io-index" 7 | checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" 8 | dependencies = [ 9 | "hermit-abi", 10 | "libc", 11 | "winapi", 12 | ] 13 | 14 | [[package]] 15 | name = "autocfg" 16 | version = "1.0.1" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" 19 | 20 | [[package]] 21 | name = "bitflags" 22 | version = "1.2.1" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" 25 | 26 | [[package]] 27 | name = "cfg-if" 28 | version = "1.0.0" 29 | source = "registry+https://github.com/rust-lang/crates.io-index" 30 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 31 | 32 | [[package]] 33 | name = "clap" 34 | version = "3.0.0-beta.2" 35 | source = "registry+https://github.com/rust-lang/crates.io-index" 36 | checksum = "4bd1061998a501ee7d4b6d449020df3266ca3124b941ec56cf2005c3779ca142" 37 | dependencies = [ 38 | "atty", 39 | "bitflags", 40 | "clap_derive", 41 | "indexmap", 42 | "lazy_static", 43 | "os_str_bytes", 44 | "strsim", 45 | "termcolor", 46 | "textwrap", 47 | "unicode-width", 48 | "vec_map", 49 | ] 50 | 51 | [[package]] 52 | name = "clap_derive" 53 | version = "3.0.0-beta.2" 54 | source = "registry+https://github.com/rust-lang/crates.io-index" 55 | checksum = "370f715b81112975b1b69db93e0b56ea4cd4e5002ac43b2da8474106a54096a1" 56 | dependencies = [ 57 | "heck", 58 | "proc-macro-error", 59 | "proc-macro2", 60 | "quote", 61 | "syn", 62 | ] 63 | 64 | [[package]] 65 | name = "getrandom" 66 | version = "0.2.2" 67 | source = "registry+https://github.com/rust-lang/crates.io-index" 68 | checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" 69 | dependencies = [ 70 | "cfg-if", 71 | "libc", 72 | "wasi", 73 | ] 74 | 75 | [[package]] 76 | name = "hashbrown" 77 | version = "0.9.1" 78 | source = "registry+https://github.com/rust-lang/crates.io-index" 79 | checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" 80 | 81 | [[package]] 82 | name = "heck" 83 | version = "0.3.2" 84 | source = "registry+https://github.com/rust-lang/crates.io-index" 85 | checksum = "87cbf45460356b7deeb5e3415b5563308c0a9b057c85e12b06ad551f98d0a6ac" 86 | dependencies = [ 87 | "unicode-segmentation", 88 | ] 89 | 90 | [[package]] 91 | name = "hermit-abi" 92 | version = "0.1.18" 93 | source = "registry+https://github.com/rust-lang/crates.io-index" 94 | checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c" 95 | dependencies = [ 96 | "libc", 97 | ] 98 | 99 | [[package]] 100 | name = "indexmap" 101 | version = "1.6.1" 102 | source = "registry+https://github.com/rust-lang/crates.io-index" 103 | checksum = "4fb1fa934250de4de8aef298d81c729a7d33d8c239daa3a7575e6b92bfc7313b" 104 | dependencies = [ 105 | "autocfg", 106 | "hashbrown", 107 | ] 108 | 109 | [[package]] 110 | name = "lazy_static" 111 | version = "1.4.0" 112 | source = "registry+https://github.com/rust-lang/crates.io-index" 113 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 114 | 115 | [[package]] 116 | name = "libc" 117 | version = "0.2.87" 118 | source = "registry+https://github.com/rust-lang/crates.io-index" 119 | checksum = "265d751d31d6780a3f956bb5b8022feba2d94eeee5a84ba64f4212eedca42213" 120 | 121 | [[package]] 122 | name = "log" 123 | version = "0.4.14" 124 | source = "registry+https://github.com/rust-lang/crates.io-index" 125 | checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" 126 | dependencies = [ 127 | "cfg-if", 128 | ] 129 | 130 | [[package]] 131 | name = "os_str_bytes" 132 | version = "2.4.0" 133 | source = "registry+https://github.com/rust-lang/crates.io-index" 134 | checksum = "afb2e1c3ee07430c2cf76151675e583e0f19985fa6efae47d6848a3e2c824f85" 135 | 136 | [[package]] 137 | name = "ppv-lite86" 138 | version = "0.2.10" 139 | source = "registry+https://github.com/rust-lang/crates.io-index" 140 | checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" 141 | 142 | [[package]] 143 | name = "proc-macro-error" 144 | version = "1.0.4" 145 | source = "registry+https://github.com/rust-lang/crates.io-index" 146 | checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" 147 | dependencies = [ 148 | "proc-macro-error-attr", 149 | "proc-macro2", 150 | "quote", 151 | "syn", 152 | "version_check", 153 | ] 154 | 155 | [[package]] 156 | name = "proc-macro-error-attr" 157 | version = "1.0.4" 158 | source = "registry+https://github.com/rust-lang/crates.io-index" 159 | checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" 160 | dependencies = [ 161 | "proc-macro2", 162 | "quote", 163 | "version_check", 164 | ] 165 | 166 | [[package]] 167 | name = "proc-macro2" 168 | version = "1.0.24" 169 | source = "registry+https://github.com/rust-lang/crates.io-index" 170 | checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" 171 | dependencies = [ 172 | "unicode-xid", 173 | ] 174 | 175 | [[package]] 176 | name = "quote" 177 | version = "1.0.9" 178 | source = "registry+https://github.com/rust-lang/crates.io-index" 179 | checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" 180 | dependencies = [ 181 | "proc-macro2", 182 | ] 183 | 184 | [[package]] 185 | name = "rand" 186 | version = "0.8.3" 187 | source = "registry+https://github.com/rust-lang/crates.io-index" 188 | checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" 189 | dependencies = [ 190 | "libc", 191 | "rand_chacha", 192 | "rand_core", 193 | "rand_hc", 194 | ] 195 | 196 | [[package]] 197 | name = "rand_chacha" 198 | version = "0.3.0" 199 | source = "registry+https://github.com/rust-lang/crates.io-index" 200 | checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" 201 | dependencies = [ 202 | "ppv-lite86", 203 | "rand_core", 204 | ] 205 | 206 | [[package]] 207 | name = "rand_core" 208 | version = "0.6.2" 209 | source = "registry+https://github.com/rust-lang/crates.io-index" 210 | checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" 211 | dependencies = [ 212 | "getrandom", 213 | ] 214 | 215 | [[package]] 216 | name = "rand_hc" 217 | version = "0.3.0" 218 | source = "registry+https://github.com/rust-lang/crates.io-index" 219 | checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" 220 | dependencies = [ 221 | "rand_core", 222 | ] 223 | 224 | [[package]] 225 | name = "rotator" 226 | version = "0.1.0" 227 | dependencies = [ 228 | "clap", 229 | "log", 230 | "rand", 231 | ] 232 | 233 | [[package]] 234 | name = "strsim" 235 | version = "0.10.0" 236 | source = "registry+https://github.com/rust-lang/crates.io-index" 237 | checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" 238 | 239 | [[package]] 240 | name = "syn" 241 | version = "1.0.61" 242 | source = "registry+https://github.com/rust-lang/crates.io-index" 243 | checksum = "ed22b90a0e734a23a7610f4283ac9e5acfb96cbb30dfefa540d66f866f1c09c5" 244 | dependencies = [ 245 | "proc-macro2", 246 | "quote", 247 | "unicode-xid", 248 | ] 249 | 250 | [[package]] 251 | name = "termcolor" 252 | version = "1.1.2" 253 | source = "registry+https://github.com/rust-lang/crates.io-index" 254 | checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" 255 | dependencies = [ 256 | "winapi-util", 257 | ] 258 | 259 | [[package]] 260 | name = "textwrap" 261 | version = "0.12.1" 262 | source = "registry+https://github.com/rust-lang/crates.io-index" 263 | checksum = "203008d98caf094106cfaba70acfed15e18ed3ddb7d94e49baec153a2b462789" 264 | dependencies = [ 265 | "unicode-width", 266 | ] 267 | 268 | [[package]] 269 | name = "unicode-segmentation" 270 | version = "1.7.1" 271 | source = "registry+https://github.com/rust-lang/crates.io-index" 272 | checksum = "bb0d2e7be6ae3a5fa87eed5fb451aff96f2573d2694942e40543ae0bbe19c796" 273 | 274 | [[package]] 275 | name = "unicode-width" 276 | version = "0.1.8" 277 | source = "registry+https://github.com/rust-lang/crates.io-index" 278 | checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" 279 | 280 | [[package]] 281 | name = "unicode-xid" 282 | version = "0.2.1" 283 | source = "registry+https://github.com/rust-lang/crates.io-index" 284 | checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" 285 | 286 | [[package]] 287 | name = "vec_map" 288 | version = "0.8.2" 289 | source = "registry+https://github.com/rust-lang/crates.io-index" 290 | checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" 291 | 292 | [[package]] 293 | name = "version_check" 294 | version = "0.9.2" 295 | source = "registry+https://github.com/rust-lang/crates.io-index" 296 | checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" 297 | 298 | [[package]] 299 | name = "wasi" 300 | version = "0.10.2+wasi-snapshot-preview1" 301 | source = "registry+https://github.com/rust-lang/crates.io-index" 302 | checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" 303 | 304 | [[package]] 305 | name = "winapi" 306 | version = "0.3.9" 307 | source = "registry+https://github.com/rust-lang/crates.io-index" 308 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 309 | dependencies = [ 310 | "winapi-i686-pc-windows-gnu", 311 | "winapi-x86_64-pc-windows-gnu", 312 | ] 313 | 314 | [[package]] 315 | name = "winapi-i686-pc-windows-gnu" 316 | version = "0.4.0" 317 | source = "registry+https://github.com/rust-lang/crates.io-index" 318 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 319 | 320 | [[package]] 321 | name = "winapi-util" 322 | version = "0.1.5" 323 | source = "registry+https://github.com/rust-lang/crates.io-index" 324 | checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" 325 | dependencies = [ 326 | "winapi", 327 | ] 328 | 329 | [[package]] 330 | name = "winapi-x86_64-pc-windows-gnu" 331 | version = "0.4.0" 332 | source = "registry+https://github.com/rust-lang/crates.io-index" 333 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 334 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["root"] 3 | edition = "2018" 4 | name = "rotator" 5 | version = "0.1.0" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | clap = "3.0.0-beta.2" 11 | log = "0.4.14" 12 | rand = "0.8.3" 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Yagiz Degirmenci 4 | 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 |