Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support tab completions #209

Merged
merged 12 commits into from
Aug 17, 2022
Merged

Support tab completions #209

merged 12 commits into from
Aug 17, 2022

Commits on Apr 15, 2022

  1. Basic shell completion

    This is an initial effort to address
    #177
    
    With this change, klog uses github.com/posener/complete and
    github.com/willabides/kongplete to generate completions for klog's own
    commands.
    
    There are two coordinated changes that make this feature work:
    
    1. When the `COMP_LINE` environment variable is set, `klog` runs in a
       special command completion mode. It parses the value of `COMP_LINE`
       (the current command line), prints to stdout a list of possible
       completions based on what is on the command line so far, and exits
       early.
    2. `klog completion` prints to stdout a code snippet that defines a
       completion specification in the current shell. When this code snippet
       is executed in a shell session, the shell will thereafter invoke the
       same `klog` executable (with the `COMP_LINE` environment variable
       set) to generate possible completions.
    
    For example, in bash, completions can be enabled by running
    
        source <(log completion)
    
    Once bash completions are enabled, pressing tab after typing "klog "
    
        klog [Tab]
    
    will present the available klog commands.
    
    In the current implementation, the generated completions are rudimentary
    and lack ergonomics.
    
    There is zero test coverage for this new feature. Because it relies on
    interaction with the shell, this feature is not easy to test.
    chairmank committed Apr 15, 2022
    Configuration menu
    Copy the full SHA
    6091f12 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    cb0d497 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    508dba9 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f57f7e7 View commit details
    Browse the repository at this point in the history

Commits on Jul 26, 2022

  1. Configuration menu
    Copy the full SHA
    cade2ad View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c7ef999 View commit details
    Browse the repository at this point in the history

Commits on Jul 28, 2022

  1. Configuration menu
    Copy the full SHA
    ea6505e View commit details
    Browse the repository at this point in the history

Commits on Aug 17, 2022

  1. Configuration menu
    Copy the full SHA
    08cb5c7 View commit details
    Browse the repository at this point in the history
  2. Setup hidden alias

    jotaen committed Aug 17, 2022
    Configuration menu
    Copy the full SHA
    1915fc7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    41d71a1 View commit details
    Browse the repository at this point in the history
  4. Rename file

    jotaen committed Aug 17, 2022
    Configuration menu
    Copy the full SHA
    0c73cba View commit details
    Browse the repository at this point in the history
  5. Naming

    jotaen committed Aug 17, 2022
    Configuration menu
    Copy the full SHA
    c31c2b5 View commit details
    Browse the repository at this point in the history