From 36abbe1ecf1bdaff6e049c5add0819d214a37ccc Mon Sep 17 00:00:00 2001 From: rsteube Date: Sat, 11 Sep 2021 20:02:57 +0200 Subject: [PATCH] tcsh: escape descriptions --- docs/src/SUMMARY.md | 1 + docs/src/development/additionalInformation.md | 1 + docs/src/development/shells/tcsh.md | 1 + internal/tcsh/action.go | 2 +- 4 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 docs/src/development/shells/tcsh.md diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md index c3c9bb433..a5650748d 100644 --- a/docs/src/SUMMARY.md +++ b/docs/src/SUMMARY.md @@ -38,6 +38,7 @@ - [Nushell](./development/shells/nushell.md) - [Oil](./development/shells/oil.md) - [Powershell](./development/shells/powershell.md) + - [Tcsh](./development/shells/tcsh.md) - [Xonsh](./development/shells/xonsh.md) - [Zsh](./development/shells/zsh.md) - [Testing](./development/testing.md) diff --git a/docs/src/development/additionalInformation.md b/docs/src/development/additionalInformation.md index b967e4b8a..cba7987f9 100644 --- a/docs/src/development/additionalInformation.md +++ b/docs/src/development/additionalInformation.md @@ -5,5 +5,6 @@ Additional information can be found at: - Elvish: [using-and-writing-completions-in-elvish](https://zzamboni.org/post/using-and-writing-completions-in-elvish/) and [argument-completer](https://elv.sh/ref/edit.html#argument-completer) - Fish: [fish-shell/share/functions](https://github.com/fish-shell/fish-shell/tree/master/share/functions) and [writing your own completions](https://fishshell.com/docs/current/#writing-your-own-completions) - Powershell: [Dynamic Tab Completion](https://adamtheautomator.com/powershell-parameters-argumentcompleter/) and [Register-ArgumentCompleter](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/register-argumentcompleter) +- Tcsh: [complete built-in command for tcsh](https://www.ibm.com/docs/en/zos/2.3.0?topic=shell-complete-built-in-command-tcsh-list-completions) - Xonsh: [Programmable Tab-Completion](https://xon.sh/tutorial_completers.html) and [RichCompletion(str)](https://github.com/xonsh/xonsh/blob/master/xonsh/completers/tools.py) - Zsh: [zsh-completions-howto](https://github.com/zsh-users/zsh-completions/blob/master/zsh-completions-howto.org#functions-for-performing-complex-completions-of-single-words) and [Completion-System](http://zsh.sourceforge.net/Doc/Release/Completion-System.html#Completion-System). diff --git a/docs/src/development/shells/tcsh.md b/docs/src/development/shells/tcsh.md new file mode 100644 index 000000000..e64941ba1 --- /dev/null +++ b/docs/src/development/shells/tcsh.md @@ -0,0 +1 @@ +# Tcsh diff --git a/internal/tcsh/action.go b/internal/tcsh/action.go index 661990a52..bee0d3766 100644 --- a/internal/tcsh/action.go +++ b/internal/tcsh/action.go @@ -108,7 +108,7 @@ func ActionRawValues(currentWord string, nospace bool, values ...common.RawValue } else { if val.Description != "" { // TODO seems actual value needs to be used or it won't be shown if the prefix doesn't match - vals[index] = fmt.Sprintf("%v_(%v)", quoter.Replace(sanitizer.Replace(val.Value)), strings.Replace(sanitizer.Replace(val.TrimmedDescription()), " ", "_", -1)) + vals[index] = fmt.Sprintf("%v_(%v)", quoter.Replace(sanitizer.Replace(val.Value)), quoter.Replace(strings.Replace(sanitizer.Replace(val.TrimmedDescription()), " ", "_", -1))) } else { vals[index] = quoter.Replace(sanitizer.Replace(val.Value)) }