Skip to content

bygui86/go-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go CLI sample project

Info

Precedence

The precedence for flag value sources is as follows (highest to lowest):

  1. Command line flag value from user
  2. Environment variable from user (if specified)
  3. Configuration file (if specified) [FilePath]
  4. Environment variable (if specified) [EnvVar]
  5. Default defined on the flag [Value]

Autocompletion

zsh example

go build examples/bash-completion.go
PROG=bash-completion source  <(bash-completion autocompletion zsh)
bash-completion
# now play with tab

BASH

Source the autocomplete-scripts/bash_autocomplete file in your .bashrc or .bash_profile file.

go build .
source <(go-cli autocompletion bash)
go-cli
# now play with tab

ZSH

Source the autocomplete-scripts/zsh_autocomplete file in your .zshrc file while setting the PROG variable to the name of your program.

go build .
PROG=go-cli source <(go-cli autocompletion zsh)
go-cli
# now play with tab

Links

Config

Collaterals

About

Go CLI sample project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published