Skip to content

Latest commit

 

History

History
49 lines (40 loc) · 1.39 KB

README.md

File metadata and controls

49 lines (40 loc) · 1.39 KB

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);
}

Dependencies:

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.