git_shell/
lib.rs

1// License: see LICENSE file at root directory of main branch
2
3//! # `git-shell`
4//!
5//! ## Project
6//!
7//! - Repository: <https://bitbucket.org/haibison/git-shell>
8//! - License: Nice License `1.0.1` _(see LICENSE file at root directory of main branch)_
9//! - _This project follows [Semantic Versioning 2.0.0]_
10//!
11//! ## Features
12//!
13//! This project provides a kit, working with Git via shell.
14//!
15//! (This approach is *always* unstable.)
16//!
17//! [Semantic Versioning 2.0.0]: https://semver.org/spec/v2.0.0.html
18
19#![warn(missing_docs)]
20
21// ╔═════════════════╗
22// ║   IDENTIFIERS   ║
23// ╚═════════════════╝
24
25macro_rules! code_name  { () => { "git-shell" }}
26macro_rules! version    { () => { "0.3.1" }}
27
28/// # Crate name
29pub const NAME: &str = "git-shell";
30
31/// # Crate code name
32pub const CODE_NAME: &str = code_name!();
33
34/// # ID of this crate
35pub const ID: &str = concat!(
36    "26068246-35a6c23a-8104a29a-3c68e7ed-537f5455-9311c74a-bcc9ef2c-7d670226-",
37    "d9e88afe-1561b91b-0ec6fdde-44b1c97c-77945bcc-b527a7f1-2675ae5a-dc322f86",
38);
39
40/// # Crate version
41pub const VERSION: &str = version!();
42
43/// # Crate release date (year/month/day)
44pub const RELEASE_DATE: (u16, u8, u8) = (2022, 7, 8);
45
46/// # Tag, which can be used for logging...
47pub const TAG: &str = concat!(code_name!(), "::26068246::", version!());
48
49// ╔════════════════════╗
50// ║   IMPLEMENTATION   ║
51// ╚════════════════════╝
52
53/// # Wrapper for format!(), which prefixes your optional message with: crate::TAG, module_path!(), line!()
54macro_rules! __ {
55    ($($arg: tt)+) => {
56        format!("[{tag}][{module_path}-{line}] {msg}", tag=crate::TAG, module_path=module_path!(), line=line!(), msg=format!($($arg)+))
57    };
58    () => {
59        format!("[{tag}][{module_path}-{line}] (internal error)", tag=crate::TAG, module_path=module_path!(), line=line!())
60    };
61}
62
63pub mod version_info;
64
65mod git;
66
67pub use self::git::*;
68
69/// # Result type used in this crate
70pub type Result<T> = core::result::Result<T, std::io::Error>;
71
72#[test]
73fn test_crate_version() {
74    assert_eq!(VERSION, env!("CARGO_PKG_VERSION"));
75}