Skip to content

Commit

Permalink
add: version flag
Browse files Browse the repository at this point in the history
dunstorm committed Aug 26, 2022
1 parent 0b12507 commit 2385c3f
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.vscode/
.DS_Store
bin/**
!bin/.gitkeep
!bin/.gitkeep
dist/
.*
6 changes: 6 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@ Copyright © 2022 NAME HERE <EMAIL ADDRESS>
package cmd

import (
"fmt"
"os"

app "github.com/dunstorm/pm2-go/app"
@@ -26,6 +27,10 @@ It allows you to keep applications alive forever, to reload them without downtim
master.SpawnDaemon()
return
}
if version, _ := cmd.PersistentFlags().GetBool("version"); version {
fmt.Println("0.1.1")
return
}
cmd.Usage()
},
}
@@ -50,5 +55,6 @@ func init() {
// when this action is called directly.
rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
rootCmd.PersistentFlags().BoolP("daemon", "d", false, "Run as daemon")
rootCmd.PersistentFlags().BoolP("version", "v", false, "Print pm2 version")
logsCmd.PersistentFlags().IntP("lines", "l", 15, "Number of lines to tail")
}

0 comments on commit 2385c3f

Please sign in to comment.