refactor: the style system has been changed and replaced functions (printc, colored) have been removed in src/utils/cli_styles.rs. Most files in src/cli have been heavily modified to migrate to the new system

This commit is contained in:
alex-xr555
2026-09-24 01:10:19 +03:00
parent e9d09eacaf
commit 3b6251ec33
15 changed files with 201 additions and 195 deletions

View File

@@ -15,7 +15,8 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
use crate::utils::cli_styles::{BOLD_CYAN, BOLD_GREEN, printc};
use crate::utils::cli_styles::{HELP_EXAMPLES_ST, HELP_SECTION_TITLE_ST};
use crate::utils::log::sprintln;
/// Displays the help information for the DCR CLI tool.
///
@@ -27,10 +28,10 @@ pub fn help() -> i32 {
println!("DCR (Dexoron Cargo Realization)");
println!("C project manager inspired by Cargo.");
println!();
printc("USAGE:", BOLD_GREEN);
printc(" dcr <command> [options]", BOLD_CYAN);
sprintln!(HELP_SECTION_TITLE_ST, "USAGE:");
sprintln!(HELP_EXAMPLES_ST, " dcr <command> [options]");
println!();
printc("COMMANDS:", BOLD_GREEN);
sprintln!(HELP_SECTION_TITLE_ST, "COMMANDS:");
println!(" new <name> Create a new project");
println!(" init Initialize the current directory as a project");
println!(" build [--profile] Build the project (default: --debug)");
@@ -43,24 +44,24 @@ pub fn help() -> i32 {
println!(" setup Show configured package registries");
println!(" clean Remove the target directory");
println!(" gen <subcommand> Generate IDE integration files");
printc("FLAGS:", BOLD_GREEN);
sprintln!(HELP_SECTION_TITLE_ST, "FLAGS:");
println!(" --help Show command help");
println!(" --update Update dcr to the latest version");
println!(" --version Show dcr version");
println!();
printc("OPTIONS:", BOLD_GREEN);
sprintln!(HELP_SECTION_TITLE_ST, "OPTIONS:");
println!(" --debug Use debug profile");
println!(" --release Use release profile");
println!(" --force Force rebuild (build/run)");
println!(" --clean Clean before build (build/run)");
println!(" --all Clean all workspace members (clean)");
println!();
printc("EXAMPLES:", BOLD_GREEN);
printc(" dcr new hello", BOLD_CYAN);
printc(" dcr build --release", BOLD_CYAN);
printc(" dcr run --debug", BOLD_CYAN);
sprintln!(HELP_SECTION_TITLE_ST, "EXAMPLES:");
sprintln!(HELP_EXAMPLES_ST, " dcr new hello");
sprintln!(HELP_EXAMPLES_ST, " dcr build --release");
sprintln!(HELP_EXAMPLES_ST, " dcr run --debug");
println!();
printc("TIP:", BOLD_GREEN);
sprintln!(HELP_SECTION_TITLE_ST, "TIP:");
println!(" Run 'dcr <command> --help' for command-specific help.");
0
}