From 11bf0368d134a6107c477d75b6194b2534c7f6c8 Mon Sep 17 00:00:00 2001 From: vms Date: Thu, 3 Sep 2020 01:36:44 +0300 Subject: [PATCH] join strings with empty space in call --- Cargo.lock | 10 ++++++++++ tools/repl/Cargo.toml | 1 + tools/repl/src/main.rs | 2 +- tools/repl/src/repl.rs | 4 +++- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 93bbb6f8..b2f50aee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -746,6 +746,7 @@ dependencies = [ "anyhow", "clap", "fluence-app-service", + "itertools", "rustop", "rustyline", "rustyline-derive", @@ -1103,6 +1104,15 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47be2f14c678be2fdcab04ab1171db51b2762ce6f0a8ee87c8dd4a04ed216135" +[[package]] +name = "itertools" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "0.4.6" diff --git a/tools/repl/Cargo.toml b/tools/repl/Cargo.toml index bc458fe7..988b80a5 100644 --- a/tools/repl/Cargo.toml +++ b/tools/repl/Cargo.toml @@ -22,4 +22,5 @@ wasmer-wasi = { package = "wasmer-wasi-fl", version = "0.17.0"} rustyline = { version = "6.1.2", features = ["with-fuzzy"] } rustyline-derive = "0.3.1" rustop = "1.1.0" +itertools = "0.9.0" uuid = { version = "0.8.1", features = ["v4"] } diff --git a/tools/repl/src/main.rs b/tools/repl/src/main.rs index d4e6889d..88484364 100644 --- a/tools/repl/src/main.rs +++ b/tools/repl/src/main.rs @@ -78,7 +78,7 @@ fn main() -> Result<()> { rl.bind_sequence(KeyPress::Meta('P'), Cmd::HistorySearchBackward); let _ = rl.load_history(HISTORY_FILE_PATH); - println!("Welcome to the Fluence FaaS REPL:"); + println!("Welcome to the Fluence FaaS REPL"); let mut repl = REPL::new(args.config_file_path)?; diff --git a/tools/repl/src/repl.rs b/tools/repl/src/repl.rs index b0c44d8b..b1556b16 100644 --- a/tools/repl/src/repl.rs +++ b/tools/repl/src/repl.rs @@ -97,10 +97,12 @@ impl REPL { println!("{}", result_msg); } Some("call") => { + use itertools::Itertools; + next_argument!(module_name, args, "Module name should be specified"); next_argument!(func_name, args, "Function name should be specified"); - let module_arg: String = args.collect(); + let module_arg: String = args.join(" "); let module_arg: serde_json::Value = match serde_json::from_str(&module_arg) { Ok(module_arg) => module_arg, Err(e) => {