Skip to content

Commit

Permalink
Add version flag and homebrew formula to goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Coffman committed Jun 29, 2019
1 parent b0cee89 commit 2384087
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
15 changes: 15 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,18 @@ changelog:
exclude:
- '^docs:'
- '^test:'
brews:
-
name: keyfob
github:
owner: StevenACoffman
name: homebrew-keyfob
folder: Formula
homepage: "https://github.com/StevenACoffman/keyfob"
description: keyfob - a two-factor authentication agent suitable for AWS and Github
test: |
system "#{bin}/keyfob", "--version"
install: |
bin.install "keyfob" => "keyfob"
prefix.install_metafiles
20 changes: 3 additions & 17 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,9 @@ var cfgFile string
// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
Use: "keyfob",
Short: "A brief description of your application",
Long: `A longer description that spans multiple lines and likely contains
examples and usage of using your application. For example:
Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
Short: "keyfob is a two-factor authentication agent suitable for AWS and Github.",
Long: `keyfob is a two-factor authentication agent suitable for AWS and Github. Works pretty much the same as Google Authenticator or Authy, but uses your laptop's keychain.`,
Version: "0.3.0",
// Uncomment the following line if your bare application
// has an action associated with it:
// Run: func(cmd *cobra.Command, args []string) { },
Expand All @@ -62,16 +58,6 @@ func Execute() {
func init() {
cobra.OnInitialize(initConfig)

// Here you will define your flags and configuration settings.
// Cobra supports persistent flags, which, if defined here,
// will be global for your application.

rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.keyfob.yaml)")


// Cobra also supports local flags, which will only run
// when this action is called directly.
rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
}


Expand Down

0 comments on commit 2384087

Please sign in to comment.