Skip to content

Commit

Permalink
Add example in workspace root for git_submodule_versions!().
Browse files Browse the repository at this point in the history
  • Loading branch information
de-vri-es committed Dec 13, 2023
1 parent c815f6b commit 320734e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions git-version/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,14 @@ untracked or changed files.
These macros do not depend on libgit, but simply uses the `git` binary directly.
So you must have `git` installed somewhere in your `PATH`.

You can also get the version information for all submodules:
```rust
use git_version::git_submodule_versions;
const GIT_SUBMODULE_VERSIONS: &[(&str, &str)] = &git_submodule_versions!();

for (path, version) in GIT_SUBMODULE_VERSIONS {
println!("{path}: {version}");
}
```

License: BSD-2-Clause
10 changes: 10 additions & 0 deletions git-version/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@
//!
//! These macros do not depend on libgit, but simply uses the `git` binary directly.
//! So you must have `git` installed somewhere in your `PATH`.
//!
//! You can also get the version information for all submodules:
//! ```
//! use git_version::git_submodule_versions;
//! const GIT_SUBMODULE_VERSIONS: &[(&str, &str)] = &git_submodule_versions!();
//!
//! for (path, version) in GIT_SUBMODULE_VERSIONS {
//! println!("{path}: {version}");
//! }
//! ```

pub use git_version_macro::{git_submodule_versions, git_version};

Expand Down

0 comments on commit 320734e

Please sign in to comment.