// We check for nightly using `build.rs`
extern crate proc_macro;
use crate CommandAttrData;
use TokenStream;
use ToTokens;
use ;
pub use *;
/// Marks a function as a `command`.
///
/// This is the entry point of a command line app, typically the marked function is `main`.
///
/// # Options:
/// - `name`: Name of the command, by default is the `executable` name.
/// - `description`: Description of the command.
/// - `usage`: Information of the usage of the command.
/// - `help`: Help information about the command.
/// - `version`: Version of the command-line app.
///
/// # Example:
/// ```ignore
/// use clapi::macros::*;
///
/// #[command(description="A sample app", version=1.0)]
/// fn main(){
/// println!("Hello World!");
/// }
/// ```
/// Marks a function as a `command`.
///
/// This is the entry point of a command line app, typically the marked function is `main`.
///
/// # Options:
/// - `name`: Name of the command, by default is the `executable` name.
/// - `description`: Description of the command.
/// - `usage`: Information of the usage of the command.
/// - `help`: Help information about the command.
/// - `version`: Version of the command-line app.
///
/// # Example:
/// ```ignore
/// use clapi::macros::*;
///
/// #[command(description="A sample app", version=1.0)]
/// fn main(){
/// println!("Hello World!");
/// }
/// ```
/// Marks a function as a `subcommand`.
///
/// ## Stable
/// Only inner functions of a `command` or `subcommand` can be declared as a subcommand.
///
/// ## Nightly
/// When compiling for `nightly` rust any free function or inner can be marked as a `subcommand`.
///
/// # Options:
/// - `name`: Name of the subcommand, by default is the function name.
/// - `description`: Description of the command.
/// - `usage`: Information of the usage of the command.
/// - `help`: Help information about the command.
/// - `version`: Version of the command-line app.
///
/// # Example:
/// ```ignore
/// use clapi::macros::*;
///
/// #[command]
/// fn main(){
/// #[subcommand(description="A test function")]
/// fn test(){
/// println!("This is a test");
/// }
/// }
/// ```
// Change `require_assign` to?
// TODO: #[option(name, assignable=true)]
// TODO: #[option(name, assign=true)]
/// Declares a command option.
///
/// Any option declaration must contains the name of the argument for example:
/// `#[option(name)]`.
///
/// By default any function argument is considered a command `option`,
/// Use this attribute to provide additional information like `arg`, `alias`,
/// `description` or `min`, `max`, `default` and `values` arguments.
///
/// # Options
/// - `name`: Name of the option, by default is the function argument name.
/// - `arg`: Name of the option argument, by default is the function argument name.
/// - `alias`: Alias of the function argument.
/// - `description`: Description of the option.
/// - `min`: Min number of values the option takes.
/// - `max`: Max number of values the option takes.
/// - `default`: Default value(s) of the option.
/// - `values`: Valid values of the option.
/// - `hidden`: If the option is hidden for the help.
/// - `multiple`: If the option allow multiple declarations.
/// - `flag`: If the option is a bool flag, by default is `true`
/// - `error`: Error show when the value is invalid.
/// - `require_assign`: If the option requires to use `=` to assign the value, by default false,
/// - `global`: If the option is global, by default false.
/// - `from_global`: If the option is declared as global in a parent, by default false.
///
/// Function arguments can be declared as the following types:
/// - Any type that implement `FromStr`.
/// - `Vec<T>` where `T` implements `FromStr`.
/// - `&[T]` slices where `T` implements `FromStr`.
/// - `Option<T>` where `T` implements `FromStr`.
///
/// # Example:
/// ```ignore
/// use clapi::macros::*;
///
/// #[command]
/// #[option(repeat, alias="r", default=1)]
/// #[option(upper_case, alias="u", description="Display the message in uppercase")]
/// fn main(repeat: u32, upper_case: bool){
/// for _ in 0..repeat {
/// if upper_case {
/// println!("HELLO WORLD");
/// } else {
/// println!("hello world");
/// }
/// }
/// }
/// ```
/// Declares a command argument.
///
/// Any argument declaration must contains the name of the argument for example:
/// `#[arg(name)]`.
///
/// # Options
/// - `name`: Name of the argument, by default is the function argument name.
/// - `min`: Min number of values the argument takes.
/// - `max`: Max number of values the argument takes.
/// - `default`: Default value(s) of the argument.
/// - `values`: Valid values of the argument.
/// - `error`: Error show when the value is invalid.
///
/// Function arguments can be declared as the following types:
/// - Any type that implement `FromStr`.
/// - `Vec<T>` where `T` implements `FromStr`.
/// - `&[T]` slices where `T` implements `FromStr`.
/// - `Option<T>` where `T` implements `FromStr`.
///
/// # Examples:
/// ```ignore
/// use clapi::macros::*;
///
/// #[command]
/// #[arg(args, min=1, max=10, default="Hello World")]
/// fn main(args: Vec<String>){
/// println!("{}", args.join(" "));
/// }
/// ```
/// Specify the function that provides a help message for a command.
/// Specify the function that provides a usage message for a command.