Module rg::args

source ·

Structs

  • ArgMatches 🔒
    ArgMatches wraps clap::ArgMatches and provides semantic meaning to the parsed arguments.
  • The primary configuration object used throughout ripgrep. It provides a high-level convenient interface to the provided command line arguments.
  • ArgsImp 🔒
  • SortBy 🔒
    The sort criteria, if present.

Enums

  • The command that ripgrep should execute based on the command line configuration.
  • Encoding mode the searcher will use.
  • OutputKind 🔒
    The output format. Generally, this corresponds to the printer that ripgrep uses to show search results.
  • SortByKind 🔒

Functions

  • Returns a clap matches object if the given arguments parse successfully.
  • Attempts to discover the current working directory. This mostly just defers to the standard library, however, such things will fail if ripgrep is in a directory that no longer exists. We attempt some fallback mechanisms, such as querying the PWD environment variable, but otherwise return an error.
  • hostname 🔒
    Retrieves the hostname that ripgrep should use wherever a hostname is required. Currently, that’s just in the hyperlink format.
  • Tries to assign a timestamp to every Subject in the vector to help with sorting Subjects by time.
  • Attempts to get the hostname by using platform specific routines. For example, this will do gethostname on Unix and GetComputerNameExW on Windows.
  • Sorts by an optional parameter. If parameter is found to be None, both entries compare equal.
  • suggest 🔒
    Inspect an error resulting from building a Rust regex matcher, and if it’s believed to correspond to a syntax error that another engine could handle, then add a message to suggest the use of the engine flag.
  • Inspect an error resulting from building a Rust regex matcher, and if it’s believed to correspond to a syntax error that PCRE2 could handle, then add a message to suggest the use of -P/–pcre2.
  • Convert the result of parsing a human readable file size to a usize, failing if the type does not fit.
  • wsl_prefix 🔒
    Returns a value that is meant to fill in the {wslprefix} variable for a user given hyperlink format. A WSL prefix is a share/network like thing that is meant to permit Windows applications to open files stored within a WSL drive.