Skip to content

Commit

Permalink
Add docs for the new impl_* macros.
Browse files Browse the repository at this point in the history
  • Loading branch information
parasyte committed Feb 10, 2024
1 parent 05a5640 commit aa55ca9
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,16 @@ pub fn parse<T: OnlyArgs>() -> Result<T, CliError> {
}

mod macros {
/// Creates a generic `HELP` string for [`OnlyArgs`] implementations.
///
/// The string will take the following form, filling in details from the package's `Cargo.toml`:
///
/// ```text
/// {package-name} v{package-version}
/// {package-description}
/// ```
///
/// [`OnlyArgs`]: crate::OnlyArgs
#[macro_export]
macro_rules! impl_help {
() => {
Expand All @@ -207,6 +217,15 @@ mod macros {
};
}

/// Creates a generic `VERSION` string for [`OnlyArgs`] implementations.
///
/// The string will take the following form, filling in details from the package's `Cargo.toml`:
///
/// ```text
/// {package-name} v{package-version}
/// ```
///
/// [`OnlyArgs`]: crate::OnlyArgs
#[macro_export]
macro_rules! impl_version {
() => {
Expand Down

0 comments on commit aa55ca9

Please sign in to comment.