Skip to content

API to emit completions generated by another library #107

@cspotcode

Description

@cspotcode

stricli already has logic to generate a list of completions. However, they only support bash. They would like to integrate with @bomb.sh/tab but keep their own completion logic.

bloomberg/stricli#137 (comment)

To support this, can tab add an alternative API to .parse() which emits a set of completions and a directive?

Something like this:

/**
 * Write completions and directive to stdout
 */
emitCompletions(completions: Completion[], directive: Directive);

interface Completion {
  value: string;
  description: string;
}
type Directive = number; // Better type based on ShellCompDirective?

Related discussion question: #61 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions