From 5f0fea60a69319ff64803e934e7a2dea466c6906 Mon Sep 17 00:00:00 2001 From: Mac Malone Date: Mon, 27 Jan 2025 20:54:55 -0500 Subject: [PATCH] refactor: lake: deprecate `-U` (#6798) This PR deprecates the `-U` shorthand for the `--update` option. It is likely the `-U` option will be used for something different in the future, so deprecating it now seems wise. --- src/lake/Lake/CLI/Help.lean | 2 +- src/lake/Lake/CLI/Main.lean | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lake/Lake/CLI/Help.lean b/src/lake/Lake/CLI/Help.lean index 801660b1f2..8bca03cb2c 100644 --- a/src/lake/Lake/CLI/Help.lean +++ b/src/lake/Lake/CLI/Help.lean @@ -46,7 +46,7 @@ BASIC OPTIONS: -K key[=value] set the configuration file option named key --old only rebuild modified modules (ignore transitive deps) --rehash, -H hash all files for traces (do not trust `.hash` files) - --update, -U update dependencies on load (e.g., before a build) + --update update dependencies on load (e.g., before a build) --packages=file JSON file of package entries that override the manifest --reconfigure, -R elaborate configuration files instead of using OLeans --keep-toolchain do not update toolchain on workspace update diff --git a/src/lake/Lake/CLI/Main.lean b/src/lake/Lake/CLI/Main.lean index d30feee293..8a1a57b159 100644 --- a/src/lake/Lake/CLI/Main.lean +++ b/src/lake/Lake/CLI/Main.lean @@ -172,7 +172,9 @@ def lakeShortOption : (opt : Char) → CliM PUnit | 'd' => do let rootDir ← takeOptArg "-d" "path"; modifyThe LakeOptions ({· with rootDir}) | 'f' => do let configFile ← takeOptArg "-f" "path"; modifyThe LakeOptions ({· with configFile}) | 'K' => do setConfigOpt <| ← takeOptArg "-K" "key-value pair" -| 'U' => modifyThe LakeOptions ({· with updateDeps := true}) +| 'U' => do + logWarning "the '-U' shorthand for '--update' is deprecated" + modifyThe LakeOptions ({· with updateDeps := true}) | 'R' => modifyThe LakeOptions ({· with reconfigure := true}) | 'h' => modifyThe LakeOptions ({· with wantsHelp := true}) | 'H' => modifyThe LakeOptions ({· with trustHash := false})