diff --git a/src/System.CommandLine.StaticCompletions/shells/NuShellShellProvider.cs b/src/System.CommandLine.StaticCompletions/shells/NuShellShellProvider.cs index 211da99723e8..88cf27542591 100644 --- a/src/System.CommandLine.StaticCompletions/shells/NuShellShellProvider.cs +++ b/src/System.CommandLine.StaticCompletions/shells/NuShellShellProvider.cs @@ -18,31 +18,13 @@ public class NushellShellProvider : IShellProvider private static readonly string _dynamicCompletionScript = """ - # Add the following content to your config.nu file: - - let external_completer = { |spans| - { - dotnet: { || - dotnet complete ( - $spans | skip 1 | str join " " - ) | lines - } - } | get $spans.0 | each { || do $in } + def "nu-complete dotnet" [context: string] { + ^dotnet complete $"($context)" | lines } - # And then in the config record, find the completions section and add the - # external_completer that was defined earlier to external: - - let-env config = { - # your options here - completions: { - # your options here - external: { - # your options here - completer: $external_completer # add it here - } - } - } + export extern "dotnet" [ + ...command: string@"nu-complete dotnet" + ] """; public string GenerateCompletions(System.CommandLine.Command command) => _dynamicCompletionScript;