appinfo

Crates.ioappinfo
lib.rsappinfo
version0.1.2
sourcesrc
created_at2024-08-22 01:51:06.679167
updated_at2024-08-22 21:26:08.643304
descriptionMacro to derive appinfo at compile time using cargo compile-time env vars and `clap-rs`.
homepage
repositoryhttps://github.com/l-const/appinfo-rs
max_upload_size
id1347187
size410,818
Konstantinos Lampropoulos (l-const)

documentation

README

AppInfo Logo

Crates.io version

A procedural macro to derive application info at compile time, using cargo compile-time env vars and `clap-rs`.

Usage

#[appinfo::main]
fn main(){
    println!("hello world");
    cli.do_stuff();
    server.listen(3000);
}
Add clap:
cargo add clap
cargo add appinfo

then in a terminal do:

Example:
❯ ./wonderful-cli -h
wonderful-cli (version: 0.1.0, commit revision: 0.1.0, repository: https://github.com/l-const/wonderful-cli) - A cli app that utilises the appinfo macro.

Details:

Future Enhacements

  • Validation logic that the macro is applied only in main.
  • Override of vars through the macro args.
  • Overridable execution/usage info.
  • Git commit revision using a compile/build time env var.
Commit count: 0

cargo fmt