Merge pull request #75 from nushell/prepare_for_porting

Prepare nu_commands for porting
This commit is contained in:
JT 2021-09-30 07:27:56 +13:00 committed by GitHub
commit d34e083976
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
32 changed files with 71 additions and 44 deletions

View File

@ -22,6 +22,8 @@
- [x] Detecting `$it` currently only looks at top scope but should find any free `$it` in the expression (including subexprs)
- [x] Signature needs to make parameters visible in scope before block is parsed
- [x] Externals
- [x] Modules and imports
- [ ] Exports
- [ ] Support for `$in`
- [ ] Value serialization
- [ ] Handling rows with missing columns during a cell path

View File

@ -0,0 +1,15 @@
mod alias;
mod def;
mod do_;
mod if_;
mod let_;
mod module;
mod use_;
pub use alias::Alias;
pub use def::Def;
pub use do_::Do;
pub use if_::If;
pub use let_::Let;
pub use module::Module;
pub use use_::Use;

View File

@ -6,8 +6,8 @@ use nu_protocol::{
};
use crate::{
where_::Where, Alias, Benchmark, BuildString, Def, Do, Each, External, For, Git, GitCheckout,
If, Length, Let, LetEnv, Lines, ListGitBranches, Ls, Module, Table, Use,
Alias, Benchmark, BuildString, Def, Do, Each, External, For, Git, GitCheckout, If, Length, Let,
LetEnv, Lines, ListGitBranches, Ls, Module, Table, Use, Where,
};
pub fn create_default_context() -> Rc<RefCell<EngineState>> {

3
crates/nu-command/src/env/mod.rs vendored Normal file
View File

@ -0,0 +1,3 @@
mod let_env;
pub use let_env::LetEnv;

View File

@ -0,0 +1,7 @@
mod git;
mod git_checkout;
mod list_git_branches;
pub use git::Git;
pub use git_checkout::GitCheckout;
pub use list_git_branches::ListGitBranches;

View File

@ -0,0 +1,3 @@
mod ls;
pub use ls::Ls;

View File

@ -0,0 +1,11 @@
mod each;
mod for_;
mod length;
mod lines;
mod where_;
pub use each::Each;
pub use for_::For;
pub use length::Length;
pub use lines::Lines;
pub use where_::Where;

View File

@ -1,44 +1,19 @@
mod alias;
mod benchmark;
mod build_string;
mod def;
mod core_commands;
mod default_context;
mod do_;
mod each;
mod for_;
mod git;
mod git_checkout;
mod if_;
mod length;
mod let_;
mod let_env;
mod lines;
mod list_git_branches;
mod ls;
mod module;
mod run_external;
mod table;
mod use_;
mod where_;
mod env;
mod experimental;
mod filesystem;
mod filters;
mod strings;
mod system;
mod viewers;
pub use alias::Alias;
pub use benchmark::Benchmark;
pub use build_string::BuildString;
pub use def::Def;
pub use default_context::create_default_context;
pub use do_::Do;
pub use each::Each;
pub use for_::For;
pub use git::Git;
pub use git_checkout::GitCheckout;
pub use if_::If;
pub use length::Length;
pub use let_::Let;
pub use let_env::LetEnv;
pub use lines::Lines;
pub use list_git_branches::ListGitBranches;
pub use ls::Ls;
pub use module::Module;
pub use run_external::External;
pub use table::Table;
pub use use_::Use;
pub use core_commands::*;
pub use default_context::*;
pub use env::*;
pub use experimental::*;
pub use filesystem::*;
pub use filters::*;
pub use strings::*;
pub use system::*;
pub use viewers::*;

View File

@ -0,0 +1,3 @@
mod build_string;
pub use build_string::BuildString;

View File

@ -0,0 +1,5 @@
mod benchmark;
mod run_external;
pub use benchmark::Benchmark;
pub use run_external::{External, ExternalCommand};

View File

@ -0,0 +1,3 @@
mod table;
pub use table::Table;