Skip to content

Commit

Permalink
Added --all flag as an alias for --max -1
Browse files Browse the repository at this point in the history
  • Loading branch information
aQaTL committed Apr 14, 2018
1 parent e743776 commit bf117b5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ func main() {
Name: "max",
Usage: "visible entries threshold",
},
cli.BoolFlag{
Name: "all, a",
Usage: "display all entries; same as --max -1",
},
cli.StringFlag{
Name: "status",
Usage: "display entries only with given status " +
Expand Down Expand Up @@ -290,7 +294,7 @@ func defaultAction(ctx *cli.Context) error {
//`Max` flag not specified, get value from config
visibleEntries = cfg.MaxVisibleEntries
}
if visibleEntries > len(list) || visibleEntries < 0 {
if visibleEntries > len(list) || visibleEntries < 0 || ctx.Bool("all") {
visibleEntries = len(list)
}
visibleList := list[:visibleEntries]
Expand Down

0 comments on commit bf117b5

Please sign in to comment.