Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions cmd/ssm-run/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ var allProfilesFlag bool
var verboseFlag int
var dryRunFlag bool
var limitFlag int
var versionFlag bool
var version = "devel"
var commit = "notpassed"

func main() {
// Get the number of cores available for parallelization
Expand Down Expand Up @@ -91,8 +94,16 @@ func main() {
// Flag to set a limit to the number of instances returned by the SSM/EC2 API query
flag.IntVar(&limitFlag, "limit", 0, "Set a limit for the number of instance results returned per profile/region combination (0 = no limit)")

// Flag to show the version number
flag.BoolVar(&versionFlag, "version", false, "Show version and quit")

flag.Parse()

if versionFlag {
fmt.Printf("Version: %s\tGit Commit Hash: %s\n", version, commit)
os.Exit(0)
}

if verboseFlag == 0 && dryRunFlag {
verboseFlag = 1
}
Expand Down
11 changes: 11 additions & 0 deletions cmd/ssm-session/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ var dryRunFlag bool
var sessionName string
var limitFlag int
var totalInstances int
var versionFlag bool
var version = "devel"
var commit = "notpassed"

func main() {
// Get the number of cores available for parallelization
Expand Down Expand Up @@ -96,8 +99,16 @@ func main() {
// Flag to set a limit to the number of instances returned by the SSM/EC2 API query
flag.IntVar(&limitFlag, "limit", 20, "Set a limit for the number of instance results returned per profile/region combination.")

// Flag to show the version number
flag.BoolVar(&versionFlag, "version", false, "Show version and quit")

flag.Parse()

if versionFlag {
fmt.Printf("Version: %s\tGit Commit Hash: %s\n", version, commit)
os.Exit(0)
}

if verboseFlag == 3 {
log.SetLevel(log.DebugLevel)
}
Expand Down