Struct rhit::args::Args

source ·
pub struct Args {
Show 19 fields pub help: bool, pub version: bool, pub color: TriBool, pub key: Key, pub length: usize, pub fields: Fields, pub changes: bool, pub date: Option<String>, pub ip: Option<String>, pub method: Option<String>, pub path: Option<String>, pub referer: Option<String>, pub status: Option<String>, pub time: Option<String>, pub all: bool, pub no_name_check: bool, pub output: Output, pub silent_load: bool, pub files: Vec<PathBuf>,
}
Expand description

Program launch argument

Fields§

§help: bool

Print help information

§version: bool

Print the version

§color: TriBool

Whether to have styles and colors

§key: Key

Key used in sorting and histogram, either hits or bytes

§length: usize

Detail level, from 0 to 6, impacts the lengths of tables

§fields: Fields

Comma separated list of hit fields to display. Use -f a to get all fields. Use -f +i to add ip. Available fields: date,time,method,status,ip,ref,path.

§changes: bool

Add tables with more popular and less popular entries (ip, referers and paths)

§date: Option<String>

Filter the dates on a precise day or in an inclusive range (eg: -d 12/24 or -d '2021/12/24-2022/01/21')

§ip: Option<String>

Ip address to filter by. May be negated with a !

§method: Option<String>

HTTP method to filter by. Make it negative with a !. (eg: -m PUT or -m !DELETE or -m none or -m other)

§path: Option<String>

Pattern for path filtering (eg: -p broot or -p '^/\d+' or -p 'miaou | blog')

§referer: Option<String>

Referrer filter

§status: Option<String>

Comma separated list of statuses or status ranges to filter by (eg: -s 514 or -s 4xx,5xx, or -s 310-340,400-450 or -s 5xx,!502)

§time: Option<String>

Filter the time of the day, in the logs’ timezone (eg: -t '>19:30' to get evening hits)

§all: bool

Show all paths, including resources

§no_name_check: bool

Try to open all files, whatever their names

§output: Output

Output: by default pretty summary tables but you can also output log lines as csv, json, or raw (as they appear in the log files)

§silent_load: bool

Don’t print anything during load: no progress bar or file list

§files: Vec<PathBuf>

The log file or folder to analyze. It not provided, logs will be opened at their standard location

Implementations§

source§

impl Args

source

pub fn color(&self) -> bool

Trait Implementations§

source§

impl Args for Args

source§

fn group_id() -> Option<Id>

Report the [ArgGroup::id][crate::ArgGroup::id] for this set of arguments
source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to [Command] so it can instantiate Self. Read more
source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to [Command] so it can update self. Read more
source§

impl CommandFactory for Args

source§

fn command<'b>() -> Command

Build a [Command] that can instantiate Self. Read more
source§

fn command_for_update<'b>() -> Command

Build a [Command] that can update self. Read more
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
source§

impl FromArgMatches for Args

source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches ) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches ) -> Result<(), Error>

Assign values from ArgMatches to self.
source§

fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches ) -> Result<(), Error>

Assign values from ArgMatches to self.
source§

impl Parser for Args

§

fn parse() -> Self

Parse from std::env::args_os(), exit on error
§

fn try_parse() -> Result<Self, Error<RichFormatter>>

Parse from std::env::args_os(), return Err on error.
§

fn parse_from<I, T>(itr: I) -> Selfwhere I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, exit on error
§

fn try_parse_from<I, T>(itr: I) -> Result<Self, Error<RichFormatter>>where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, return Err on error.
§

fn update_from<I, T>(&mut self, itr: I)where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, exit on error
§

fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error<RichFormatter>>where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, return Err on error.

Auto Trait Implementations§

§

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 Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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> Fun for T

source§

fn fun<F, D>(self, f: F) -> Twhere F: FnMut(&T) -> D,

source§

impl<T, U> Into<U> for Twhere 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.