GithubHelp home page GithubHelp logo

go-cli's Introduction

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

go-cli's People

Contributors

bygui86 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.