Skip to main content

CliArgsParser

Struct CliArgsParser 

Source
pub struct CliArgsParser {
Show 24 fields pub do_export: bool, pub export_as_opml2: bool, pub do_vacuum: bool, pub do_cleanup: bool, pub program_name: String, pub show_version: usize, pub silent: bool, pub importfile: Option<PathBuf>, pub readinfo_import_file: Option<PathBuf>, pub readinfo_export_file: Option<PathBuf>, pub return_code: Option<i32>, pub display_msg: String, pub should_print_usage: bool, pub refresh_on_start: bool, pub url_file: Option<PathBuf>, pub lock_file: Option<PathBuf>, pub cache_file: Option<PathBuf>, pub config_file: Option<PathBuf>, pub queue_file: Option<PathBuf>, pub search_history_file: Option<PathBuf>, pub cmdline_history_file: Option<PathBuf>, pub cmds_to_execute: Vec<String>, pub log_file: Option<PathBuf>, pub log_level: Option<Level>,
}

Fields§

§do_export: bool§export_as_opml2: bool§do_vacuum: bool§do_cleanup: bool§program_name: String§show_version: usize§silent: bool§importfile: Option<PathBuf>

If this contains some value, it’s the path to the OPML file that should be imported.

§readinfo_import_file: Option<PathBuf>

If this contains some value, it’s the path to the file from which the list of read articles should be imported.

§readinfo_export_file: Option<PathBuf>

If this contains some value, it’s the path to the file to which the list of read articles should be exported.

§return_code: Option<i32>

If this contains some value, the creator of CliArgsParser object should call exit(return_code).

§display_msg: String

If display_msg is not empty, the creator of CliArgsParser should print its contents to stderr.

\note The contents of this string should be checked before processing return_code.

§should_print_usage: bool

If should_print_usage is true, the creator of CliArgsParser object should print usage information.

\note This field should be checked before processing return_code.

§refresh_on_start: bool§url_file: Option<PathBuf>

If this contains some value, it’s the path to the url file specified by the user.

§lock_file: Option<PathBuf>

If this contains some value, it’s the path to the lock file derived from the cache file path specified by the user.

§cache_file: Option<PathBuf>

If this contains some value, it’s the path to the cache file specified by the user.

§config_file: Option<PathBuf>

If this contains some value, it’s the path to the config file specified by the user.

§queue_file: Option<PathBuf>

If this contains some value, it’s the path to the podboat queue file specified by the user.

§search_history_file: Option<PathBuf>

If this contains some value, it’s the path to the search history file specified by the user.

§cmdline_history_file: Option<PathBuf>

If this contains some value, it’s the path to the command line history file specified by the user.

§cmds_to_execute: Vec<String>

A vector of Newsboat commands to execute. Empty means user didn’t specify any commands to run.

\note The parser does not check if the passed commands are valid.

§log_file: Option<PathBuf>

If this contains some value, it’s the path to the log file specified by the user.

§log_level: Option<Level>

If this contains some value, it’s the log level specified by the user.

Implementations§

Trait Implementations§

Source§

impl Default for CliArgsParser

Source§

fn default() -> CliArgsParser

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

Auto Trait Implementations§

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.