Skip to content

Go library that allows you to rename flags and deprecated the old name

License

Notifications You must be signed in to change notification settings

mkmik/flagalias

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoDoc

Overview

Package flagalias allows you to define aliases for Go flags. Deprecated aliases will emit a warning when used.

Example

package main

import (
	"flag"
	"fmt"

	"github.com/mkmik/flagalias"
)

var (
	dryRun = flag.Bool("dry-run", false, "dry run")
)

func init() {
	flagalias.Alias("N", "dry-run")
	flagalias.Deprecated("dryrun", "dry-run")
}

func main() {
	flag.Parse()

	fmt.Printf("dry run: %v\n", *dryRun)
}

About

Go library that allows you to rename flags and deprecated the old name

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages