go-cli

command module
v0.0.0-...-0640b79 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 9, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

README

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

Config
Collaterals

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL