summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSilvan Mosberger <contact@infinisil.com>2020-03-13 02:45:26 +0100
committerSilvan Mosberger <contact@infinisil.com>2020-04-13 17:27:04 +0200
commit124cccbe3b63122733e02e41e45a383ec48752fd (patch)
tree8056eeb33c80d8166b446fe2abf4fd900f049f21 /lib
parentf9eb3d158a47dccb1e4762f3ed91f224fc96dc7e (diff)
lib/options: Use escapeNixIdentifier for showOption
Diffstat (limited to 'lib')
-rw-r--r--lib/options.nix9
1 files changed, 1 insertions, 8 deletions
diff --git a/lib/options.nix b/lib/options.nix
index 71481c9250ab..a53b8c9f264c 100644
--- a/lib/options.nix
+++ b/lib/options.nix
@@ -193,14 +193,7 @@ rec {
(showOption ["foo" "bar" "baz"]) == "foo.bar.baz"
(showOption ["foo" "bar.baz" "tux"]) == "foo.\"bar.baz\".tux"
*/
- showOption = parts: let
- escapeOptionPart = part:
- let
- escaped = lib.strings.escapeNixString part;
- in if escaped == "\"${part}\""
- then part
- else escaped;
- in (concatStringsSep ".") (map escapeOptionPart parts);
+ showOption = parts: concatMapStringsSep "." escapeNixIdentifier parts;
showFiles = files: concatStringsSep " and " (map (f: "`${f}'") files);
unknownModule = "<unknown-file>";