diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8a9da35..7271b81 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,13 +12,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.22" - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v3 + uses: goreleaser/goreleaser-action@v5 with: version: latest args: release --rm-dist diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 89e7fdf..ac53321 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,18 +5,18 @@ jobs: strategy: matrix: go: - - "1.20" + - "1.22" name: Build runs-on: ubuntu-latest steps: - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version: ${{ matrix.go }} id: go - name: Check out code into the Go module directory - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build & Test run: | diff --git a/README.md b/README.md index 77150c0..303d4ef 100644 --- a/README.md +++ b/README.md @@ -27,8 +27,11 @@ Arguments: Flags: -h, --help Show context-sensitive help. --active Show active reserved instances. + --pending Show payment-pending reserved instances. --expired=INT Show reserved instances expired in the last specified days. --format="json" Output format.(json, markdown, tsv) + --dummy-output Dummy output for testing. + --dummy-end-time=TIME Endtime for testing. works only with --dummy-output. --ignore-tags=KEY=VALUE;... Resource tag for ignore RI. --local-time Use local time for output. ``` diff --git a/cli.go b/cli.go index f8a84bd..752e00d 100644 --- a/cli.go +++ b/cli.go @@ -9,6 +9,7 @@ import ( type Option struct { Active bool `help:"Show active reserved instances."` + Pending bool `help:"Show payment-pending reserved instances."` Expired int `help:"Show reserved instances expired in the last specified days."` Days int `arg:"" help:"Show reserved instances that will be expired within specified days."` Format string `enum:"json,markdown,tsv" help:"Output format.(json, markdown, tsv)" default:"json"` diff --git a/riex.go b/riex.go index fd4bf81..1c63182 100644 --- a/riex.go +++ b/riex.go @@ -199,6 +199,9 @@ func (app *Riex) isPrintable(ri ReservedInstance) bool { if app.option.Active && strings.ToLower(ri.State) == "active" { return true } + if app.option.Pending && strings.ToLower(ri.State) == "payment-pending" { + return true + } if ri.EndTime.After(app.startTime) && ri.EndTime.Before(app.endTime) { return true }