mirror of
https://github.com/nushell/nushell.git
synced 2025-06-20 18:08:36 +02:00
Move nu_command::platform::ansi
to nu_command::strings::ansi
(#15995)
This commit is contained in:
parent
cde8a629c5
commit
f0e90a3733
@ -188,6 +188,9 @@ pub fn add_shell_command_context(mut engine_state: EngineState) -> EngineState {
|
|||||||
|
|
||||||
// Strings
|
// Strings
|
||||||
bind_command! {
|
bind_command! {
|
||||||
|
Ansi,
|
||||||
|
AnsiLink,
|
||||||
|
AnsiStrip,
|
||||||
Char,
|
Char,
|
||||||
Decode,
|
Decode,
|
||||||
Encode,
|
Encode,
|
||||||
@ -250,9 +253,6 @@ pub fn add_shell_command_context(mut engine_state: EngineState) -> EngineState {
|
|||||||
// Platform
|
// Platform
|
||||||
#[cfg(feature = "os")]
|
#[cfg(feature = "os")]
|
||||||
bind_command! {
|
bind_command! {
|
||||||
Ansi,
|
|
||||||
AnsiLink,
|
|
||||||
AnsiStrip,
|
|
||||||
Clear,
|
Clear,
|
||||||
Du,
|
Du,
|
||||||
Input,
|
Input,
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
mod ansi;
|
|
||||||
mod clear;
|
mod clear;
|
||||||
mod dir_info;
|
mod dir_info;
|
||||||
mod input;
|
mod input;
|
||||||
@ -10,7 +9,6 @@ mod term;
|
|||||||
mod ulimit;
|
mod ulimit;
|
||||||
mod whoami;
|
mod whoami;
|
||||||
|
|
||||||
pub use ansi::{Ansi, AnsiLink, AnsiStrip};
|
|
||||||
pub use clear::Clear;
|
pub use clear::Clear;
|
||||||
pub use dir_info::{DirBuilder, DirInfo, FileInfo};
|
pub use dir_info::{DirBuilder, DirInfo, FileInfo};
|
||||||
pub use input::Input;
|
pub use input::Input;
|
||||||
|
@ -909,7 +909,7 @@ fn build_ansi_hashmap(v: &[AnsiCode]) -> HashMap<&str, &str> {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::platform::ansi::ansi_::Ansi;
|
use crate::strings::ansi::ansi_::Ansi;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn examples_work_as_expected() {
|
fn examples_work_as_expected() {
|
||||||
@ -920,7 +920,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn no_duplicate_short_names() {
|
fn no_duplicate_short_names() {
|
||||||
use crate::platform::ansi::ansi_::CODE_LIST;
|
use crate::strings::ansi::ansi_::CODE_LIST;
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
|
|
||||||
let mut seen = HashSet::new();
|
let mut seen = HashSet::new();
|
||||||
@ -943,7 +943,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn no_duplicate_long_names() {
|
fn no_duplicate_long_names() {
|
||||||
use crate::platform::ansi::ansi_::CODE_LIST;
|
use crate::strings::ansi::ansi_::CODE_LIST;
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
|
|
||||||
let mut seen = HashSet::new();
|
let mut seen = HashSet::new();
|
@ -1,3 +1,4 @@
|
|||||||
|
mod ansi;
|
||||||
mod base;
|
mod base;
|
||||||
mod char_;
|
mod char_;
|
||||||
mod detect_columns;
|
mod detect_columns;
|
||||||
@ -8,6 +9,7 @@ mod parse;
|
|||||||
mod split;
|
mod split;
|
||||||
mod str_;
|
mod str_;
|
||||||
|
|
||||||
|
pub use ansi::{Ansi, AnsiLink, AnsiStrip};
|
||||||
pub use base::{
|
pub use base::{
|
||||||
DecodeBase32, DecodeBase32Hex, DecodeBase64, DecodeHex, EncodeBase32, EncodeBase32Hex,
|
DecodeBase32, DecodeBase32Hex, DecodeBase64, DecodeHex, EncodeBase32, EncodeBase32Hex,
|
||||||
EncodeBase64, EncodeHex,
|
EncodeBase64, EncodeHex,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user