mirror of
https://github.com/beetbox/beets.git
synced 2026-01-09 01:15:38 +01:00
Merge pull request #3792 from benneti/master
escape ? in fish completion
This commit is contained in:
commit
f7e3932c17
1 changed files with 10 additions and 0 deletions
|
|
@ -133,6 +133,12 @@ class FishPlugin(BeetsPlugin):
|
|||
fish_file.write(totstring)
|
||||
|
||||
|
||||
def _escape(name):
|
||||
# Escape ? in fish
|
||||
if name == "?":
|
||||
name = "\\" + name
|
||||
|
||||
|
||||
def get_cmds_list(cmds_names):
|
||||
# Make a list of all Beets core & plugin commands
|
||||
substr = ''
|
||||
|
|
@ -201,6 +207,8 @@ def get_subcommands(cmd_name_and_help, nobasicfields, extravalues):
|
|||
# Formatting for Fish to complete our fields/values
|
||||
word = ""
|
||||
for cmdname, cmdhelp in cmd_name_and_help:
|
||||
cmdname = _escape(cmdname)
|
||||
|
||||
word += "\n" + "# ------ {} -------".format(
|
||||
"fieldsetups for " + cmdname) + "\n"
|
||||
word += (
|
||||
|
|
@ -232,6 +240,8 @@ def get_all_commands(beetcmds):
|
|||
names = [alias for alias in cmd.aliases]
|
||||
names.append(cmd.name)
|
||||
for name in names:
|
||||
name = _escape(name)
|
||||
|
||||
word += "\n"
|
||||
word += ("\n" * 2) + "# ====== {} =====".format(
|
||||
"completions for " + name) + "\n"
|
||||
|
|
|
|||
Loading…
Reference in a new issue