kur
Clone
https://git.tahinli.com/Tahinli/kur.git
0 watching0 forksRustAGPL-3.073.7 KiB6ae6238Tahinli21 days ago5 commits
| 1 | //! Config key renames. Old configs keep working, and `kur run` rewrites them to the new names. |
| 2 | |
| 3 | use ; |
| 4 | |
| 5 | /// Where a rename applies. |
| 6 | // Nothing is renamed yet, so no entry constructs these variants. |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | /// `(scope, old name, new name)`. Add an entry here when a key is renamed, never remove one. |
| 17 | /// Also add the new name to `KNOWN_TOP_KEYS` or `KNOWN_APP_KEYS` in `config.rs`. |
| 18 | /// |
| 19 | /// Example, for an `[[app]]` key `health_wait` renamed to `health_timeout_secs`: |
| 20 | /// ```text |
| 21 | /// (Scope::App, "health_wait", "health_timeout_secs"), |
| 22 | /// ``` |
| 23 | pub const RENAMES: & = &; |
| 24 | |
| 25 | /// What happened to the old key in one table. |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | /// Renames keys in `doc` in place and returns one message per change. |
| 32 | /// |
| 33 | /// A renamed key keeps its value, its position in the table, and its comments. If the new name |
| 34 | /// is already set in the same table, the old key is removed instead. |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | /// The `name` of an `[[app]]` table, or `#<1-based index>` if it has none. |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | /// Renames `old` to `new` in `table`, keeping the key's position and decor. Returns `None` if |
| 72 | /// `old` is not set. |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | |
| 116 | |
| 117 | |
| 118 | |
| 119 | |
| 120 | |
| 121 | |
| 122 | |
| 123 | |
| 124 | |
| 125 | |
| 126 | |
| 127 |