From 3041adad3ca592444a639a440b9ee89cee53220e Mon Sep 17 00:00:00 2001 From: amtoine Date: Sat, 1 Apr 2023 09:05:27 +0200 Subject: [PATCH] throw a nice error if the OS is not supported --- crates/nu-utils/standard_library/std.nu | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/nu-utils/standard_library/std.nu b/crates/nu-utils/standard_library/std.nu index acd72e5171..f7bb3b2757 100644 --- a/crates/nu-utils/standard_library/std.nu +++ b/crates/nu-utils/standard_library/std.nu @@ -465,6 +465,14 @@ export def clip [ check-clipboard clip.exe --system $"('xorg' | pretty-command) on linux" $input | clip.exe }, + _ => { + error make --unspanned { + msg: $"(ansi red)unknown_operating_system(ansi reset): + '($nu.os-info.name)' is not supported by the ('clip' | pretty-command) command. + + please open a feature request in the [issue tracker](char lparen)https://github.com/nushell/nushell/issues/new/choose(char rparen) to add your operating system to the standard library." + } + }, } if not $silent {