c4spar / deno-cliffy

Command line framework for deno 🦕 Including Commandline-Interfaces, Prompts, CLI-Table, Arguments Parser and more...

Home Page:https://cliffy.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

generated zsh completions doesn't seem to be able to tab-complete files.

testersen opened this issue · comments

Same issue here, happy to investigate as this is really annoying

tab-coompletion for files should work if you use the :file type:

await new Command()
  .name("example")
  .option(
    "-f, --file <path:file>",
    "File path.",
  )
  .command("completions", new CompletionsCommand())
  .parse();
import {
  Command,
  CompletionsCommand,
} from "https://deno.land/x/cliffy@v1.0.0-rc.3/command/mod.ts";

await new Command()
  .name("test2")
  .command(
    "foo",
    new Command("foo")
      .arguments("<file:file>", "File path.")
      .option("-f, --file <path:file>", "File path.")
  )
  .command("completions", new CompletionsCommand())
  .parse(Deno.args);

in zsh, press:

test foo

now press <space> <tab>

you would expect file completion but there is not which is the issue

@c4spar I see I only get this issue when using command aliases.