| 1 | //! `/sessions` command. |
| 2 | |
| 3 | use crate::commands::traits::{CommandInfo, RegisterCommand}; |
| 4 | use crate::localization::MessageId; |
| 5 | use crate::tui::app::App; |
| 6 | |
| 7 | use super::CommandResult; |
| 8 | |
| 9 | pub(in crate::commands) const COMMAND_INFO: CommandInfo = CommandInfo { |
| 10 | name: "sessions", |
| 11 | aliases: &["resume"], |
| 12 | usage: "/sessions [show|open <id>|archive <id>|unarchive <id>|prune <days>]", |
| 13 | description_id: MessageId::CmdSessionsDescription, |
| 14 | }; |
| 15 | |
| 16 | pub(in crate::commands) struct SessionsCmd; |
| 17 | |
| 18 | impl RegisterCommand for SessionsCmd { |
| 19 | fn info() -> &'static CommandInfo { |
| 20 | &COMMAND_INFO |
| 21 | } |
| 22 | |
| 23 | fn execute(app: &mut App, arg: Option<&str>) -> CommandResult { |
| 24 | super::session::sessions(app, arg) |
| 25 | } |
| 26 | } |
| 27 |