dotnet / command-line-api

Command line parsing, invocation, and rendering of terminal output.
https://github.com/dotnet/command-line-api/wiki
MIT License
3.37k stars 378 forks source link

Completion script gives me a syntactic error #2290

Open danielAyerra opened 10 months ago

danielAyerra commented 10 months ago

When using source command for adding dotnet-suggest-shim to bash, I get the following error:

$: source .bashrc bash: /home/Weinman/.dotnet-suggest-shim.bash: línea 1: error sintáctico cerca del elemento inesperado$'\r''
'ash: /home/Weinman/.dotnet-suggest-shim.bash: línea 1: _dotnet_bash_complete()

This happens after having followed the instructions here

KalleOlaviNiemitalo commented 10 months ago

Seems related to https://github.com/dotnet/command-line-api/issues/2275.

If that's the reason, then you could try this as a workaround:

dotnet-suggest script bash | tr -d '\r' > ~/.dotnet-suggest-shim.bash
danielAyerra commented 10 months ago

Seems related to #2275.

If that's the reason, then you could try this as a workaround:

dotnet-suggest script bash | tr -d '\r' > ~/.dotnet-suggest-shim.bash

It actually worked. Thank you!