mirror of
https://github.com/nushell/nushell.git
synced 2025-05-08 08:52:56 +00:00
# Description This is supposed to be a Quality-of-Life command that just makes some things easier when dealing with a nushell config. Really all it does is show you the current config in a flattened state. That's it. I was thinking this could be useful when comparing config settings between old and new config files. There are still room for improvements. For instance, closures are listed as an int. They can be updated with a `view source <int>` pipeline but that could all be built in too.  The command works by getting the current configuration, serializing it to json, then flattening that json. BTW, there's a new flatten_json.rs in nu-utils. Theoretically all this mess could be done in a custom command script, but it's proven to be exceedingly difficult based on the work from discord. Here's some more complex items to flatten.  # User-Facing Changes <!-- List of all changes that impact the user experience here. This helps us keep track of breaking changes. --> # Tests + Formatting <!-- Don't forget to add tests that cover your changes. Make sure you've run and fixed any issues with these commands: - `cargo fmt --all -- --check` to check standard code formatting (`cargo fmt --all` applies these changes) - `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass (on Windows make sure to [enable developer mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging)) - `cargo run -- -c "use toolkit.nu; toolkit test stdlib"` to run the tests for the standard library > **Note** > from `nushell` you can also use the `toolkit` as follows > ```bash > use toolkit.nu # or use an `env_change` hook to activate it automatically > toolkit check pr > ``` --> # After Submitting <!-- If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date. -->
30 lines
807 B
Rust
30 lines
807 B
Rust
#![doc = include_str!("../README.md")]
|
|
mod casing;
|
|
mod deansi;
|
|
pub mod emoji;
|
|
pub mod filesystem;
|
|
pub mod flatten_json;
|
|
pub mod locale;
|
|
mod quoting;
|
|
mod shared_cow;
|
|
pub mod utils;
|
|
|
|
pub use locale::get_system_locale;
|
|
pub use utils::{
|
|
enable_vt_processing, get_default_config, get_default_env, get_doc_config, get_doc_env,
|
|
get_ls_colors, get_scaffold_config, get_scaffold_env, stderr_write_all_and_flush,
|
|
stdout_write_all_and_flush, terminal_size,
|
|
};
|
|
|
|
pub use casing::IgnoreCaseExt;
|
|
pub use deansi::{
|
|
strip_ansi_likely, strip_ansi_string_likely, strip_ansi_string_unlikely, strip_ansi_unlikely,
|
|
};
|
|
pub use emoji::contains_emoji;
|
|
pub use flatten_json::JsonFlattener;
|
|
pub use quoting::{escape_quote_string, needs_quoting};
|
|
pub use shared_cow::SharedCow;
|
|
|
|
#[cfg(unix)]
|
|
pub use filesystem::users;
|