Struct Args

Source
pub struct Args {
Show 13 fields pub config: Option<PathBuf>, pub server: Option<String>, pub auth: Option<String>, pub url: Option<String>, pub remote: Option<String>, pub files: Vec<String>, pub oneshot: bool, pub expire: Option<String>, pub prettify: bool, pub print_server_version: bool, pub list_files: bool, pub delete: bool, pub filename: Option<String>,
}
Expand description

Command-line arguments to parse.

Fields§

§config: Option<PathBuf>

Configuration file.

§server: Option<String>

Server address.

§auth: Option<String>

Authentication or delete token.

§url: Option<String>

URL to shorten.

§remote: Option<String>

Remote URL to download file.

§files: Vec<String>

Files to upload.

§oneshot: bool

Whether if the file will disappear after being viewed once.

§expire: Option<String>

Expiration time for the link.

§prettify: bool

Prettify the program output.

§print_server_version: bool

Whether if the server version should be printed.

§list_files: bool

List files on the server (file name, file size, expiry timestamp).

§delete: bool

Delete files from server.

§filename: Option<String>

Send filename header (give uploaded file a specific name).

Implementations§

Source§

impl Args

Source

pub fn parse() -> Self

Parses the command-line arguments.

Trait Implementations§

Source§

impl Debug for Args

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Args

Source§

fn default() -> Args

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Args

§

impl RefUnwindSafe for Args

§

impl Send for Args

§

impl Sync for Args

§

impl Unpin for Args

§

impl UnwindSafe for Args

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,