omg_api/
web.rs

1use clap::Subcommand;
2
3#[derive(Debug, Subcommand)]
4pub enum Web {
5    /// Get web content and information for an omg.lol address
6    Get,
7    /// Update web content for an omg.lol address
8    Set {
9        /// New content for the web page
10        content: String,
11        /// Publish this page
12        #[arg(short, long, default_value_t = false)]
13        publish: bool,
14    },
15    /// Set profile picture for an omg.lol address
16    SetPFP {
17        /// Path to image to upload as new profile picture
18        image: String,
19        // TODO: #[arg(value_parser = fn_that_takes_str_ref_and_returns_result_pathbuf)]
20        // Eg: #[arg(value_parser = |arg: &str| -> Result<Duration, ParseIntError> {Ok(Duration::from_secs(arg.parse()?))})]
21    },
22}
23
24impl Web {
25    pub fn process(&self, _address: &str) {
26        match self {
27            Web::Get => todo!(),
28            Web::Set { content: _, publish: _ } => todo!(),
29            Web::SetPFP { image: _ } => todo!(),
30        }
31    }
32}