refactor: renamed src/utils/text.rs to cli_styles

This commit is contained in:
alex-xr555
2026-09-24 00:20:43 +03:00
parent 552f6c8e4f
commit 2f4cde9177
16 changed files with 15 additions and 15 deletions

View File

@@ -18,8 +18,8 @@
use crate::prelude::*; use crate::prelude::*;
use crate::core::{build_config::Config, deps::register}; use crate::core::{build_config::Config, deps::register};
use crate::utils::cli_styles::{BOLD_CYAN, BOLD_GREEN, colored, printc};
use crate::utils::fs::find_project_root; use crate::utils::fs::find_project_root;
use crate::utils::text::{BOLD_CYAN, BOLD_GREEN, colored, printc};
use toml::{Value, map::Map}; use toml::{Value, map::Map};
/// Parsed arguments for the `dcr add` command. /// Parsed arguments for the `dcr add` command.

View File

@@ -28,8 +28,8 @@ use crate::utils::build::{
get_config_opt, get_config_str, get_language_with_profile_or_default, get_string_with_profile, get_config_opt, get_config_str, get_language_with_profile_or_default, get_string_with_profile,
normalize_kind, resolve_artifact_target_dir, resolve_compiler, normalize_kind, resolve_artifact_target_dir, resolve_compiler,
}; };
use crate::utils::cli_styles::{BOLD_CYAN, BOLD_GREEN, BOLD_YELLOW, colored, printc};
use crate::utils::fs::{canonicalize_path, find_project_root}; use crate::utils::fs::{canonicalize_path, find_project_root};
use crate::utils::text::{BOLD_CYAN, BOLD_GREEN, BOLD_YELLOW, colored, printc};
use std::io::IsTerminal; use std::io::IsTerminal;
use std::path::Path; use std::path::Path;
use std::sync::{Arc, atomic::AtomicBool}; use std::sync::{Arc, atomic::AtomicBool};

View File

@@ -20,8 +20,8 @@ use crate::prelude::*;
use crate::core::build_config::Config; use crate::core::build_config::Config;
use crate::core::workspace::parse_workspace; use crate::core::workspace::parse_workspace;
use crate::utils::build::{default_profile_flags, default_target_triple, parse_version_info}; use crate::utils::build::{default_profile_flags, default_target_triple, parse_version_info};
use crate::utils::cli_styles::{BOLD_CYAN, BOLD_GREEN, colored, printc};
use crate::utils::fs::{check_dir, find_project_root, with_dir}; use crate::utils::fs::{check_dir, find_project_root, with_dir};
use crate::utils::text::{BOLD_CYAN, BOLD_GREEN, colored, printc};
use glob::glob; use glob::glob;
use std::{fs, path::Path}; use std::{fs, path::Path};

View File

@@ -17,7 +17,7 @@
use crate::prelude::*; use crate::prelude::*;
use crate::utils::text::{BOLD_CYAN, BOLD_GREEN, printc}; use crate::utils::cli_styles::{BOLD_CYAN, BOLD_GREEN, printc};
use serde::Deserialize; use serde::Deserialize;
use std::fs; use std::fs;
use std::io::Read; use std::io::Read;

View File

@@ -17,7 +17,7 @@
use crate::prelude::*; use crate::prelude::*;
use crate::utils::text::{BOLD_CYAN, BOLD_GREEN, colored, printc}; use crate::utils::cli_styles::{BOLD_CYAN, BOLD_GREEN, colored, printc};
use glob::glob; use glob::glob;
use std::process::Command; use std::process::Command;

View File

@@ -31,7 +31,7 @@ use crate::utils::build::{
use crate::utils::fs::{ use crate::utils::fs::{
absolute_join, atomic_write, canonicalize_path, ensure_dcr_dir, find_project_root, absolute_join, atomic_write, canonicalize_path, ensure_dcr_dir, find_project_root,
}; };
use crate::utils::text::{BOLD_CYAN, BOLD_GREEN, printc}; use crate::utils::cli_styles::{BOLD_CYAN, BOLD_GREEN, printc};
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::time::{SystemTime, UNIX_EPOCH}; use std::time::{SystemTime, UNIX_EPOCH};

View File

@@ -15,7 +15,7 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>. // along with this program. If not, see <https://www.gnu.org/licenses/>.
use crate::utils::text::{BOLD_CYAN, BOLD_GREEN, printc}; use crate::utils::cli_styles::{BOLD_CYAN, BOLD_GREEN, printc};
/// Displays the help information for the DCR CLI tool. /// Displays the help information for the DCR CLI tool.
/// ///

View File

@@ -21,7 +21,7 @@ use crate::config::FILE_MAIN_C;
use crate::core::build_config::{Config, validate_package_name}; use crate::core::build_config::{Config, validate_package_name};
use crate::core::vcs::VcsKind; use crate::core::vcs::VcsKind;
use crate::utils::fs::check_dir; use crate::utils::fs::check_dir;
use crate::utils::text::{BOLD_CYAN, BOLD_GREEN, colored, printc}; use crate::utils::cli_styles::{BOLD_CYAN, BOLD_GREEN, colored, printc};
use std::{fs, io::Write}; use std::{fs, io::Write};
/// Initializes the current working directory as a new DCR project. /// Initializes the current working directory as a new DCR project.

View File

@@ -21,7 +21,7 @@ use crate::core::build::common;
use crate::core::build_config::Config; use crate::core::build_config::Config;
use crate::utils::build::{get_bool_with_profile, get_list_with_profile}; use crate::utils::build::{get_bool_with_profile, get_list_with_profile};
use crate::utils::fs::find_project_root; use crate::utils::fs::find_project_root;
use crate::utils::text::{BOLD_CYAN, BOLD_GREEN, BOLD_YELLOW, colored, printc}; use crate::utils::cli_styles::{BOLD_CYAN, BOLD_GREEN, BOLD_YELLOW, colored, printc};
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::process::Command; use std::process::Command;

View File

@@ -21,7 +21,7 @@ use crate::config::FILE_MAIN_C;
use crate::core::build_config::{Config, validate_package_name}; use crate::core::build_config::{Config, validate_package_name};
use crate::core::vcs::VcsKind; use crate::core::vcs::VcsKind;
use crate::utils::fs::check_dir; use crate::utils::fs::check_dir;
use crate::utils::text::{BOLD_CYAN, BOLD_GREEN, colored, printc}; use crate::utils::cli_styles::{BOLD_CYAN, BOLD_GREEN, colored, printc};
use std::{fs, io::Write}; use std::{fs, io::Write};
/// Executes the `dcr new` command to scaffold a new C/C++ project directory structure. /// Executes the `dcr new` command to scaffold a new C/C++ project directory structure.

View File

@@ -23,7 +23,7 @@ use crate::core::build_config::Config;
use crate::core::runner::run_binary; use crate::core::runner::run_binary;
use crate::utils::build::{normalize_target_os, parse_version_info, substitute_vars}; use crate::utils::build::{normalize_target_os, parse_version_info, substitute_vars};
use crate::utils::fs::{find_project_root, with_dir}; use crate::utils::fs::{find_project_root, with_dir};
use crate::utils::text::{BOLD_CYAN, BOLD_GREEN, colored, printc}; use crate::utils::cli_styles::{BOLD_CYAN, BOLD_GREEN, colored, printc};
use std::{path::Path, process::Command}; use std::{path::Path, process::Command};
/// Retrieves the run command from the config, preferring target-specific, /// Retrieves the run command from the config, preferring target-specific,

View File

@@ -15,7 +15,7 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>. // along with this program. If not, see <https://www.gnu.org/licenses/>.
use crate::utils::text::{BOLD_CYAN, BOLD_GREEN, printc}; use crate::utils::cli_styles::{BOLD_CYAN, BOLD_GREEN, printc};
/// Sets up DCR registries by loading the registry manager and printing the list of registries. /// Sets up DCR registries by loading the registry manager and printing the list of registries.
pub fn setup(args: &[String]) -> i32 { pub fn setup(args: &[String]) -> i32 {

View File

@@ -25,7 +25,7 @@ use crate::utils::build::{
get_string_with_profile, resolve_compiler, resolve_pkg_config_flags, get_string_with_profile, resolve_compiler, resolve_pkg_config_flags,
}; };
use crate::utils::fs::{find_project_root, with_dir}; use crate::utils::fs::{find_project_root, with_dir};
use crate::utils::text::{BOLD_CYAN, BOLD_GREEN, BOLD_RED, RESET, colored, printc}; use crate::utils::cli_styles::{BOLD_CYAN, BOLD_GREEN, BOLD_RED, RESET, colored, printc};
use std::fs; use std::fs;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::process::Command; use std::process::Command;

View File

@@ -18,7 +18,7 @@
use crate::prelude::*; use crate::prelude::*;
use crate::core::build_config::Config; use crate::core::build_config::Config;
use crate::utils::text::{BOLD_CYAN, BOLD_GREEN, printc}; use crate::utils::cli_styles::{BOLD_CYAN, BOLD_GREEN, printc};
use std::collections::HashSet; use std::collections::HashSet;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use toml::Value; use toml::Value;

View File

@@ -29,4 +29,4 @@ pub mod git;
pub mod log; pub mod log;
/// Text processing and manipulation helpers. /// Text processing and manipulation helpers.
pub mod text; pub mod cli_styles;