Adding dependencies

Add a dependency to Cargo.toml:

clap = "2.32"

This crate provides useful macros for adding meta information about the program. These are as follows:

  • crate_name!: Returns the name of the crate
  • crate_version!: Returns the version of the crate
  • crate_authors!: Returns the list of authors
  • crate_description!: Provides the description of the crate

All information for these macros is taken from the Cargo.toml file.

Import the necessary types. We need two types, which are App and Arg, and the macros mentioned previously:

use clap::{crate_authors, crate_description, crate_name, crate_version, Arg, App};
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.80.45