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};