package
0.0.0-20240903065352-a035e3d95284
Repository: https://github.com/johansteyn/learn.git
Documentation: pkg.go.dev

# README

https://pkg.go.dev/flag https://gobyexample.com/command-line-flags

Build:

% go build -o flags main.go

Usage:

% flags -h % flags --h % flags -help % flags --help

Examples:

  1. Single hyphens with equals

% go run main.go -name=Bob -age=42 -vaccinated=false

  1. Double hyphens with equals

% go run main.go --name=Bob --age=42 --vaccinated=false

  1. Single hyphens with spaces

    % go run main.go -name Bob -age 42

    NOTE: Boolean flags cannot use spaces

  2. Double hyphens with spaces

% go run main.go --name Bob --age 42