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

Bash completion for the faas alias is not working #791

Open
mehyedes opened this issue Apr 8, 2020 · 0 comments
Open

Bash completion for the faas alias is not working #791

mehyedes opened this issue Apr 8, 2020 · 0 comments

Comments

@mehyedes
Copy link

mehyedes commented Apr 8, 2020

After installing faas-cli, a bash alias faas is also created by creating a symbolic link according to the PR #234
Bash completion does not work for the alias faas though, which forces you to resort to using faas-cli

Expected Behaviour

Bash completion works for both faas-cli and faas

Current Behaviour

Bash completion does not work for the alias faas.

Possible Solution

There is a helpful guide in the cobra repo:
https://github.com/spf13/cobra/blob/master/bash_completions.md#using-bash-aliases-for-commands
Creating a file under /etc/bash_completion.d/faas on Linux with the content below would fix this:

complete -o default -F __start_faas-cli faas

The completion works after sourcing that file

$ source /etc/bash_completion.d/faas
$ faas
auth        deploy      list        namespaces  secret      version   
build       describe    login       new         store                 
cloud       generate    logout      push        template              
completion  invoke      logs        remove      up

But that's just something I have tested quickly on Linux.

Steps to Reproduce (for bugs)

  1. Install faas-cli
  2. Try auto-complete with faas with Tab

Context

Creating the faas alias without bash completion makes the alias not very useful as it makes you resort to faas-cli most of the time to get completion for the commands.

Your Environment

  • FaaS-CLI version ( Full output from: faas-cli version ):
faas-cli version 
  ___                   _____           ____
 / _ \ _ __   ___ _ __ |  ___|_ _  __ _/ ___|
| | | | '_ \ / _ \ '_ \| |_ / _` |/ _` \___ \
| |_| | |_) |  __/ | | |  _| (_| | (_| |___) |
 \___/| .__/ \___|_| |_|_|  \__,_|\__,_|____/
      |_|

CLI:
 commit:  2d183c713b32385831dc7f69c073e57c06e3b76c
 version: 0.12.2
  • Docker version ( Full output from: docker version ):
docker version 
Client:
 Version:           19.03.6
 API version:       1.40
 Go version:        go1.12.17
 Git commit:        369ce74a3c
 Built:             Fri Feb 28 23:45:43 2020
 OS/Arch:           linux/amd64
 Experimental:      true

Server:
 Engine:
  Version:          19.03.6
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.17
  Git commit:       369ce74a3c
  Built:            Wed Feb 19 01:06:16 2020
  OS/Arch:          linux/amd64
  Experimental:     true
 containerd:
  Version:          1.3.3-0ubuntu1~18.04.2
  GitCommit:        
 runc:
  Version:          spec: 1.0.1-dev
  GitCommit:        
 docker-init:
  Version:          0.18.0
  GitCommit:
  • Operating System and version (e.g. Linux, Windows, MacOS):
    Linux Ubuntu 18.04
@mehyedes mehyedes changed the title Bash completion for the faas alias is not working Bash completion for the faas alias is not working Apr 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant