Skip to main content

Args

Struct Args 

Source
pub struct Args {
Show 25 fields pub chop: bool, pub content_type: Option<String>, pub dim: bool, pub display: Option<String>, pub examples: bool, pub filter: Vec<String>, pub follow: bool, pub format: Option<String>, pub grep: Vec<String>, pub head: Option<usize>, pub hex: bool, pub line_numbers: bool, pub list_formats: bool, pub live: bool, pub manual: bool, pub no_preprocess: bool, pub output: Option<String>, pub preprocess: Option<String>, pub prettify: bool, pub prompt: Option<String>, pub record_start: Option<String>, pub stdout: bool, pub tab_width: u8, pub tail: Option<usize>, pub files: Vec<PathBuf>,
}

Fields§

§chop: bool

Chop long lines instead of wrapping.

§content_type: Option<String>

Force the content type for --prettify (otherwise auto-detected from the filename extension and the first bytes). Values: auto, raw, json, yaml, toml, xml, html, csv. Setting this implies --prettify (unless the value is raw/auto).

§dim: bool

With --filter, dim non-matching lines instead of hiding them. Keeps surrounding context visible.

§display: Option<String>

Render each parsed line through this template instead of showing the raw line. Syntax: <fieldname> placeholders, \< for literal <, \\ for literal \. Example: --display '[<time>] <status> <msg>'. Overrides the format’s display key (if set). Requires --format. Search still matches against the raw line.

§examples: bool

Print a curated list of usage examples and exit.

§filter: Vec<String>

Filter visible lines by parsed field. Repeatable; multiple filters AND. Operators: = (exact), != (exact ≠), ~ (regex), !~ (regex ≠), <, <=, >, >= (numeric if both sides parse as numbers, else lexicographic). Examples: --filter status=500, --filter ip~^10\., --filter 'status>=500' (quote < and > to avoid shell redirection). Requires --format.

§follow: bool

Follow mode: keep watching the source for new bytes (like tail -f). Jumps to the bottom on startup. Toggle with Shift-F at runtime.

§format: Option<String>

Apply a named log format (built-in or user-defined in ~/.config/tess/formats.toml). Required by --filter.

§grep: Vec<String>

Filter visible lines by regex against the raw line. Repeatable; multiple --grep arguments AND. Works on any input — no --format required. Composes with --filter (both must match) and with --dim (non-matches stay visible but faded). Example: --grep error --grep '^\['.

§head: Option<usize>

Show only the first N lines of the source. Mutually exclusive with –tail.

§hex: bool

Render the source as an xxd-style hex dump instead of byte-faithful text. 16 bytes per row, offset prefix, ASCII gutter. Mutually exclusive with parsing- and rendering-oriented flags.

§line_numbers: bool

Show line numbers.

§list_formats: bool

Print available log formats and their named fields, then exit.

§live: bool

Live mode: re-read the file when its on-disk content changes (mtime, size, or inode). Use this for files rewritten in place — source files being edited, files saved by an editor or AI agent. Different from --follow (which watches for appended bytes); the two are mutually exclusive. Press R inside the pager to force a reload.

§manual: bool

Print the full user manual and exit.

§no_preprocess: bool

Ignore $LESSOPEN. Useful when LESSOPEN is exported but not wanted for one invocation.

§output: Option<String>

Non-interactive batch mode: apply –filter / –grep / –head / –tail / –prettify to the source and write the resulting raw bytes to FILE, then exit. Use - for stdout (--stdout is a synonym). Skips the alt-screen and raw mode entirely. With --follow, doesn’t exit — keeps appending matching new bytes to FILE as they arrive (Ctrl-C to stop). Not compatible with --live.

§preprocess: Option<String>

Pipe the source file through this command before rendering. Must start with |; %s is substituted with the file path. Example: --preprocess '|pdftotext %s -'. Overrides $LESSOPEN.

§prettify: bool

Pretty-print structured content (JSON, YAML, TOML, XML, HTML, CSV). Detects the type from the filename extension or the first bytes; use --content-type=NAME to override. Static files only — not allowed with --follow, --live, or --filter. Toggle interactively with Shift-P; force a type with -P then a letter (j/y/t/x/h/c).

§prompt: Option<String>

Replace the hardcoded status format with a templated string. Uses the same <field> syntax as --display. Available fields: label, top, bottom, total, pct, rec-top, rec-bottom, rec-total, rec-block, wrap-offset, format-tag, filter-tag, grep-tag, hide-tag, search-tag, pretty-tag, live-tag, follow-tag. Per-format default can be set via prompt = '...' in formats.toml. Mutually exclusive with –hex.

§record_start: Option<String>

Treat lines matching REGEX as record boundaries. Lines that don’t match are joined to the preceding record. Affects search, filter, grep, and the status line — all operate on whole records when set. Overrides the active –format’s record_start if both are present. Without –format, this is the only way to enable records mode for plain text. Example: –record-start ‘^[’

§stdout: bool

Synonym for --output -: write the batch-mode output to stdout.

§tab_width: u8

Tab stop width (default 8).

§tail: Option<usize>

Show only the last N lines of the source. For files this skips most of the index work — useful for huge logs. Combine with -f for tail -f. Mutually exclusive with –head. Streaming stdin is not supported.

§files: Vec<PathBuf>

Files to view (only the first is opened in MVP).

Trait Implementations§

Source§

impl Args for Args

Source§

fn group_id() -> Option<Id>

Report the ArgGroup::id for this set of arguments
Source§

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

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

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

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

impl Clone for Args

Source§

fn clone(&self) -> Args

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. 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 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

Source§

fn parse() -> Self

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

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

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

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

Parse from iterator, exit on error.
Source§

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

Parse from iterator, return Err on error.
Source§

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

Update from iterator, exit on error. Read more
Source§

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

Update from iterator, return Err on error.

Auto Trait Implementations§

§

impl Freeze for Args

§

impl RefUnwindSafe for Args

§

impl Send for Args

§

impl Sync for Args

§

impl Unpin for Args

§

impl UnsafeUnpin 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.