Skip to content

Completion functions #1

Description

@jpaugh

repla desperately needs completion functions! Here are two ways to go about this but I don't like either of them, so any suggestions are welcome.

Define completion functions in Python (or Pythonic way), and use them.

Pros:

  • Builtins and wrapped commands use same completion format/infrastructure
  • Easy to do: just make a completion framework, then add a few custom handlers
  • More can be added by users.
  • Can be built into shell language--or just use Python

Cons:

  • Duplicating effort: package maintainers already have to deal separately with completion for bash and zsh, for example.

Run the user's preferred shell in a pseudo-tty and call its completion functions.

Pros:

  • All around, less work.
  • Don't need custom completion functions for any commands (except builtins)
  • User chooses their preferred completion mechanism (by virtue of choosing their shell)

Cons:

  • User's shell might not support completion
  • Have do deal with quirks of each shell.
  • Redundant shell. Yikes!
  • All around, more work: have to figure out how master/slave ptys work.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions