2022-08-14 15:54:20 +00:00
|
|
|
use std::path::PathBuf;
|
|
|
|
|
2022-08-12 00:00:13 +00:00
|
|
|
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,
|
|
|
|
|
2022-08-12 20:14:30 +00:00
|
|
|
#[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<String>,
|
|
|
|
|
2022-08-12 00:00:13 +00:00
|
|
|
/// A list of image files to post
|
|
|
|
#[argh(positional)]
|
|
|
|
pub images: Vec<String>,
|
|
|
|
}
|
2022-08-12 20:14:30 +00:00
|
|
|
|
|
|
|
#[derive(FromArgs)]
|
|
|
|
#[argh(subcommand, name = "download")]
|
|
|
|
/// download a gallery
|
|
|
|
pub struct DownloadArgs {
|
2022-08-14 01:56:38 +00:00
|
|
|
#[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,
|
2022-08-14 15:54:20 +00:00
|
|
|
|
|
|
|
#[argh(option, short='o')]
|
|
|
|
/// the directory to put the new files into
|
|
|
|
///
|
|
|
|
/// A directory will be generated based on the name of the gallery if this is not set
|
|
|
|
pub output: Option<PathBuf>,
|
2022-08-12 20:14:30 +00:00
|
|
|
}
|