docopticon 0.1.2

An argument-parser based on the obligatory help-text
Documentation
pub enum ArgType<'a> {
    Argument {
        /// Longhand name for the argument.
        name: &'a str,
        /// Help text.
        help: &'a str,
        /// Minimum number of this argument that need to be specified.
        num_required: u8,
        // /// [`FlagSet`] containing whatever flags are specified for the argument. Like, whether or not
        // /// the argument is repeatable or globally specifiable.
        // flags: FlagSet<ArgFlags>,
        /// Explicit shorthand for the argument.
        short: Option<&'a str>,
        // /// Callback this argument triggers.
        // callback: Option<F>,
    },
    Parameter {
        /// Name for the parameter.
        name: &'a str,
        /// Minimum number of this parameter that need to be specified.
        num_required: u8,
        // /// [`FlagSet`] containing whatever flags are specified for the parameter. Like, whether or not
        // /// the parameter is repeatable or globally specifiable.
        // flags: FlagSet<ParameterFlags>,
    },
}

/// A hierarchical tree structure containing all necessary information to parse an argument list
/// and return the appropriate results.
// pub struct ArgTree<const N: usize> {
pub struct ArgTree<'t> {
    nodes: Vec<Node<'t>>,
}

pub struct Node<'n>(ArgType<'n>);

// /// Resulting data structure from parsing a list of argument in relation to an [ArgTree].
// pub struct ParsedTree {
// }

// impl ArgTree {
//     pub const fn new() -> Self {
//         unimplemented!()
//     }
//
//     // pub fn parse_args(args: &str) -> Result<ParsedTree> {
//     //     unimplemented!()
//     // }
// }

/// A collection of arguments.
pub struct Arguments<'a> {
    options: &'a [&'static str],
    subcommands: &'a [&'static str],
}