INNER CODE UNIT · Python
option_flags
torognes/vsearch · completion/scripts/gen_fish.py:68
def option_flags(s: spec_mod.Spec, opt: spec_mod.Option) -> str:
"""Return the per-option fish complete flags excluding -c/-n/-l/-s/-d."""
a = opt.arg
if a.type == "flag":
return "-f" # no arg, no file completion
if a.type == "enum":
vals = " ".join(s.enum_values(a.values))
return f"-x -a {fish_squote(vals)}"
if a.type == "file":
return file_arg_flags(s, a.ftype)
if a.type == "outfile":
return "-rF" # require arg, force file completion (no extension filter)
# int / real / string / int_list / real_list — require arg, no suggestions
return "-x"
def complete_line(s: spec_mod.Spec, opt: spec_mod.Option, condition: str | None) -> str:
parts = ["complete -c vsearch"]