1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! Library command definitions.
use clap::Subcommand;
use crate::constants::{DEFAULT_LIMIT, DEFAULT_OFFSET};
#[derive(Subcommand)]
pub enum LibraryCommand {
/// List saved tracks (liked songs) (alias: ls)
#[command(alias = "ls")]
List {
/// Number of tracks to return (default 20, max 50)
#[arg(long, short = 'l', default_value_t = DEFAULT_LIMIT)]
limit: u8,
/// Offset for pagination
#[arg(long, short = 'o', default_value_t = DEFAULT_OFFSET)]
offset: u32,
},
/// Save tracks to library (like songs)
Save {
/// Track IDs to save
ids: Vec<String>,
/// Save the currently playing track
#[arg(long, short = 'n')]
now_playing: bool,
/// Show what would be done without making changes
#[arg(long)]
dry_run: bool,
},
/// Remove tracks from library (unlike songs)
Remove {
/// Track IDs to remove
#[arg(required = true)]
ids: Vec<String>,
/// Show what would be done without making changes
#[arg(long)]
dry_run: bool,
},
/// Check if tracks are in library
Check {
/// Track IDs to check
#[arg(required = true)]
ids: Vec<String>,
},
}