Skip to content

Commit

Permalink
add aliases for product names
Browse files Browse the repository at this point in the history
  • Loading branch information
jftuga committed Apr 9, 2020
1 parent 14db6ae commit 81c4763
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions spotprice.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/olekukonko/tablewriter"
)

const version = "0.1.2"
const version = "0.1.3"

type spotPriceItem struct {
Region string
Expand Down Expand Up @@ -95,7 +95,7 @@ func main() {
argsRegion := flag.String("reg", "", "A comma-separated list of regular-expressions to match regions (eg: us-.*2b)")
argsAZ := flag.String("az", "", "A comma-separated list of regular-expressions to match AZs (eg: us-*1a)")
argsInst := flag.String("inst", "", "A comma-separated list of exact Instance Type names (eg: t2.small,t3a.micro,c5.large)")
argsProd := flag.String("prod", "", "A comma-separated list of exact, case-sensitive Product Names (eg: Windows,Linux/UNIX,SUSE Linux,Red Hat Enterprise Linux)")
argsProd := flag.String("prod", "", "A comma-separated list of exact, case-sensitive Product Names (eg: Windows,win,Linux/UNIX,lin,SUSE Linux,Red Hat Enterprise Linux)")
argsMaxPrice := flag.Float64("max", 0.00, "Only output if spot price is less than or equal to given amount")
//argsOutput := flag.String("out", "", "Set output to 'csv' or 'json'") // to do

Expand Down Expand Up @@ -138,6 +138,11 @@ func main() {
regionSPH.SetInstanceTypes(createAWSStringTypes(*argsInst))
}
if len(*argsProd) > 0 {
if *argsProd == "lin" {
*argsProd = "Linux/UNIX"
} else if *argsProd == "win" {
*argsProd = "Windows"
}
regionSPH.SetProductDescriptions(createAWSStringTypes(*argsProd))
}
go describeRegion(region, *regionSPH, describeCh)
Expand Down

0 comments on commit 81c4763

Please sign in to comment.