Merge pull request #50 from jonathandturner/command_cleanup

Cleanup/rename some commands
This commit is contained in:
Jonathan Turner 2019-06-01 08:35:03 +12:00 committed by GitHub
commit ffe2896aac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 9 additions and 13 deletions

View File

@ -25,8 +25,8 @@ Nu currently has the following built-in commands:
- to-json
- from-json
- open filename
- column-split sep ...fields
- row-split sep ...fields
- split-column sep ...fields
- split-row sep ...fields
- select field
# Goals

View File

@ -52,8 +52,8 @@ pub async fn cli() -> Result<(), Box<Error>> {
command("from-json", from_json::from_json),
command("open", open::open),
command("column", column::column),
command("column-split", col_split::col_split),
command("row-split", row_split::row_split),
command("split-column", split_column::split_column),
command("split-row", split_row::split_row),
command("reject", reject::reject),
command("select", select::select),
command("to-array", to_array::to_array),

View File

@ -12,8 +12,8 @@ crate mod select;
crate mod size;
crate mod skip;
crate mod sort_by;
crate mod col_split;
crate mod row_split;
crate mod split_column;
crate mod split_row;
crate mod take;
crate mod to_array;
crate mod to_json;

View File

@ -1,6 +1,5 @@
use crate::errors::ShellError;
use crate::object::Value;
use crate::object::base::select_fields;
use crate::prelude::*;
fn get_member(path: &str, obj: &Value) -> Option<Value> {

View File

@ -5,8 +5,7 @@ use log::debug;
// TODO: "Amount remaining" wrapper
pub fn col_split(args: CommandArgs) -> Result<OutputStream, ShellError> {
//let splitter = args.args[0].as_string()?;
pub fn split_column(args: CommandArgs) -> Result<OutputStream, ShellError> {
let input = args.input;
let args = args.args;

View File

@ -5,8 +5,7 @@ use log::debug;
// TODO: "Amount remaining" wrapper
pub fn row_split(args: CommandArgs) -> Result<OutputStream, ShellError> {
//let splitter = args.args[0].as_string()?;
pub fn split_row(args: CommandArgs) -> Result<OutputStream, ShellError> {
let input = args.input;
let args = args.args;
@ -26,8 +25,7 @@ pub fn row_split(args: CommandArgs) -> Result<OutputStream, ShellError> {
result
}
_ => {
let mut result = VecDeque::new();
//result.push_back(ReturnValue::Value(Value::Object(crate::object::Dictionary::default())));
let result = VecDeque::new();
result
}
})