Skip to content

Commit 2384087

Browse files
author
Steve Coffman
committed
Add version flag and homebrew formula to goreleaser
1 parent b0cee89 commit 2384087

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

.goreleaser.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,18 @@ changelog:
2626
exclude:
2727
- '^docs:'
2828
- '^test:'
29+
brews:
30+
-
31+
name: keyfob
32+
github:
33+
owner: StevenACoffman
34+
name: homebrew-keyfob
35+
folder: Formula
36+
homepage: "https://github.com/StevenACoffman/keyfob"
37+
description: keyfob - a two-factor authentication agent suitable for AWS and Github
38+
test: |
39+
system "#{bin}/keyfob", "--version"
40+
install: |
41+
bin.install "keyfob" => "keyfob"
42+
43+
prefix.install_metafiles

cmd/root.go

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,9 @@ var cfgFile string
3838
// rootCmd represents the base command when called without any subcommands
3939
var rootCmd = &cobra.Command{
4040
Use: "keyfob",
41-
Short: "A brief description of your application",
42-
Long: `A longer description that spans multiple lines and likely contains
43-
examples and usage of using your application. For example:
44-
45-
Cobra is a CLI library for Go that empowers applications.
46-
This application is a tool to generate the needed files
47-
to quickly create a Cobra application.`,
41+
Short: "keyfob is a two-factor authentication agent suitable for AWS and Github.",
42+
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.`,
43+
Version: "0.3.0",
4844
// Uncomment the following line if your bare application
4945
// has an action associated with it:
5046
// Run: func(cmd *cobra.Command, args []string) { },
@@ -62,16 +58,6 @@ func Execute() {
6258
func init() {
6359
cobra.OnInitialize(initConfig)
6460

65-
// Here you will define your flags and configuration settings.
66-
// Cobra supports persistent flags, which, if defined here,
67-
// will be global for your application.
68-
69-
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.keyfob.yaml)")
70-
71-
72-
// Cobra also supports local flags, which will only run
73-
// when this action is called directly.
74-
rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
7561
}
7662

7763

0 commit comments

Comments
 (0)