coder / serpent

CLI framework for scale and configurability inspired by Cobra
Creative Commons Zero v1.0 Universal
6 stars 1 forks source link

bug: coder completion sub-command no longer available #3

Open johnstcn opened 1 year ago

johnstcn commented 1 year ago

Expected: coder completion <shell> outputs the required completion functions for the given shell.

Actual:

$ ~/bin/coderv2 version
Coder v0.21.3-devel+00d468b9 Wed Apr  5 12:16:05 UTC 2023
https://github.com/coder/coder/commit/00d468b964aafeaa1793438ac29ba439edc30e61

Slim build of Coder, does not support the  server  subcommand.

$ ~/bin/coderv2 completion bash
Usage: coder [global-flags] <subcommand>

Coder v0.21.3-devel+00d468b9 — A tool for provisioning self-hosted development environments with Terraform.
  - Start a Coder server:
[... rest of the help output follows]

This appears to have been introduced in v0.21.0:

$ ./coder_0.21.0_darwin_arm64/coder completion bash 2>&1 | head
Usage: coder [global-flags] <subcommand>

Coder v0.21.0+f88f273 — A tool for provisioning self-hosted development environments with Terraform.
  - Start a Coder server:                                                       

      $ coder server 

  - Get started by creating a template from an example:                         

      $ coder templates init

$ ./coder_0.20.1_darwin_arm64/coder completion bash 2>&1 | head
# bash completion V2 for coder                                -*- shell-script -*-

__coder_debug()
{
    if [[ -n ${BASH_COMP_DEBUG_FILE:-} ]]; then
        echo "$*" >> "${BASH_COMP_DEBUG_FILE}"
    fi
}

# Macs have bash3 for which the bash-completion package doesn't include
matifali commented 7 months ago

I no longer see the coder completion subcommand. I think we should add it back. cc: @bpmct @ammario

ammario commented 7 months ago

This was intentionally lost during to the clibase refactor.