market.rs (855B)
1 use clap::{Args, Subcommand}; 2 3 use crate::cli::listing::LookupArgs; 4 5 #[derive(Debug, Clone, Args)] 6 pub struct MarketArgs { 7 #[command(subcommand)] 8 pub command: MarketCommand, 9 } 10 11 #[derive(Debug, Clone, Subcommand)] 12 pub enum MarketCommand { 13 Refresh, 14 Product(MarketProductArgs), 15 Listing(MarketListingArgs), 16 } 17 18 #[derive(Debug, Clone, Args)] 19 pub struct MarketProductArgs { 20 #[command(subcommand)] 21 pub command: MarketProductCommand, 22 } 23 24 #[derive(Debug, Clone, Subcommand)] 25 pub enum MarketProductCommand { 26 Search(QueryArgs), 27 } 28 29 #[derive(Debug, Clone, Args)] 30 pub struct MarketListingArgs { 31 #[command(subcommand)] 32 pub command: MarketListingCommand, 33 } 34 35 #[derive(Debug, Clone, Subcommand)] 36 pub enum MarketListingCommand { 37 Get(LookupArgs), 38 } 39 40 #[derive(Debug, Clone, Args)] 41 pub struct QueryArgs { 42 pub query: Vec<String>, 43 }