Fn

Function Fn 

Source
pub fn Fn() -> ArgMatches
Expand description

Creates and returns the command-line argument matches for the Rest application.

This function sets up the command-line interface using the clap crate, defining various arguments and their properties such as short and long names, help messages, default values, and whether they are required.

§Returns

Returns an ArgMatches instance containing the parsed command-line arguments.

§Argument

  • Exclude - An optional argument to specify patterns to exclude. Default is “node_modules”.
  • Parallel - An optional flag to enable parallel processing.
  • Pattern - An optional argument to specify a pattern to match. Default is “.git”.
  • Root - An optional argument to specify the root directory. Default is “.”.

§Example

let matches = Fn();
let exclude = matches.value_of("Exclude").unwrap_or("node_modules");
let parallel = matches.is_present("Parallel");
let pattern = matches.value_of("Pattern").unwrap_or(".git");
let root = matches.value_of("Root").unwrap_or(".");

§Errors

This function will panic if there are issues with the argument definitions or parsing.