use argh_derive::FromArgs; #[derive(FromArgs)] /// Create Aviary galleries pub struct Args { /// the null pointer server to use #[argh(option, short = 's', default = "\"envs.sh\".to_owned()")] pub server: String, #[argh(subcommand)] pub command: Command, } #[derive(FromArgs)] #[argh(subcommand)] pub enum Command { Create(CreateArgs), Download(DownloadArgs), } #[derive(FromArgs)] #[argh(subcommand, name = "create")] /// upload a series of images to a new gallery pub struct CreateArgs { /// the title of the gallery #[argh(option, short = 't')] pub title: Option, /// A list of image files to post #[argh(positional)] pub images: Vec, } #[derive(FromArgs)] #[argh(subcommand, name = "download")] /// download a gallery pub struct DownloadArgs { #[argh(positional)] /// the file id /// /// This is a short series of characters that identifies the file /// For the url: /// https://0x0.st/asdj.bin#omONdEzrY6SfdBgHn/2P6yG33PeIhuj3/SGm/lDhd2U= /// the file id is asdj pub id: String, #[argh(positional)] /// the encryption key /// /// This is the text after the # sign which is the secret for decrypting the pictures. /// For the url: /// https://0x0.st/asdj.bin#omONdEzrY6SfdBgHn/2P6yG33PeIhuj3/SGm/lDhd2U= /// the encryption key is omONdEzrY6SfdBgHn/2P6yG33PeIhuj3/SGm/lDhd2U= pub key: String, }