Skip to content

Commit 6cc808d

Browse files
ritonSecrus
authored andcommitted
feat: Sanitize command name for fish shell to escape quotes
* Should produce something like ❯ complete -c poetry -A -n '__fish_seen_subcommand_from \'env remove\'' -l all -d 'Remove all managed virtual environments associated with the project.'
1 parent 926fd63 commit 6cc808d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cleo/commands/completions_command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ def sanitize(s: str) -> str:
255255
f"# {command_name}",
256256
*[
257257
f"complete -c {script_name} -A "
258-
f"-n '__fish_seen_subcommand_from {command_name}' "
258+
f"-n '__fish_seen_subcommand_from {sanitize(command_name)}' "
259259
f"-l {opt.name} -d '{sanitize(opt.description)}'"
260260
for opt in sorted(cmd.definition.options, key=lambda o: o.name)
261261
],

0 commit comments

Comments
 (0)