diff --git a/README.md b/README.md index 764143a..1e47846 100644 --- a/README.md +++ b/README.md @@ -31,8 +31,7 @@ go install cmd/vjr/vjr.go # Usage -Velojiraptor provides various commands. With the `-h` or `--help` flag every command's help can be displayed. Most -commands support different output formats. This can be controlled with the `--format` flag. +Velojiraptor provides various commands. With the `-h` or `--help` flag every command's help can be displayed. ## Search @@ -95,3 +94,15 @@ export JIRA_URL=https://baz.atlassian.net vjr search count --jql "type = bug AND statusCategory NOT IN (Done)" ``` + +## Formats + +Most commands support different output formats. This can be controlled with the `--format` flag. + +```bash +# Table +vjr search --jql "project IN (Foo)" +vjr --format table --jql "project IN (Foo)" +# CSV +vjr --format csv search --jql "project IN (Foo)" +``` diff --git a/internal/report/lead_time.go b/internal/report/lead_time.go index b78fea5..8ab8d80 100644 --- a/internal/report/lead_time.go +++ b/internal/report/lead_time.go @@ -29,14 +29,14 @@ func LeadTime(issues *[]jira.Issue, excludedStatuses []string) LeadTimeReport { timeInStatusReport := TimeInStatus(issues, excludedStatuses) min, max, grandTotal := time.Duration(0), time.Duration(0), time.Duration(0) - for _, record := range timeInStatusReport.Summaries { + for i, record := range timeInStatusReport.Summaries { total := time.Duration(0) for _, duration := range record.Statuses { total += duration } - if min > total || min == 0 { + if min > total || i == 0 { min = total }