nuwax_cli/
project_info.rs1pub mod metadata {
8 pub const PROJECT_NAME: &str = env!("CARGO_PKG_NAME");
10
11 pub const PROJECT_DESCRIPTION: &str = env!("CARGO_PKG_DESCRIPTION");
13
14 pub const PROJECT_AUTHORS: &str = env!("CARGO_PKG_AUTHORS");
16
17 pub const PROJECT_LICENSE: &str = env!("CARGO_PKG_LICENSE");
19
20 pub const PROJECT_REPOSITORY: &str = env!("CARGO_PKG_REPOSITORY");
22
23 pub const PROJECT_HOMEPAGE: &str = env!("CARGO_PKG_HOMEPAGE");
25
26 pub const PROJECT_DOCUMENTATION: &str = env!("CARGO_PKG_HOMEPAGE");
28
29 pub mod display {
31 pub const FRIENDLY_NAME: &str = "Nuwax Cli ent";
33
34 pub const CLI_FULL_NAME: &str = "Nuwax Cli ent CLI";
36
37 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.";
39 }
40
41 pub const PROJECT_KEYWORDS: &[&str] = &[
43 "docker",
44 "service-management",
45 "automation",
46 "deployment",
47 "backup",
48 "upgrade",
49 "monitoring",
50 ];
51
52 pub const PROJECT_CATEGORIES: &[&str] = &[
54 "command-line-utilities",
55 "development-tools",
56 "containerization",
57 ];
58}
59
60pub mod version_info {
62 pub const CLI_VERSION: &str = env!("CARGO_PKG_VERSION");
64
65 pub const CORE_VERSION: &str = client_core::constants::version::version_info::CORE_VERSION;
67
68 pub const DOCKER_SERVICE_VERSION: &str =
70 client_core::constants::version::version_info::DEFAULT_DOCKER_SERVICE_VERSION;
71}
72
73#[derive(Debug, Clone)]
75pub struct ProjectInfo {
76 pub name: &'static str,
77 pub full_name: &'static str,
78 pub description: &'static str,
79 pub description_long: &'static str,
80 pub version: &'static str,
81 pub authors: &'static str,
82 pub license: &'static str,
83 pub repository: &'static str,
84 pub homepage: &'static str,
85 pub documentation: &'static str,
86 pub keywords: &'static [&'static str],
87 pub categories: &'static [&'static str],
88}
89
90pub fn get_project_info() -> ProjectInfo {
92 ProjectInfo {
93 name: metadata::PROJECT_NAME,
94 full_name: metadata::display::CLI_FULL_NAME,
95 description: metadata::PROJECT_DESCRIPTION,
96 description_long: metadata::display::DESCRIPTION_LONG,
97 version: version_info::CLI_VERSION,
98 authors: metadata::PROJECT_AUTHORS,
99 license: metadata::PROJECT_LICENSE,
100 repository: metadata::PROJECT_REPOSITORY,
101 homepage: metadata::PROJECT_HOMEPAGE,
102 documentation: metadata::PROJECT_DOCUMENTATION,
103 keywords: metadata::PROJECT_KEYWORDS,
104 categories: metadata::PROJECT_CATEGORIES,
105 }
106}
107
108pub fn get_version_string() -> String {
110 format!(
111 "{} v{}",
112 metadata::display::FRIENDLY_NAME,
113 version_info::CLI_VERSION
114 )
115}
116
117pub fn get_full_version_string() -> String {
119 format!(
120 "{} v{}\n{}",
121 metadata::display::CLI_FULL_NAME,
122 version_info::CLI_VERSION,
123 metadata::PROJECT_DESCRIPTION
124 )
125}
126
127pub fn get_copyright_info() -> String {
129 format!(
130 "© {} - Licensed under {}",
131 metadata::PROJECT_AUTHORS,
132 metadata::PROJECT_LICENSE
133 )
134}
135
136pub fn get_system_requirements() -> SystemRequirements {
138 use client_core::constants::version::version_info as core_version;
139
140 SystemRequirements {
141 min_docker_version: core_version::MIN_DOCKER_VERSION,
142 min_compose_version: core_version::MIN_COMPOSE_VERSION,
143 api_version: core_version::API_VERSION,
144 config_format_version: core_version::CONFIG_FORMAT_VERSION,
145 database_schema_version: core_version::DATABASE_SCHEMA_VERSION,
146 }
147}
148
149#[derive(Debug, Clone)]
151pub struct SystemRequirements {
152 pub min_docker_version: &'static str,
153 pub min_compose_version: &'static str,
154 pub api_version: &'static str,
155 pub config_format_version: &'static str,
156 pub database_schema_version: &'static str,
157}