Skip to main content

parse_cli

Function parse_cli 

Source
pub fn parse_cli(matches: ArgMatches) -> (VanityFlags, PatternsSource)
Expand description

Parses CLI arguments into VanityFlags and determines the source of the vanity patterns.

§Arguments

  • matches: The ArgMatches object provided by the clap library.

§Returns

  • A tuple containing:
    • VanityFlags: The parsed configuration flags.
    • PatternsSource: The source of the vanity patterns (either a single string or an input file).

§Behavior

  • Determines the blockchain (chain) based on flags (e.g., ethereum, solana, bitcoin).
  • Determines the vanity mode (vanity_mode) based on flags (e.g., regex, anywhere, suffix, prefix).
  • Parses the number of threads, defaulting to 16 if not specified.
  • Detects whether patterns are provided via a single string or an input file.