More detailed error message in case of command parse error (#684)

* Refactored `command::parse`

* Removed unnecessary duplication in error msg

* Renamed `NotEnoughArgs` -> `InsufficientArgs`

* Inaccurate var name

* Ditch wordy error prefix

* Use `split_whitespace` instead of regex

* Cleanup unused regex import

* `insert` cmd fails fast

* Refactor: use `and_then` instead of `unwrap`

* Updated `Command::to_string`

* Added `Command::basename`

* Better err msg when running cmd in unsupported view, fully closes #597

* Sort `match` branches by their order in the enum
This commit is contained in:
cyqsimon
2022-01-02 03:48:34 +08:00
committed by GitHub
parent 075ecd0e24
commit 9771c36c7b
6 changed files with 562 additions and 304 deletions

View File

@@ -358,7 +358,7 @@ impl Spotify {
}
}
#[derive(Debug, PartialEq)]
#[derive(Copy, Clone, Serialize, Deserialize, Debug, PartialEq)]
pub enum UriType {
Album,
Artist,