repo
stringlengths
6
65
file_url
stringlengths
81
311
file_path
stringlengths
6
227
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:31:58
2026-01-04 20:25:31
truncated
bool
2 classes
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-lang/src/core_commands/while_.rs
crates/nu-cmd-lang/src/core_commands/while_.rs
use nu_engine::command_prelude::*; use nu_protocol::engine::CommandType; #[derive(Clone)] pub struct While; impl Command for While { fn name(&self) -> &str { "while" } fn description(&self) -> &str { "Conditionally run a block in a loop." } fn signature(&self) -> nu_protocol::Sig...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-lang/src/core_commands/mod.rs
crates/nu-cmd-lang/src/core_commands/mod.rs
mod alias; mod attr; mod break_; mod collect; mod const_; mod continue_; mod def; mod describe; mod do_; mod echo; mod error; mod error_make; mod export; mod export_alias; mod export_const; mod export_def; mod export_extern; mod export_module; mod export_use; mod extern_; mod for_; mod hide; mod hide_env; mod if_; mod ...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-lang/src/core_commands/alias.rs
crates/nu-cmd-lang/src/core_commands/alias.rs
use nu_engine::command_prelude::*; use nu_protocol::engine::CommandType; #[derive(Clone)] pub struct Alias; impl Command for Alias { fn name(&self) -> &str { "alias" } fn description(&self) -> &str { "Alias a command (with optional flags) to a new name." } fn signature(&self) -> ...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-lang/src/core_commands/def.rs
crates/nu-cmd-lang/src/core_commands/def.rs
use nu_engine::command_prelude::*; use nu_protocol::engine::CommandType; #[derive(Clone)] pub struct Def; impl Command for Def { fn name(&self) -> &str { "def" } fn description(&self) -> &str { "Define a custom command." } fn signature(&self) -> nu_protocol::Signature { S...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-lang/src/core_commands/for_.rs
crates/nu-cmd-lang/src/core_commands/for_.rs
use nu_engine::command_prelude::*; use nu_protocol::engine::CommandType; #[derive(Clone)] pub struct For; impl Command for For { fn name(&self) -> &str { "for" } fn description(&self) -> &str { "Loop over a range." } fn signature(&self) -> nu_protocol::Signature { Signatu...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-lang/src/core_commands/export.rs
crates/nu-cmd-lang/src/core_commands/export.rs
use nu_engine::{command_prelude::*, get_full_help}; use nu_protocol::engine::CommandType; #[derive(Clone)] pub struct ExportCommand; impl Command for ExportCommand { fn name(&self) -> &str { "export" } fn signature(&self) -> Signature { Signature::build("export") .input_output...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-lang/src/core_commands/export_use.rs
crates/nu-cmd-lang/src/core_commands/export_use.rs
use nu_engine::{ command_prelude::*, find_in_dirs_env, get_dirs_var_from_call, get_eval_block, redirect_env, }; use nu_protocol::{ ast::{Expr, Expression}, engine::CommandType, }; #[derive(Clone)] pub struct ExportUse; impl Command for ExportUse { fn name(&self) -> &str { "export use" } ...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-lang/src/core_commands/const_.rs
crates/nu-cmd-lang/src/core_commands/const_.rs
use nu_engine::command_prelude::*; use nu_protocol::engine::CommandType; #[derive(Clone)] pub struct Const; impl Command for Const { fn name(&self) -> &str { "const" } fn description(&self) -> &str { "Create a parse-time constant." } fn signature(&self) -> nu_protocol::Signature ...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-lang/src/core_commands/export_extern.rs
crates/nu-cmd-lang/src/core_commands/export_extern.rs
use nu_engine::command_prelude::*; use nu_protocol::engine::CommandType; #[derive(Clone)] pub struct ExportExtern; impl Command for ExportExtern { fn name(&self) -> &str { "export extern" } fn description(&self) -> &str { "Define an extern and export it from a module." } fn signa...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-lang/src/core_commands/loop_.rs
crates/nu-cmd-lang/src/core_commands/loop_.rs
use nu_engine::command_prelude::*; use nu_protocol::engine::CommandType; #[derive(Clone)] pub struct Loop; impl Command for Loop { fn name(&self) -> &str { "loop" } fn description(&self) -> &str { "Run a block in a loop." } fn signature(&self) -> nu_protocol::Signature { ...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-lang/src/core_commands/continue_.rs
crates/nu-cmd-lang/src/core_commands/continue_.rs
use nu_engine::command_prelude::*; use nu_protocol::engine::CommandType; #[derive(Clone)] pub struct Continue; impl Command for Continue { fn name(&self) -> &str { "continue" } fn description(&self) -> &str { "Continue a loop from the next iteration." } fn signature(&self) -> nu_...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-lang/src/core_commands/scope/externs.rs
crates/nu-cmd-lang/src/core_commands/scope/externs.rs
use nu_engine::{command_prelude::*, scope::ScopeData}; #[derive(Clone)] pub struct ScopeExterns; impl Command for ScopeExterns { fn name(&self) -> &str { "scope externs" } fn signature(&self) -> Signature { Signature::build("scope externs") .input_output_types(vec![(Type::Noth...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-lang/src/core_commands/scope/variables.rs
crates/nu-cmd-lang/src/core_commands/scope/variables.rs
use nu_engine::{command_prelude::*, scope::ScopeData}; #[derive(Clone)] pub struct ScopeVariables; impl Command for ScopeVariables { fn name(&self) -> &str { "scope variables" } fn signature(&self) -> Signature { Signature::build("scope variables") .input_output_types(vec![(Ty...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-lang/src/core_commands/scope/command.rs
crates/nu-cmd-lang/src/core_commands/scope/command.rs
use nu_engine::{command_prelude::*, get_full_help}; #[derive(Clone)] pub struct Scope; impl Command for Scope { fn name(&self) -> &str { "scope" } fn signature(&self) -> Signature { Signature::build("scope") .category(Category::Core) .input_output_types(vec![(Type:...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-lang/src/core_commands/scope/modules.rs
crates/nu-cmd-lang/src/core_commands/scope/modules.rs
use nu_engine::{command_prelude::*, scope::ScopeData}; #[derive(Clone)] pub struct ScopeModules; impl Command for ScopeModules { fn name(&self) -> &str { "scope modules" } fn signature(&self) -> Signature { Signature::build("scope modules") .input_output_types(vec![(Type::Noth...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-lang/src/core_commands/scope/commands.rs
crates/nu-cmd-lang/src/core_commands/scope/commands.rs
use nu_engine::{command_prelude::*, scope::ScopeData}; #[derive(Clone)] pub struct ScopeCommands; impl Command for ScopeCommands { fn name(&self) -> &str { "scope commands" } fn signature(&self) -> Signature { Signature::build("scope commands") .input_output_types(vec![(Type::...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-lang/src/core_commands/scope/mod.rs
crates/nu-cmd-lang/src/core_commands/scope/mod.rs
mod aliases; mod command; mod commands; mod engine_stats; mod externs; mod modules; mod variables; pub use aliases::*; pub use command::*; pub use commands::*; pub use engine_stats::*; pub use externs::*; pub use modules::*; pub use variables::*;
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-lang/src/core_commands/scope/engine_stats.rs
crates/nu-cmd-lang/src/core_commands/scope/engine_stats.rs
use nu_engine::{command_prelude::*, scope::ScopeData}; #[derive(Clone)] pub struct ScopeEngineStats; impl Command for ScopeEngineStats { fn name(&self) -> &str { "scope engine-stats" } fn signature(&self) -> Signature { Signature::build("scope engine-stats") .input_output_type...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-lang/src/core_commands/scope/aliases.rs
crates/nu-cmd-lang/src/core_commands/scope/aliases.rs
use nu_engine::{command_prelude::*, scope::ScopeData}; #[derive(Clone)] pub struct ScopeAliases; impl Command for ScopeAliases { fn name(&self) -> &str { "scope aliases" } fn signature(&self) -> Signature { Signature::build("scope aliases") .input_output_types(vec![(Type::Noth...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-lang/src/core_commands/overlay/use_.rs
crates/nu-cmd-lang/src/core_commands/overlay/use_.rs
use nu_engine::{ command_prelude::*, find_in_dirs_env, get_dirs_var_from_call, get_eval_block, redirect_env, }; use nu_parser::trim_quotes_str; use nu_protocol::{ModuleId, ast::Expr, engine::CommandType}; use std::path::Path; #[derive(Clone)] pub struct OverlayUse; impl Command for OverlayUse { fn name(&self...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-lang/src/core_commands/overlay/command.rs
crates/nu-cmd-lang/src/core_commands/overlay/command.rs
use nu_engine::{command_prelude::*, get_full_help}; use nu_protocol::engine::CommandType; #[derive(Clone)] pub struct Overlay; impl Command for Overlay { fn name(&self) -> &str { "overlay" } fn signature(&self) -> Signature { Signature::build("overlay") .category(Category::Cor...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-lang/src/core_commands/overlay/hide.rs
crates/nu-cmd-lang/src/core_commands/overlay/hide.rs
use nu_engine::command_prelude::*; use nu_protocol::engine::CommandType; #[derive(Clone)] pub struct OverlayHide; impl Command for OverlayHide { fn name(&self) -> &str { "overlay hide" } fn description(&self) -> &str { "Hide an active overlay." } fn signature(&self) -> nu_protoco...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-lang/src/core_commands/overlay/list.rs
crates/nu-cmd-lang/src/core_commands/overlay/list.rs
use nu_engine::command_prelude::*; #[derive(Clone)] pub struct OverlayList; impl Command for OverlayList { fn name(&self) -> &str { "overlay list" } fn description(&self) -> &str { "List all overlays with their active status." } fn signature(&self) -> nu_protocol::Signature { ...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-lang/src/core_commands/overlay/mod.rs
crates/nu-cmd-lang/src/core_commands/overlay/mod.rs
mod command; mod hide; mod list; mod new; mod use_; pub use command::Overlay; pub use hide::OverlayHide; pub use list::OverlayList; pub use new::OverlayNew; pub use use_::OverlayUse;
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-lang/src/core_commands/overlay/new.rs
crates/nu-cmd-lang/src/core_commands/overlay/new.rs
use nu_engine::{command_prelude::*, redirect_env}; use nu_protocol::engine::CommandType; #[derive(Clone)] pub struct OverlayNew; impl Command for OverlayNew { fn name(&self) -> &str { "overlay new" } fn description(&self) -> &str { "Create an empty overlay." } fn signature(&self)...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-lang/src/core_commands/attr/complete.rs
crates/nu-cmd-lang/src/core_commands/attr/complete.rs
use nu_engine::command_prelude::*; #[derive(Clone)] pub struct AttrComplete; impl Command for AttrComplete { fn name(&self) -> &str { "attr complete" } fn signature(&self) -> Signature { Signature::build("attr complete") .input_output_type(Type::Nothing, Type::String) ...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-lang/src/core_commands/attr/search_terms.rs
crates/nu-cmd-lang/src/core_commands/attr/search_terms.rs
use nu_engine::command_prelude::*; #[derive(Clone)] pub struct AttrSearchTerms; impl Command for AttrSearchTerms { fn name(&self) -> &str { "attr search-terms" } fn signature(&self) -> Signature { Signature::build("attr search-terms") .input_output_type(Type::Nothing, Type::li...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-lang/src/core_commands/attr/example.rs
crates/nu-cmd-lang/src/core_commands/attr/example.rs
use nu_engine::command_prelude::*; #[derive(Clone)] pub struct AttrExample; impl Command for AttrExample { fn name(&self) -> &str { "attr example" } // TODO: When const closure are available, switch to using them for the `example` argument // rather than a block. That should remove the need f...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-lang/src/core_commands/attr/category.rs
crates/nu-cmd-lang/src/core_commands/attr/category.rs
use nu_engine::command_prelude::*; #[derive(Clone)] pub struct AttrCategory; impl Command for AttrCategory { fn name(&self) -> &str { "attr category" } fn signature(&self) -> Signature { Signature::build("attr category") .input_output_type(Type::Nothing, Type::String) ...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-lang/src/core_commands/attr/attr_.rs
crates/nu-cmd-lang/src/core_commands/attr/attr_.rs
use nu_engine::{command_prelude::*, get_full_help}; #[derive(Clone)] pub struct Attr; impl Command for Attr { fn name(&self) -> &str { "attr" } fn signature(&self) -> Signature { Signature::build("attr") .category(Category::Core) .input_output_types(vec![(Type::Not...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-lang/src/core_commands/attr/mod.rs
crates/nu-cmd-lang/src/core_commands/attr/mod.rs
mod attr_; mod category; mod complete; mod deprecated; mod example; mod search_terms; pub use attr_::Attr; pub use category::AttrCategory; pub use complete::{AttrComplete, AttrCompleteExternal}; pub use deprecated::AttrDeprecated; pub use example::AttrExample; pub use search_terms::AttrSearchTerms;
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-lang/src/core_commands/attr/deprecated.rs
crates/nu-cmd-lang/src/core_commands/attr/deprecated.rs
use nu_cmd_base::WrapCall; use nu_engine::command_prelude::*; #[derive(Clone)] pub struct AttrDeprecated; impl Command for AttrDeprecated { fn name(&self) -> &str { "attr deprecated" } fn signature(&self) -> Signature { Signature::build("attr deprecated") .input_output_type(Ty...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-lang/tests/main.rs
crates/nu-cmd-lang/tests/main.rs
mod commands;
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-lang/tests/commands/mod.rs
crates/nu-cmd-lang/tests/commands/mod.rs
mod attr;
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-lang/tests/commands/attr/mod.rs
crates/nu-cmd-lang/tests/commands/attr/mod.rs
mod deprecated;
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-lang/tests/commands/attr/deprecated.rs
crates/nu-cmd-lang/tests/commands/attr/deprecated.rs
use miette::{Diagnostic, LabeledSpan}; use nu_parser::parse; use nu_protocol::engine::StateWorkingSet; #[test] pub fn test_deprecated_attribute() { let engine_state = nu_cmd_lang::create_default_context(); let mut working_set = StateWorkingSet::new(&engine_state); // test deprecation with no message l...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu_plugin_custom_values/src/cool_custom_value.rs
crates/nu_plugin_custom_values/src/cool_custom_value.rs
#![allow(clippy::result_large_err)] use nu_protocol::{ CustomValue, ShellError, Span, Type, Value, ast::{self, Math, Operator}, casing::Casing, }; use serde::{Deserialize, Serialize}; use std::cmp::Ordering; #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)] pub struct CoolCust...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu_plugin_custom_values/src/second_custom_value.rs
crates/nu_plugin_custom_values/src/second_custom_value.rs
#![allow(clippy::result_large_err)] use nu_protocol::{CustomValue, ShellError, Span, Spanned, Value, shell_error::io::IoError}; use serde::{Deserialize, Serialize}; use std::{cmp::Ordering, path::Path}; #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)] pub struct SecondCustomValue { p...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu_plugin_custom_values/src/update.rs
crates/nu_plugin_custom_values/src/update.rs
use crate::{ CustomValuePlugin, cool_custom_value::CoolCustomValue, second_custom_value::SecondCustomValue, }; use nu_plugin::{EngineInterface, EvaluatedCall, SimplePluginCommand}; use nu_protocol::{Category, Example, LabeledError, ShellError, Signature, Span, Value}; pub struct Update; impl SimplePluginCommand f...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu_plugin_custom_values/src/handle_update.rs
crates/nu_plugin_custom_values/src/handle_update.rs
use std::sync::atomic; use nu_plugin::{EngineInterface, EvaluatedCall, SimplePluginCommand}; use nu_protocol::{ LabeledError, ShellError, Signature, Spanned, SyntaxShape, Type, Value, engine::Closure, }; use crate::{CustomValuePlugin, handle_custom_value::HandleCustomValue}; pub struct HandleUpdate; impl Simple...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu_plugin_custom_values/src/handle_get.rs
crates/nu_plugin_custom_values/src/handle_get.rs
use nu_plugin::{EngineInterface, EvaluatedCall, SimplePluginCommand}; use nu_protocol::{LabeledError, ShellError, Signature, Type, Value}; use crate::{CustomValuePlugin, handle_custom_value::HandleCustomValue}; pub struct HandleGet; impl SimplePluginCommand for HandleGet { type Plugin = CustomValuePlugin; f...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu_plugin_custom_values/src/generate2.rs
crates/nu_plugin_custom_values/src/generate2.rs
use crate::{CustomValuePlugin, second_custom_value::SecondCustomValue}; use nu_plugin::{EngineInterface, EvaluatedCall, SimplePluginCommand}; use nu_protocol::{Category, Example, LabeledError, Signature, Span, SyntaxShape, Value}; pub struct Generate2; impl SimplePluginCommand for Generate2 { type Plugin = Custom...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu_plugin_custom_values/src/update_arg.rs
crates/nu_plugin_custom_values/src/update_arg.rs
use crate::{CustomValuePlugin, update::Update}; use nu_plugin::{EngineInterface, EvaluatedCall, SimplePluginCommand}; use nu_protocol::{Category, LabeledError, Signature, SyntaxShape, Value}; pub struct UpdateArg; impl SimplePluginCommand for UpdateArg { type Plugin = CustomValuePlugin; fn name(&self) -> &st...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu_plugin_custom_values/src/handle_custom_value.rs
crates/nu_plugin_custom_values/src/handle_custom_value.rs
use nu_protocol::{CustomValue, LabeledError, ShellError, Span, Value}; use serde::{Deserialize, Serialize}; /// References a stored handle within the plugin #[derive(Debug, Clone, Serialize, Deserialize)] pub struct HandleCustomValue(pub u64); impl HandleCustomValue { pub fn into_value(self, span: Span) -> Value ...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu_plugin_custom_values/src/handle_make.rs
crates/nu_plugin_custom_values/src/handle_make.rs
use std::sync::atomic; use nu_plugin::{EngineInterface, EvaluatedCall, SimplePluginCommand}; use nu_protocol::{LabeledError, Signature, Type, Value}; use crate::{CustomValuePlugin, handle_custom_value::HandleCustomValue}; pub struct HandleMake; impl SimplePluginCommand for HandleMake { type Plugin = CustomValue...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu_plugin_custom_values/src/main.rs
crates/nu_plugin_custom_values/src/main.rs
use std::{ collections::BTreeMap, sync::{Mutex, atomic::AtomicU64}, }; use handle_custom_value::HandleCustomValue; use nu_plugin::{EngineInterface, MsgPackSerializer, Plugin, PluginCommand, serve_plugin}; mod cool_custom_value; mod handle_custom_value; mod second_custom_value; mod drop_check; mod generate; m...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu_plugin_custom_values/src/drop_check.rs
crates/nu_plugin_custom_values/src/drop_check.rs
use crate::CustomValuePlugin; use nu_plugin::{EngineInterface, EvaluatedCall, SimplePluginCommand}; use nu_protocol::{ Category, CustomValue, LabeledError, ShellError, Signature, Span, SyntaxShape, Value, record, }; use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, Serialize, Deserialize)] pub struct Dro...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu_plugin_custom_values/src/generate.rs
crates/nu_plugin_custom_values/src/generate.rs
use crate::{CustomValuePlugin, cool_custom_value::CoolCustomValue}; use nu_plugin::{EngineInterface, EvaluatedCall, SimplePluginCommand}; use nu_protocol::{Category, Example, LabeledError, Signature, Span, Value}; pub struct Generate; impl SimplePluginCommand for Generate { type Plugin = CustomValuePlugin; f...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-plugin-test-support/src/lib.rs
crates/nu-plugin-test-support/src/lib.rs
//! Test support for [Nushell](https://nushell.sh) plugins. //! //! # Example //! //! ```rust //! use std::sync::Arc; //! //! use nu_plugin::*; //! use nu_plugin_test_support::PluginTest; //! use nu_protocol::{ //! Example, IntoInterruptiblePipelineData, LabeledError, PipelineData, ShellError, Signals, //! Sign...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-plugin-test-support/src/diff.rs
crates/nu-plugin-test-support/src/diff.rs
use std::fmt::Write; use nu_ansi_term::{Color, Style}; use similar::{ChangeTag, TextDiff}; /// Generate a stylized diff of different lines between two strings pub(crate) fn diff_by_line(old: &str, new: &str) -> String { let mut out = String::new(); let diff = TextDiff::from_lines(old, new); for change i...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-plugin-test-support/src/fake_register.rs
crates/nu-plugin-test-support/src/fake_register.rs
use std::{ops::Deref, sync::Arc}; use nu_plugin::{Plugin, create_plugin_signature}; use nu_plugin_engine::PluginDeclaration; use nu_protocol::{RegisteredPlugin, ShellError, engine::StateWorkingSet}; use crate::{fake_persistent_plugin::FakePersistentPlugin, spawn_fake_plugin::spawn_fake_plugin}; /// Register all of t...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-plugin-test-support/src/plugin_test.rs
crates/nu-plugin-test-support/src/plugin_test.rs
use std::{cmp::Ordering, convert::Infallible, sync::Arc}; use nu_ansi_term::Style; use nu_cmd_lang::create_default_context; use nu_engine::eval_block; use nu_parser::parse; use nu_plugin::{Plugin, PluginCommand}; use nu_plugin_engine::{PluginCustomValueWithSource, PluginSource, WithSource}; use nu_plugin_protocol::Plu...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-plugin-test-support/src/spawn_fake_plugin.rs
crates/nu-plugin-test-support/src/spawn_fake_plugin.rs
use std::sync::{Arc, mpsc}; use nu_plugin::Plugin; use nu_plugin_core::{InterfaceManager, PluginRead, PluginWrite}; use nu_plugin_engine::{PluginInterfaceManager, PluginSource}; use nu_plugin_protocol::{PluginInput, PluginOutput}; use nu_protocol::{PluginIdentity, ShellError, shell_error::io::IoError}; use crate::fak...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-plugin-test-support/src/fake_persistent_plugin.rs
crates/nu-plugin-test-support/src/fake_persistent_plugin.rs
use std::{ any::Any, sync::{Arc, OnceLock}, }; use nu_plugin_engine::{GetPlugin, PluginInterface}; use nu_protocol::{ PluginGcConfig, PluginIdentity, PluginMetadata, RegisteredPlugin, ShellError, engine::{EngineState, Stack}, }; pub struct FakePersistentPlugin { identity: PluginIdentity, plugi...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-plugin-test-support/tests/main.rs
crates/nu-plugin-test-support/tests/main.rs
mod custom_value; mod hello; mod lowercase;
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-plugin-test-support/tests/custom_value/mod.rs
crates/nu-plugin-test-support/tests/custom_value/mod.rs
use std::cmp::Ordering; use nu_plugin::{EngineInterface, EvaluatedCall, Plugin, SimplePluginCommand}; use nu_plugin_test_support::PluginTest; use nu_protocol::{ CustomValue, Example, LabeledError, PipelineData, ShellError, Signature, Span, Type, Value, }; use serde::{Deserialize, Serialize}; #[derive(Debug, Clon...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-plugin-test-support/tests/hello/mod.rs
crates/nu-plugin-test-support/tests/hello/mod.rs
//! Extended from `nu-plugin` examples. use nu_plugin::*; use nu_plugin_test_support::PluginTest; use nu_protocol::{Example, LabeledError, ShellError, Signature, Type, Value}; struct HelloPlugin; struct Hello; impl Plugin for HelloPlugin { fn version(&self) -> String { "0.0.0".into() } fn comman...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-plugin-test-support/tests/lowercase/mod.rs
crates/nu-plugin-test-support/tests/lowercase/mod.rs
use nu_plugin::*; use nu_plugin_test_support::PluginTest; use nu_protocol::{ Example, IntoInterruptiblePipelineData, LabeledError, PipelineData, ShellError, Signals, Signature, Span, Type, Value, }; struct LowercasePlugin; struct Lowercase; impl PluginCommand for Lowercase { type Plugin = LowercasePlugin;...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-glob/src/lib.rs
crates/nu-glob/src/lib.rs
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Copyright 2022 The Nushell Project Developers. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/license...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
true
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-json/src/ser.rs
crates/nu-json/src/ser.rs
//! Hjson Serialization //! //! This module provides for Hjson serialization with the type `Serializer`. use std::fmt::{Display, LowerExp}; use std::io; use std::num::FpCategory; use nu_utils::ObviousFloat; use super::error::{Error, ErrorCode, Result}; use serde::ser; /// A structure for serializing Rust values int...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-json/src/builder.rs
crates/nu-json/src/builder.rs
use serde::ser; use crate::value::{self, Map, Value}; /// This structure provides a simple interface for constructing a JSON array. pub struct ArrayBuilder { array: Vec<Value>, } impl Default for ArrayBuilder { fn default() -> Self { Self::new() } } impl ArrayBuilder { /// Construct an `Obje...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-json/src/lib.rs
crates/nu-json/src/lib.rs
#![doc = include_str!("../README.md")] pub use self::de::{ Deserializer, StreamDeserializer, from_iter, from_reader, from_slice, from_str, }; pub use self::error::{Error, ErrorCode, Result}; pub use self::ser::{ Serializer, to_string, to_string_raw, to_string_with_indent, to_string_with_tab_indentation, to_...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-json/src/value.rs
crates/nu-json/src/value.rs
#[cfg(not(feature = "preserve_order"))] use std::collections::{BTreeMap, btree_map}; #[cfg(feature = "preserve_order")] use linked_hash_map::LinkedHashMap; use std::fmt; use std::io; use std::str; use std::vec; use num_traits::NumCast; use serde::de; use serde::ser; use crate::error::{Error, ErrorCode}; type Resu...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-json/src/error.rs
crates/nu-json/src/error.rs
//! JSON Errors //! //! This module is centered around the `Error` and `ErrorCode` types, which represents all possible //! `serde_hjson` errors. use std::error; use std::fmt; use std::io; use std::result; use std::string::FromUtf8Error; use serde::de; use serde::ser; /// The errors that can arise while parsing a JS...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-json/src/util.rs
crates/nu-json/src/util.rs
use std::io; use std::str; use super::error::{Error, ErrorCode, Result}; pub struct StringReader<Iter: Iterator<Item = u8>> { iter: Iter, line: usize, col: usize, ch: Vec<u8>, } impl<Iter> StringReader<Iter> where Iter: Iterator<Item = u8>, { #[inline] pub fn new(iter: Iter) -> Self { ...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-json/src/de.rs
crates/nu-json/src/de.rs
//! Hjson Deserialization //! //! This module provides for Hjson deserialization with the type `Deserializer`. use super::error::{Error, ErrorCode, Result}; use super::util::StringReader; use super::util::{Number, ParseNumber}; use serde::de; use std::{ char, io, io::{BufReader, Read}, marker::PhantomData,...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-json/tests/main.rs
crates/nu-json/tests/main.rs
use nu_json::Value; use pretty_assertions::assert_eq; use rstest::rstest; use std::fs; use std::io; use std::path::{Path, PathBuf}; fn txt(text: String) -> String { let out = text; #[cfg(windows)] { out.replace("\r\n", "\n") } #[cfg(not(windows))] { out } } // This test w...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/deprecation.rs
crates/nu-protocol/src/deprecation.rs
use crate::{FromValue, ParseWarning, ShellError, Type, Value, ast::Call}; // Make nu_protocol available in this namespace, consumers of this crate will // have this without such an export. // The `FromValue` derive macro fully qualifies paths to "nu_protocol". use crate::{self as nu_protocol, ReportMode, Span}; /// A...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/parser_path.rs
crates/nu-protocol/src/parser_path.rs
use crate::{ FileId, engine::{StateWorkingSet, VirtualPath}, }; use std::{ ffi::OsStr, path::{Path, PathBuf}, }; /// An abstraction over a PathBuf that can have virtual paths (files and directories). Virtual /// paths always exist and represent a way to ship Nushell code inside the binary without requi...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/lib.rs
crates/nu-protocol/src/lib.rs
#![cfg_attr(not(feature = "os"), allow(unused))] #![doc = include_str!("../README.md")] mod alias; pub mod ast; pub mod casing; mod completion; pub mod config; pub mod debugger; mod deprecation; mod did_you_mean; pub mod engine; mod errors; pub mod eval_base; pub mod eval_const; mod example; mod id; pub mod ir; mod lev...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/signature.rs
crates/nu-protocol/src/signature.rs
use crate::{ BlockId, DeclId, DeprecationEntry, Example, FromValue, IntoValue, PipelineData, ShellError, Span, SyntaxShape, Type, Value, VarId, engine::{Call, Command, CommandType, EngineState, Stack}, }; use nu_derive_value::FromValue as DeriveFromValue; use nu_utils::NuCow; use serde::{Deserialize, Serial...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/id.rs
crates/nu-protocol/src/id.rs
use std::any; use std::fmt::{Debug, Display, Error, Formatter}; use std::marker::PhantomData; use serde::{Deserialize, Serialize}; #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct Id<M, V = usize> { inner: V, _phantom: PhantomData<M>, } impl<M, V> Id<M, V> { /// Creates a new `Id`....
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/completion.rs
crates/nu-protocol/src/completion.rs
use crate::{DeclId, Span, Type, ast, engine::CommandType}; use serde::{Deserialize, Serialize}; /// A simple semantics suggestion just like nu_cli::SemanticSuggestion, but it /// derives `Serialize` and `Deserialize`, so plugins are allowed to use it /// to provide dynamic completion items. /// /// Why define a new on...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/module.rs
crates/nu-protocol/src/module.rs
use crate::{ BlockId, DeclId, FileId, ModuleId, ParseError, Span, Value, VarId, ast::ImportPatternMember, engine::StateWorkingSet, }; use crate::parser_path::ParserPath; use indexmap::IndexMap; pub struct ResolvedImportPattern { pub decls: Vec<(Vec<u8>, DeclId)>, pub modules: Vec<(Vec<u8>, ModuleId)>,...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/example.rs
crates/nu-protocol/src/example.rs
use crate::Value; #[cfg(feature = "plugin")] use serde::{Deserialize, Serialize}; #[derive(Debug)] pub struct Example<'a> { pub example: &'a str, pub description: &'a str, pub result: Option<Value>, } // PluginExample is somehow like struct `Example`, but it owned a String for `example` // and `descriptio...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/span.rs
crates/nu-protocol/src/span.rs
//! [`Span`] to point to sections of source code and the [`Spanned`] wrapper type use crate::{FromValue, IntoValue, ShellError, SpanId, Value, record}; use miette::SourceSpan; use serde::{Deserialize, Serialize}; use std::{fmt, ops::Deref}; pub trait GetSpan { fn get_span(&self, span_id: SpanId) -> Span; } /// A ...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/alias.rs
crates/nu-protocol/src/alias.rs
use crate::{ PipelineData, ShellError, Signature, ast::Expression, engine::{Call, Command, CommandType, EngineState, Stack}, }; /// Command wrapper of an alias. /// /// Our current aliases are implemented as wrapping commands /// This has some limitations compared to text-substitution macro aliases but can...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/casing.rs
crates/nu-protocol/src/casing.rs
use std::cmp::Ordering; use nu_utils::IgnoreCaseExt; use serde::{Deserialize, Serialize}; #[derive(Clone, Copy, PartialEq, Eq, Debug, Default, Serialize, Deserialize)] pub enum Casing { #[default] Sensitive, Insensitive, } pub(crate) mod private { pub trait Seal {} } pub trait CaseSensitivity: priva...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/eval_const.rs
crates/nu-protocol/src/eval_const.rs
//! Implementation of const-evaluation //! //! This enables you to assign `const`-constants and execute parse-time code dependent on this. //! e.g. `source $my_const` use crate::{ BlockId, Config, HistoryFileFormat, PipelineData, Record, ShellError, Span, Value, VarId, ast::{Assignment, Block, Call, Expr, Expre...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/eval_base.rs
crates/nu-protocol/src/eval_base.rs
//! Foundational [`Eval`] trait allowing dispatch between const-eval and regular evaluation use nu_path::expand_path; use crate::{ BlockId, Config, ENV_VARIABLE_ID, GetSpan, Range, Record, ShellError, Span, Value, VarId, ast::{ Assignment, Bits, Boolean, Call, Comparison, Expr, Expression, ExternalArgu...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/ty.rs
crates/nu-protocol/src/ty.rs
use crate::SyntaxShape; use serde::{Deserialize, Serialize}; use std::fmt::Display; #[cfg(test)] use strum_macros::EnumIter; #[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize, Hash, Ord, PartialOrd)] #[cfg_attr(test, derive(EnumIter))] pub enum Type { /// Top type, supertype of all types An...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/lev_distance.rs
crates/nu-protocol/src/lev_distance.rs
// This file is copied from the rust compiler project: // https://github.com/rust-lang/rust/blob/cf9ed0dd5836201843d28bbad50abfbe1913af2a/compiler/rustc_span/src/lev_distance.rs#L1 // https://github.com/rust-lang/rust/blob/cf9ed0dd5836201843d28bbad50abfbe1913af2a/LICENSE-MIT // // - the rust compiler-specific symbol::S...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/did_you_mean.rs
crates/nu-protocol/src/did_you_mean.rs
pub fn did_you_mean<'a, 'b, I, S>(possibilities: I, input: &'b str) -> Option<String> where I: IntoIterator<Item = &'a S>, S: AsRef<str> + 'a + ?Sized, { let possibilities: Vec<&str> = possibilities.into_iter().map(|s| s.as_ref()).collect(); let suggestion = crate::lev_distance::find_best_match_...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/syntax_shape.rs
crates/nu-protocol/src/syntax_shape.rs
use crate::Type; use serde::{Deserialize, Serialize}; use std::fmt::Display; /// The syntactic shapes that describe how a sequence should be parsed. /// /// This extends beyond [`Type`] which describes how [`Value`](crate::Value)s are represented. /// `SyntaxShape`s can describe the parsing rules for arguments to a co...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/process/mod.rs
crates/nu-protocol/src/process/mod.rs
//! Handling of external subprocesses mod child; pub use child::*;
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/process/child.rs
crates/nu-protocol/src/process/child.rs
use crate::{ ShellError, Span, byte_stream::convert_file, engine::{EngineState, FrozenJob, Job}, shell_error::io::IoError, }; use nu_system::{ExitStatus, ForegroundChild, ForegroundWaitStatus}; use os_pipe::PipeReader; use std::{ fmt::Debug, io::{self, Read}, sync::mpsc::{self, Receiver, Re...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/plugin/signature.rs
crates/nu-protocol/src/plugin/signature.rs
use crate::{PluginExample, Signature}; use serde::{Deserialize, Serialize}; /// A simple wrapper for Signature that includes examples. #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] pub struct PluginSignature { pub sig: Signature, pub examples: Vec<PluginExample>, } impl PluginSignature { pub ...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/plugin/registered.rs
crates/nu-protocol/src/plugin/registered.rs
use std::{any::Any, sync::Arc}; use crate::{Handlers, PluginGcConfig, PluginIdentity, PluginMetadata, ShellError}; /// Trait for plugins registered in the [`EngineState`](crate::engine::EngineState). pub trait RegisteredPlugin: Send + Sync { /// The identity of the plugin - its filename, shell, and friendly name....
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/plugin/mod.rs
crates/nu-protocol/src/plugin/mod.rs
mod identity; mod metadata; mod registered; mod registry_file; mod signature; pub use identity::*; pub use metadata::*; pub use registered::*; pub use registry_file::*; pub use signature::*;
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/plugin/identity.rs
crates/nu-protocol/src/plugin/identity.rs
use std::path::{Path, PathBuf}; use crate::{ParseError, ShellError, Spanned}; /// Error when an invalid plugin filename was encountered. #[derive(Debug, Clone)] pub struct InvalidPluginFilename(PathBuf); impl std::fmt::Display for InvalidPluginFilename { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/plugin/metadata.rs
crates/nu-protocol/src/plugin/metadata.rs
use serde::{Deserialize, Serialize}; /// Metadata about the installed plugin. This is cached in the registry file along with the /// signatures. None of the metadata fields are required, and more may be added in the future. #[derive(Serialize, Deserialize, PartialEq, Debug, Clone)] #[non_exhaustive] pub struct PluginM...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/plugin/registry_file/tests.rs
crates/nu-protocol/src/plugin/registry_file/tests.rs
use super::{PluginRegistryFile, PluginRegistryItem, PluginRegistryItemData}; use crate::{ Category, PluginExample, PluginMetadata, PluginSignature, ShellError, Signature, SyntaxShape, Type, Value, }; use pretty_assertions::assert_eq; use std::io::Cursor; fn foo_plugin() -> PluginRegistryItem { PluginRegist...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/plugin/registry_file/mod.rs
crates/nu-protocol/src/plugin/registry_file/mod.rs
use std::{ io::{Read, Write}, path::PathBuf, }; use serde::{Deserialize, Serialize}; use crate::{PluginIdentity, PluginMetadata, PluginSignature, ShellError, Span}; // This has a big impact on performance const BUFFER_SIZE: usize = 65536; // Chose settings at the low end, because we're just trying to get th...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/ir/call.rs
crates/nu-protocol/src/ir/call.rs
use std::sync::Arc; use crate::{ DeclId, ShellError, Span, Spanned, Value, ast::Expression, engine::{self, Argument, Stack}, }; use super::DataSlice; /// Contains the information for a call being made to a declared command. #[derive(Debug, Clone)] pub struct Call { /// The declaration ID of the comma...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/ir/display.rs
crates/nu-protocol/src/ir/display.rs
use super::{DataSlice, Instruction, IrBlock, Literal, RedirectMode}; use crate::{DeclId, VarId, ast::Pattern, engine::EngineState}; use std::fmt::{self}; pub struct FmtIrBlock<'a> { pub(super) engine_state: &'a EngineState, pub(super) ir_block: &'a IrBlock, } impl fmt::Display for FmtIrBlock<'_> { fn fmt(...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/ir/mod.rs
crates/nu-protocol/src/ir/mod.rs
use crate::{ BlockId, DeclId, Filesize, RegId, ShellError, Span, Value, VarId, ast::{CellPath, Expression, Operator, Pattern, RangeInclusion}, engine::EngineState, }; use chrono::{DateTime, FixedOffset}; use serde::{Deserialize, Serialize}; use std::{fmt, sync::Arc}; mod call; mod display; pub use call::*...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/errors/config.rs
crates/nu-protocol/src/errors/config.rs
use std::hash::Hash; use crate::{ShellError, Span, Type}; use miette::Diagnostic; use thiserror::Error; /// The errors that may occur when updating the config #[derive(Clone, Debug, PartialEq, Error, Diagnostic)] pub enum ConfigError { #[error("Type mismatch at {path}")] #[diagnostic(code(nu::shell::type_mism...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/errors/short_handler.rs
crates/nu-protocol/src/errors/short_handler.rs
use std::fmt; use miette::{Diagnostic, ReportHandler}; /// A [`ReportHandler`] that renders errors as plain text without graphics. /// Designed for concise output that typically fits on a single line. #[derive(Debug, Clone)] pub struct ShortReportHandler {} impl ShortReportHandler { pub const fn new() -> Self { ...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/errors/shell_warning.rs
crates/nu-protocol/src/errors/shell_warning.rs
use crate::Span; use miette::Diagnostic; use std::hash::Hash; use thiserror::Error; use crate::{ConfigWarning, ReportMode, Reportable}; #[derive(Clone, Debug, Error, Diagnostic)] #[diagnostic(severity(Warning))] pub enum ShellWarning { /// A parse-time deprecation. Indicates that something will be removed in a fu...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false
nushell/nushell
https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/errors/report_error.rs
crates/nu-protocol/src/errors/report_error.rs
//! This module manages the step of turning error types into printed error messages //! //! Relies on the `miette` crate for pretty layout use std::hash::{DefaultHasher, Hash, Hasher}; use crate::{ CompileError, Config, ErrorStyle, ParseError, ParseWarning, ShellError, ShellWarning, ShortReportHandler, eng...
rust
MIT
6d3cb27fa40b324a1168c577aee7f3532a5e157e
2026-01-04T15:32:17.606688Z
false