Skip to content

Commit

Permalink
Merge pull request #6 from fujiwara/pending
Browse files Browse the repository at this point in the history
add --pending flag.
  • Loading branch information
fujiwara committed Mar 28, 2024
2 parents b130e5a + d0ad316 commit 7285cf5
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
```
Expand Down
1 change: 1 addition & 0 deletions cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
3 changes: 3 additions & 0 deletions riex.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 7285cf5

Please sign in to comment.