|
|
@ -1,3 +1,4 @@
|
|
|
|
|
|
|
|
use nu_cmd_lang::*;
|
|
|
|
use nu_command::*;
|
|
|
|
use nu_command::*;
|
|
|
|
use nu_protocol::engine::{EngineState, StateWorkingSet};
|
|
|
|
use nu_protocol::engine::{EngineState, StateWorkingSet};
|
|
|
|
|
|
|
|
|
|
|
@ -14,12 +15,13 @@ macro_rules! bind_commands {
|
|
|
|
pub fn bind_core_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
|
pub fn bind_core_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
|
bind_commands!(
|
|
|
|
bind_commands!(
|
|
|
|
engine_state,
|
|
|
|
engine_state,
|
|
|
|
|
|
|
|
Metadata,
|
|
|
|
Alias,
|
|
|
|
Alias,
|
|
|
|
Ast,
|
|
|
|
|
|
|
|
Break,
|
|
|
|
Break,
|
|
|
|
|
|
|
|
Collect,
|
|
|
|
Commandline,
|
|
|
|
Commandline,
|
|
|
|
|
|
|
|
Const,
|
|
|
|
Continue,
|
|
|
|
Continue,
|
|
|
|
Debug,
|
|
|
|
|
|
|
|
Def,
|
|
|
|
Def,
|
|
|
|
DefEnv,
|
|
|
|
DefEnv,
|
|
|
|
Describe,
|
|
|
|
Describe,
|
|
|
@ -35,6 +37,10 @@ pub fn bind_core_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
|
Extern,
|
|
|
|
Extern,
|
|
|
|
For,
|
|
|
|
For,
|
|
|
|
Help,
|
|
|
|
Help,
|
|
|
|
|
|
|
|
HelpAliases,
|
|
|
|
|
|
|
|
HelpCommands,
|
|
|
|
|
|
|
|
HelpModules,
|
|
|
|
|
|
|
|
HelpExterns,
|
|
|
|
HelpOperators,
|
|
|
|
HelpOperators,
|
|
|
|
Hide,
|
|
|
|
Hide,
|
|
|
|
HideEnv,
|
|
|
|
HideEnv,
|
|
|
@ -46,7 +52,8 @@ pub fn bind_core_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
|
OverlayNew,
|
|
|
|
OverlayNew,
|
|
|
|
OverlayHide,
|
|
|
|
OverlayHide,
|
|
|
|
Let,
|
|
|
|
Let,
|
|
|
|
Metadata,
|
|
|
|
Loop,
|
|
|
|
|
|
|
|
Match,
|
|
|
|
Module,
|
|
|
|
Module,
|
|
|
|
Mut,
|
|
|
|
Mut,
|
|
|
|
Return,
|
|
|
|
Return,
|
|
|
@ -57,6 +64,23 @@ pub fn bind_core_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub fn bind_debug_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
|
|
|
|
|
bind_commands!(
|
|
|
|
|
|
|
|
engine_state,
|
|
|
|
|
|
|
|
Ast,
|
|
|
|
|
|
|
|
Debug,
|
|
|
|
|
|
|
|
Explain,
|
|
|
|
|
|
|
|
Inspect,
|
|
|
|
|
|
|
|
Metadata,
|
|
|
|
|
|
|
|
Profile,
|
|
|
|
|
|
|
|
TimeIt,
|
|
|
|
|
|
|
|
View,
|
|
|
|
|
|
|
|
ViewFiles,
|
|
|
|
|
|
|
|
ViewSource,
|
|
|
|
|
|
|
|
ViewSpan,
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pub fn bind_chart_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
|
pub fn bind_chart_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
|
bind_commands!(engine_state, Histogram)
|
|
|
|
bind_commands!(engine_state, Histogram)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -67,7 +91,6 @@ pub fn bind_filter_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
|
All,
|
|
|
|
All,
|
|
|
|
Any,
|
|
|
|
Any,
|
|
|
|
Append,
|
|
|
|
Append,
|
|
|
|
Collect,
|
|
|
|
|
|
|
|
Columns,
|
|
|
|
Columns,
|
|
|
|
Compact,
|
|
|
|
Compact,
|
|
|
|
Default,
|
|
|
|
Default,
|
|
|
@ -77,7 +100,9 @@ pub fn bind_filter_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
|
Each,
|
|
|
|
Each,
|
|
|
|
EachWhile,
|
|
|
|
EachWhile,
|
|
|
|
Empty,
|
|
|
|
Empty,
|
|
|
|
|
|
|
|
Enumerate,
|
|
|
|
Every,
|
|
|
|
Every,
|
|
|
|
|
|
|
|
Filter,
|
|
|
|
Find,
|
|
|
|
Find,
|
|
|
|
First,
|
|
|
|
First,
|
|
|
|
Flatten,
|
|
|
|
Flatten,
|
|
|
@ -86,6 +111,7 @@ pub fn bind_filter_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
|
GroupBy,
|
|
|
|
GroupBy,
|
|
|
|
Headers,
|
|
|
|
Headers,
|
|
|
|
Insert,
|
|
|
|
Insert,
|
|
|
|
|
|
|
|
Join,
|
|
|
|
SplitBy,
|
|
|
|
SplitBy,
|
|
|
|
Take,
|
|
|
|
Take,
|
|
|
|
Merge,
|
|
|
|
Merge,
|
|
|
@ -118,13 +144,16 @@ pub fn bind_filter_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
|
SplitList,
|
|
|
|
SplitList,
|
|
|
|
Transpose,
|
|
|
|
Transpose,
|
|
|
|
Uniq,
|
|
|
|
Uniq,
|
|
|
|
|
|
|
|
UniqBy,
|
|
|
|
Upsert,
|
|
|
|
Upsert,
|
|
|
|
Update,
|
|
|
|
Update,
|
|
|
|
UpdateCells,
|
|
|
|
UpdateCells,
|
|
|
|
|
|
|
|
Values,
|
|
|
|
Where,
|
|
|
|
Where,
|
|
|
|
Window,
|
|
|
|
Window,
|
|
|
|
Wrap,
|
|
|
|
Wrap,
|
|
|
|
Zip, }
|
|
|
|
Zip,
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pub fn bind_misc_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
|
pub fn bind_misc_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
@ -151,7 +180,6 @@ pub fn bind_path_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
|
pub fn bind_system_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
|
pub fn bind_system_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
|
bind_commands! {
|
|
|
|
bind_commands! {
|
|
|
|
engine_state,
|
|
|
|
engine_state,
|
|
|
|
Benchmark,
|
|
|
|
|
|
|
|
Complete,
|
|
|
|
Complete,
|
|
|
|
External,
|
|
|
|
External,
|
|
|
|
NuCheck,
|
|
|
|
NuCheck,
|
|
|
@ -166,7 +194,6 @@ pub fn bind_system_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
|
pub fn bind_system_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
|
pub fn bind_system_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
|
bind_commands! {
|
|
|
|
bind_commands! {
|
|
|
|
engine_state,
|
|
|
|
engine_state,
|
|
|
|
Benchmark,
|
|
|
|
|
|
|
|
Complete,
|
|
|
|
Complete,
|
|
|
|
External,
|
|
|
|
External,
|
|
|
|
NuCheck,
|
|
|
|
NuCheck,
|
|
|
@ -181,7 +208,6 @@ pub fn bind_system_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
|
pub fn bind_system_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
|
pub fn bind_system_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
|
bind_commands! {
|
|
|
|
bind_commands! {
|
|
|
|
engine_state,
|
|
|
|
engine_state,
|
|
|
|
Benchmark,
|
|
|
|
|
|
|
|
Complete,
|
|
|
|
Complete,
|
|
|
|
External,
|
|
|
|
External,
|
|
|
|
NuCheck,
|
|
|
|
NuCheck,
|
|
|
@ -199,6 +225,8 @@ pub fn bind_string_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
|
Encode,
|
|
|
|
Encode,
|
|
|
|
DecodeBase64,
|
|
|
|
DecodeBase64,
|
|
|
|
EncodeBase64,
|
|
|
|
EncodeBase64,
|
|
|
|
|
|
|
|
DecodeHex,
|
|
|
|
|
|
|
|
EncodeHex,
|
|
|
|
DetectColumns,
|
|
|
|
DetectColumns,
|
|
|
|
Format,
|
|
|
|
Format,
|
|
|
|
FileSize,
|
|
|
|
FileSize,
|
|
|
@ -212,7 +240,6 @@ pub fn bind_string_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
|
Str,
|
|
|
|
Str,
|
|
|
|
StrCamelCase,
|
|
|
|
StrCamelCase,
|
|
|
|
StrCapitalize,
|
|
|
|
StrCapitalize,
|
|
|
|
StrCollect,
|
|
|
|
|
|
|
|
StrContains,
|
|
|
|
StrContains,
|
|
|
|
StrDistance,
|
|
|
|
StrDistance,
|
|
|
|
StrDowncase,
|
|
|
|
StrDowncase,
|
|
|
@ -222,17 +249,15 @@ pub fn bind_string_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
|
StrIndexOf,
|
|
|
|
StrIndexOf,
|
|
|
|
StrKebabCase,
|
|
|
|
StrKebabCase,
|
|
|
|
StrLength,
|
|
|
|
StrLength,
|
|
|
|
StrLpad,
|
|
|
|
|
|
|
|
StrPascalCase,
|
|
|
|
StrPascalCase,
|
|
|
|
StrReverse,
|
|
|
|
StrReverse,
|
|
|
|
StrRpad,
|
|
|
|
|
|
|
|
StrScreamingSnakeCase,
|
|
|
|
StrScreamingSnakeCase,
|
|
|
|
StrSnakeCase,
|
|
|
|
StrSnakeCase,
|
|
|
|
StrStartsWith,
|
|
|
|
StrStartsWith,
|
|
|
|
StrSubstring,
|
|
|
|
StrSubstring,
|
|
|
|
StrTrim,
|
|
|
|
StrTrim,
|
|
|
|
StrTitleCase,
|
|
|
|
StrTitleCase,
|
|
|
|
StrUpcase,
|
|
|
|
StrUpcase
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -336,9 +361,6 @@ pub fn bind_format_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
|
engine_state,
|
|
|
|
engine_state,
|
|
|
|
From,
|
|
|
|
From,
|
|
|
|
FromCsv,
|
|
|
|
FromCsv,
|
|
|
|
FromEml,
|
|
|
|
|
|
|
|
FromIcs,
|
|
|
|
|
|
|
|
FromIni,
|
|
|
|
|
|
|
|
FromJson,
|
|
|
|
FromJson,
|
|
|
|
FromNuon,
|
|
|
|
FromNuon,
|
|
|
|
FromOds,
|
|
|
|
FromOds,
|
|
|
@ -346,7 +368,6 @@ pub fn bind_format_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
|
FromToml,
|
|
|
|
FromToml,
|
|
|
|
FromTsv,
|
|
|
|
FromTsv,
|
|
|
|
FromUrl,
|
|
|
|
FromUrl,
|
|
|
|
FromVcf,
|
|
|
|
|
|
|
|
FromXlsx,
|
|
|
|
FromXlsx,
|
|
|
|
FromXml,
|
|
|
|
FromXml,
|
|
|
|
FromYaml,
|
|
|
|
FromYaml,
|
|
|
@ -361,7 +382,6 @@ pub fn bind_format_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
|
ToToml,
|
|
|
|
ToToml,
|
|
|
|
ToTsv,
|
|
|
|
ToTsv,
|
|
|
|
Touch,
|
|
|
|
Touch,
|
|
|
|
Use,
|
|
|
|
|
|
|
|
Upsert,
|
|
|
|
Upsert,
|
|
|
|
Where,
|
|
|
|
Where,
|
|
|
|
ToXml,
|
|
|
|
ToXml,
|
|
|
@ -374,12 +394,14 @@ pub fn bind_viewer_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
|
engine_state,
|
|
|
|
engine_state,
|
|
|
|
Griddle,
|
|
|
|
Griddle,
|
|
|
|
Table,
|
|
|
|
Table,
|
|
|
|
|
|
|
|
Explore,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pub fn bind_conversion_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
|
pub fn bind_conversion_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
|
bind_commands! {
|
|
|
|
bind_commands! {
|
|
|
|
engine_state,
|
|
|
|
engine_state,
|
|
|
|
|
|
|
|
Fill,
|
|
|
|
Fmt,
|
|
|
|
Fmt,
|
|
|
|
Into,
|
|
|
|
Into,
|
|
|
|
IntoBool,
|
|
|
|
IntoBool,
|
|
|
@ -397,7 +419,6 @@ pub fn bind_conversion_commands(engine_state: &mut EngineState) -> CrateResult<(
|
|
|
|
pub fn bind_environment_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
|
pub fn bind_environment_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
|
bind_commands! {
|
|
|
|
bind_commands! {
|
|
|
|
engine_state,
|
|
|
|
engine_state,
|
|
|
|
Env,
|
|
|
|
|
|
|
|
ExportEnv,
|
|
|
|
ExportEnv,
|
|
|
|
LetEnv,
|
|
|
|
LetEnv,
|
|
|
|
LoadEnv,
|
|
|
|
LoadEnv,
|
|
|
@ -426,13 +447,41 @@ pub fn bind_math_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
|
MathStddev,
|
|
|
|
MathStddev,
|
|
|
|
MathSum,
|
|
|
|
MathSum,
|
|
|
|
MathVariance,
|
|
|
|
MathVariance,
|
|
|
|
|
|
|
|
MathSin,
|
|
|
|
|
|
|
|
MathCos,
|
|
|
|
|
|
|
|
MathTan,
|
|
|
|
|
|
|
|
MathSinH,
|
|
|
|
|
|
|
|
MathCosH,
|
|
|
|
|
|
|
|
MathTanH,
|
|
|
|
|
|
|
|
MathArcSin,
|
|
|
|
|
|
|
|
MathArcCos,
|
|
|
|
|
|
|
|
MathArcTan,
|
|
|
|
|
|
|
|
MathArcSinH,
|
|
|
|
|
|
|
|
MathArcCosH,
|
|
|
|
|
|
|
|
MathArcTanH,
|
|
|
|
|
|
|
|
MathPi,
|
|
|
|
|
|
|
|
MathTau,
|
|
|
|
|
|
|
|
MathEuler,
|
|
|
|
|
|
|
|
MathExp,
|
|
|
|
|
|
|
|
MathLn,
|
|
|
|
|
|
|
|
MathLog,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pub fn bind_network_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
|
pub fn bind_network_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
|
bind_commands! {
|
|
|
|
bind_commands! {
|
|
|
|
engine_state,
|
|
|
|
engine_state,
|
|
|
|
|
|
|
|
Http,
|
|
|
|
|
|
|
|
HttpDelete,
|
|
|
|
|
|
|
|
HttpGet,
|
|
|
|
|
|
|
|
HttpHead,
|
|
|
|
|
|
|
|
HttpPatch,
|
|
|
|
|
|
|
|
HttpPost,
|
|
|
|
|
|
|
|
HttpPut,
|
|
|
|
Url,
|
|
|
|
Url,
|
|
|
|
|
|
|
|
UrlBuildQuery,
|
|
|
|
|
|
|
|
UrlEncode,
|
|
|
|
|
|
|
|
UrlJoin,
|
|
|
|
UrlParse,
|
|
|
|
UrlParse,
|
|
|
|
Port,
|
|
|
|
Port,
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -473,7 +522,6 @@ pub fn bind_hash_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
|
pub fn bind_experimental_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
|
pub fn bind_experimental_commands(engine_state: &mut EngineState) -> CrateResult<()> {
|
|
|
|
bind_commands! {
|
|
|
|
bind_commands! {
|
|
|
|
engine_state,
|
|
|
|
engine_state,
|
|
|
|
ViewSource,
|
|
|
|
|
|
|
|
IsAdmin,
|
|
|
|
IsAdmin,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|