def zsh_ends

cli@0.2.0.0 · cli.bend:6898

import cli@0.2.0.0/cli.bend as Cli
import Base

6898# At the top command (no words), the count of "--" before the cursor that
6899# zsh_past_end compares with.
6900def zsh_ends(words: List<&2, String>, +ind: String) -> List<&2, String>:
6901  match words:
6902    case Nil{}:
6903      [String.append(ind,
6904        "# _arguments -S drops a -- typed before a command's first word, so a"),
6905        String.append(ind,
6906          "# state whose words hold fewer -- than the line has is past one."),
6907        String.append(ind, "local -i ends=${#${(M)words[2,CURRENT-1]:#--}}")]
6908    case _: []

Uses (3)

Used by (1)