mirror of
https://github.com/figsoda/mmtc
synced 2024-11-29 10:10:17 +00:00
improve docs
This commit is contained in:
parent
9af2e8c3c0
commit
9e72ae3155
4 changed files with 85 additions and 24 deletions
58
Cargo.lock
generated
58
Cargo.lock
generated
|
@ -143,6 +143,7 @@ dependencies = [
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"strsim",
|
"strsim",
|
||||||
"termcolor",
|
"termcolor",
|
||||||
|
"terminal_size",
|
||||||
"unicase",
|
"unicase",
|
||||||
"unicode-width",
|
"unicode-width",
|
||||||
]
|
]
|
||||||
|
@ -261,6 +262,27 @@ dependencies = [
|
||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "errno"
|
||||||
|
version = "0.2.8"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1"
|
||||||
|
dependencies = [
|
||||||
|
"errno-dragonfly",
|
||||||
|
"libc",
|
||||||
|
"winapi",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "errno-dragonfly"
|
||||||
|
version = "0.1.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf"
|
||||||
|
dependencies = [
|
||||||
|
"cc",
|
||||||
|
"libc",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "event-listener"
|
name = "event-listener"
|
||||||
version = "2.5.3"
|
version = "2.5.3"
|
||||||
|
@ -348,12 +370,24 @@ dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "io-lifetimes"
|
||||||
|
version = "0.7.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e6e481ccbe3dea62107216d0d1138bb8ad8e5e5c43009a098bd1990272c497b0"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.134"
|
version = "0.2.134"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "329c933548736bc49fd575ee68c89e8be4d260064184389a5b77517cddd99ffb"
|
checksum = "329c933548736bc49fd575ee68c89e8be4d260064184389a5b77517cddd99ffb"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "linux-raw-sys"
|
||||||
|
version = "0.0.46"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lock_api"
|
name = "lock_api"
|
||||||
version = "0.4.9"
|
version = "0.4.9"
|
||||||
|
@ -551,6 +585,20 @@ dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rustix"
|
||||||
|
version = "0.35.12"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "985947f9b6423159c4726323f373be0a21bdb514c5af06a849cb3d2dce2d01e8"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags",
|
||||||
|
"errno",
|
||||||
|
"io-lifetimes",
|
||||||
|
"libc",
|
||||||
|
"linux-raw-sys",
|
||||||
|
"windows-sys",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "scopeguard"
|
name = "scopeguard"
|
||||||
version = "1.1.0"
|
version = "1.1.0"
|
||||||
|
@ -658,6 +706,16 @@ dependencies = [
|
||||||
"winapi-util",
|
"winapi-util",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "terminal_size"
|
||||||
|
version = "0.2.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8440c860cf79def6164e4a0a983bcc2305d82419177a0e0c71930d049e3ac5a1"
|
||||||
|
dependencies = [
|
||||||
|
"rustix",
|
||||||
|
"windows-sys",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "thiserror"
|
name = "thiserror"
|
||||||
version = "1.0.37"
|
version = "1.0.37"
|
||||||
|
|
|
@ -15,7 +15,6 @@ categories = ["command-line-utilities"]
|
||||||
anyhow = "1.0.66"
|
anyhow = "1.0.66"
|
||||||
async-io = "1.9.0"
|
async-io = "1.9.0"
|
||||||
async-net = "1.7.0"
|
async-net = "1.7.0"
|
||||||
clap = { version = "4.0.18", features = ["cargo", "derive", "unicode"] }
|
|
||||||
crossbeam-queue = "0.3.6"
|
crossbeam-queue = "0.3.6"
|
||||||
crossterm = "0.25.0"
|
crossterm = "0.25.0"
|
||||||
dirs = "4.0.0"
|
dirs = "4.0.0"
|
||||||
|
@ -24,6 +23,10 @@ futures-lite = "1.12.0"
|
||||||
ron = "0.8.0"
|
ron = "0.8.0"
|
||||||
serde = { version = "1.0.147", features = ["derive"] }
|
serde = { version = "1.0.147", features = ["derive"] }
|
||||||
|
|
||||||
|
[dependencies.clap]
|
||||||
|
version = "4.0.18"
|
||||||
|
features = ["cargo", "derive", "unicode", "wrap_help"]
|
||||||
|
|
||||||
[dependencies.tui]
|
[dependencies.tui]
|
||||||
version = "0.19.0"
|
version = "0.19.0"
|
||||||
default-features = false
|
default-features = false
|
||||||
|
|
33
README.md
33
README.md
|
@ -39,26 +39,23 @@ cargo build --release
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```sh
|
|
||||||
mmtc [FLAGS] [OPTIONS]
|
|
||||||
```
|
```
|
||||||
|
Usage: mmtc [OPTIONS]
|
||||||
|
|
||||||
flag | description
|
Options:
|
||||||
-|-
|
--clear-query-on-play Clear query on play
|
||||||
--clear-query-on-play | Clear query on play
|
-C, --cmd [<CMD>...] Run mpd commands and exit
|
||||||
--cycle | Cycle through the queue
|
--cycle Cycle through the queue
|
||||||
-h, --help | Prints help information
|
--no-clear-query-on-play Don't clear query on play
|
||||||
--no-clear-query-on-play | Don't clear query on play
|
--no-cycle Don't cycle through the queue
|
||||||
--no-cycle | Don't cycle through the queue
|
--address <address> Specify the address of the mpd server
|
||||||
-V, --version | Prints version information
|
-c, --config <file> Specify the config file
|
||||||
|
--jump-lines <number> The number of lines to jump
|
||||||
option | description
|
--seek-secs <number> The time to seek in seconds
|
||||||
-|-
|
--ups <number> The amount of status updates per second
|
||||||
--address \<address> | Specify the address of the mpd server
|
-h, --help Print help information (use `--help` for more detail)
|
||||||
-c, --config \<file> | Specify the config file
|
-V, --version Print version information
|
||||||
--jump-lines \<number> | The number of lines to jump
|
```
|
||||||
--seek-secs \<number> | The time to seek in seconds
|
|
||||||
--ups \<number> | The amount of status updates per second
|
|
||||||
|
|
||||||
|
|
||||||
## Environment variables
|
## Environment variables
|
||||||
|
|
13
src/cli.rs
13
src/cli.rs
|
@ -3,19 +3,22 @@ use clap::Parser;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
/// Minimal mpd terminal client that aims to be simple yet highly configurable
|
/// Minimal mpd terminal client that aims to be simple yet highly configurable
|
||||||
///
|
/// https://github.com/figsoda/mmtc
|
||||||
/// Homepage: https://github.com/figsoda/mmtc
|
|
||||||
#[derive(Parser)]
|
#[derive(Parser)]
|
||||||
#[command(version)]
|
#[command(version, verbatim_doc_comment)]
|
||||||
pub struct Opts {
|
pub struct Opts {
|
||||||
/// Clear query on play
|
/// Clear query on play
|
||||||
#[arg(long)]
|
#[arg(long)]
|
||||||
pub clear_query_on_play: bool,
|
pub clear_query_on_play: bool,
|
||||||
|
|
||||||
/// Run mpd commands and quit
|
/// Run mpd commands and exit
|
||||||
|
///
|
||||||
|
/// For example:
|
||||||
|
/// `mmtc -C next pause` will switch to the next song then toggle pause
|
||||||
|
/// `mmtc -C status` will show the current status of mpd
|
||||||
///
|
///
|
||||||
/// See https://mpd.readthedocs.io/en/latest/protocol.html for more information
|
/// See https://mpd.readthedocs.io/en/latest/protocol.html for more information
|
||||||
#[arg(short = 'C', long, num_args = ..)]
|
#[arg(short = 'C', long, num_args = .., verbatim_doc_comment)]
|
||||||
pub cmd: Option<Vec<Vec<u8>>>,
|
pub cmd: Option<Vec<Vec<u8>>>,
|
||||||
|
|
||||||
/// Cycle through the queue
|
/// Cycle through the queue
|
||||||
|
|
Loading…
Reference in a new issue