From 48456cbfa5c406e514dceee178784004340177f1 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Thu, 12 Dec 2024 22:35:07 +0300 Subject: [PATCH] document commands --- src/main.rs | 67 +++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 60 insertions(+), 7 deletions(-) diff --git a/src/main.rs b/src/main.rs index 8cc061c8..532e3eb6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -18,19 +18,72 @@ struct Cli { #[derive(Subcommand)] enum CommandOptions { - Play { index: Option }, + /// Play media at the specified index in the playlist + Play { + /// The index of the media to play + index: Option + }, + + /// Pause the currently playing media Pause, + + /// Stop the playback and quit MPV Stop, + + /// Skip to the next item in the playlist Next, + + /// Skip to the previous item in the playlist Prev, - Seek { seconds: i32 }, - Move { index1: usize, index2: usize }, - Remove { index: Option }, + + /// Seek to a specific position in the currently playing media + Seek { + /// The number of seconds to seek to + seconds: i32 + }, + + /// Move an item in the playlist from one index to another + Move { + /// The index of the item to move + index1: usize, + /// The index to move the item to + index2: usize + }, + + /// Remove an item from the playlist + /// + /// If invoked while playlist has no entries, or if the only entry + /// is the active video, then this will exit MPV. + Remove { + /// The index of the item to remove (optional) + index: Option + }, + + /// Clear the entire playlist Clear, + + /// List all the items in the playlist List, - Add { filenames: Vec }, - Replace { filenames: Vec }, - Prop { properties: Vec }, + + /// Add files to the playlist + /// + /// Needs at least one file to be passed. + Add { + /// The filenames of the files to add + filenames: Vec + }, + + /// Replace the current playlist with new files + Replace { + /// The filenames of the files to replace the playlist with + filenames: Vec + }, + + /// Fetch properties of the current playback or playlist + Prop { + /// The properties to fetch + properties: Vec + }, } const SOCKET_PATH: &str = "/tmp/mpvsocket";