diff options
author | toymil <B90FCF15A76E432D@outlook.com> | 2024-03-24 22:30:47 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-24 23:30:47 +0900 |
commit | 9deb0333402cb0166f1b2f389f06942a5a3a58de (patch) | |
tree | 22e30f1e1653a57d9c58efe49d358ca0f639cb12 /zellij-utils/src/cli.rs | |
parent | 5fb75ab6d13bd6e22790224a8a0541a8ac73be60 (diff) |
feat: `list-sessions` show newest sessions last, for better user experience (#3194)
* feat: sort `list-sessions` from oldest to newest
by putting the most recent sessions last, the user won't need to scroll back up
to see active sessions when there are a lot of resurrectable sessions.
* feat: add an `--reverse` option to the `list-sessions` subcommand
the `--reverse` flag reverts sorting order back to the old "newest sessions
first". also updated call sites of `list_sessions` and `print_sessions` with
`reverse: true`, to keep the original behavior everywhere else except the output
of `list-sessions` subcommand.
* chore: update the help message
---------
Co-authored-by: Jae-Heon Ji <atx6419@gmail.com>
Diffstat (limited to 'zellij-utils/src/cli.rs')
-rw-r--r-- | zellij-utils/src/cli.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/zellij-utils/src/cli.rs b/zellij-utils/src/cli.rs index 3d30bb391..f224b5ef1 100644 --- a/zellij-utils/src/cli.rs +++ b/zellij-utils/src/cli.rs @@ -106,6 +106,10 @@ pub enum Sessions { /// Print just the session name #[clap(short, long, value_parser, takes_value(false), default_value("false"))] short: bool, + + /// List the sessions in reverse order (default is ascending order) + #[clap(short, long, value_parser, takes_value(false), default_value("false"))] + reverse: bool, }, /// List existing plugin aliases #[clap(visible_alias = "la")] |