nestjs-shell icon indicating copy to clipboard operation
nestjs-shell copied to clipboard

Interface completer

Open lukemovement opened this issue 3 years ago • 1 comments

Hey, can you allow us more control over the behaviour of the interface? Passing Partial<ReadLineOptions> through shellFacade.bootstrap or have it return the readline interface?

My end goal is the implemented the following which would allow for an auto complete functionality

completer: (line: string) => {
    const commands = this.shellFacade.getAllCommands();
    const filteredCommands = commands
      .map((command) => command.name)
      .filter((command) => command.startsWith(line));

    return [filteredCommands, line];
  },

lukemovement avatar May 12 '22 11:05 lukemovement

Hi @lukemovement , thanks for the issue. Sadly I don't have enough free time to commit to this, but I will gladly review & accept a PR if you decide to create one

bmstefanski avatar May 12 '22 11:05 bmstefanski