#![warn(missing_docs)]
#![warn(clippy::std_instead_of_core)]
#![warn(clippy::std_instead_of_alloc)]
#![deny(unsafe_code)]
#![doc = include_str!("../README.md")]
extern crate alloc;
pub mod completions;
mod format;
pub mod help;
pub(crate) mod arg;
pub(crate) mod error;
pub(crate) mod span;
pub use completions::{Shell, generate_completions, generate_completions_for_shape};
pub use error::{ArgsErrorKind, ArgsErrorWithInput};
pub use format::from_slice;
pub use format::from_slice_with_config;
pub use format::from_std_args;
pub use help::{HelpConfig, generate_help, generate_help_for_shape};
facet::define_attr_grammar! {
ns "args";
crate_path ::facet_args;
pub enum Attr {
Positional,
Named,
Short(Option<char>),
Subcommand,
Counted,
}
}
pub fn is_counted_field(field: &facet_core::Field) -> bool {
field.has_attr(Some("args"), "counted")
}
pub const fn is_supported_counted_type(shape: &'static facet_core::Shape) -> bool {
use facet_core::{NumericType, PrimitiveType, Type};
matches!(
shape.ty,
Type::Primitive(PrimitiveType::Numeric(NumericType::Integer { .. }))
)
}