pub mod metadata {
pub const PROJECT_NAME: &str = env!("CARGO_PKG_NAME");
pub const PROJECT_DESCRIPTION: &str = env!("CARGO_PKG_DESCRIPTION");
pub const PROJECT_AUTHORS: &str = env!("CARGO_PKG_AUTHORS");
pub const PROJECT_LICENSE: &str = env!("CARGO_PKG_LICENSE");
pub const PROJECT_REPOSITORY: &str = env!("CARGO_PKG_REPOSITORY");
pub const PROJECT_HOMEPAGE: &str = env!("CARGO_PKG_HOMEPAGE");
pub const PROJECT_DOCUMENTATION: &str = env!("CARGO_PKG_HOMEPAGE");
pub mod display {
pub const FRIENDLY_NAME: &str = "Nuwax Cli ent";
pub const CLI_FULL_NAME: &str = "Nuwax Cli ent CLI";
pub const DESCRIPTION_LONG: &str = "An automated Docker service management and upgrade platform client, with centralized Docker Compose management, automatic backups, smart upgrades, and operations monitoring.";
}
pub const PROJECT_KEYWORDS: &[&str] = &[
"docker",
"service-management",
"automation",
"deployment",
"backup",
"upgrade",
"monitoring",
];
pub const PROJECT_CATEGORIES: &[&str] = &[
"command-line-utilities",
"development-tools",
"containerization",
];
}
pub mod version_info {
pub const CLI_VERSION: &str = env!("CARGO_PKG_VERSION");
pub const CORE_VERSION: &str = client_core::constants::version::version_info::CORE_VERSION;
pub const DOCKER_SERVICE_VERSION: &str =
client_core::constants::version::version_info::DEFAULT_DOCKER_SERVICE_VERSION;
}
#[derive(Debug, Clone)]
pub struct ProjectInfo {
pub name: &'static str,
pub full_name: &'static str,
pub description: &'static str,
pub description_long: &'static str,
pub version: &'static str,
pub authors: &'static str,
pub license: &'static str,
pub repository: &'static str,
pub homepage: &'static str,
pub documentation: &'static str,
pub keywords: &'static [&'static str],
pub categories: &'static [&'static str],
}
pub fn get_project_info() -> ProjectInfo {
ProjectInfo {
name: metadata::PROJECT_NAME,
full_name: metadata::display::CLI_FULL_NAME,
description: metadata::PROJECT_DESCRIPTION,
description_long: metadata::display::DESCRIPTION_LONG,
version: version_info::CLI_VERSION,
authors: metadata::PROJECT_AUTHORS,
license: metadata::PROJECT_LICENSE,
repository: metadata::PROJECT_REPOSITORY,
homepage: metadata::PROJECT_HOMEPAGE,
documentation: metadata::PROJECT_DOCUMENTATION,
keywords: metadata::PROJECT_KEYWORDS,
categories: metadata::PROJECT_CATEGORIES,
}
}
pub fn get_version_string() -> String {
format!(
"{} v{}",
metadata::display::FRIENDLY_NAME,
version_info::CLI_VERSION
)
}
pub fn get_full_version_string() -> String {
format!(
"{} v{}\n{}",
metadata::display::CLI_FULL_NAME,
version_info::CLI_VERSION,
metadata::PROJECT_DESCRIPTION
)
}
pub fn get_copyright_info() -> String {
format!(
"© {} - Licensed under {}",
metadata::PROJECT_AUTHORS,
metadata::PROJECT_LICENSE
)
}
pub fn get_system_requirements() -> SystemRequirements {
use client_core::constants::version::version_info as core_version;
SystemRequirements {
min_docker_version: core_version::MIN_DOCKER_VERSION,
min_compose_version: core_version::MIN_COMPOSE_VERSION,
api_version: core_version::API_VERSION,
config_format_version: core_version::CONFIG_FORMAT_VERSION,
database_schema_version: core_version::DATABASE_SCHEMA_VERSION,
}
}
#[derive(Debug, Clone)]
pub struct SystemRequirements {
pub min_docker_version: &'static str,
pub min_compose_version: &'static str,
pub api_version: &'static str,
pub config_format_version: &'static str,
pub database_schema_version: &'static str,
}