Addressing rebase issues

This commit is contained in:
Emily Toop 2017-05-30 11:03:47 +01:00
parent c03b88eb43
commit 36f6efa1d6
2 changed files with 12 additions and 12 deletions

View file

@ -72,10 +72,10 @@ impl Command {
pub fn output(&self) -> String {
match self {
&Command::Query(ref args) => {
format!(".{} {}", QUERY_COMMAND, args)
format!(".{} {}", LONG_QUERY_COMMAND, args)
},
&Command::Transact(ref args) => {
format!(".{} {}", TRANSACT_COMMAND, args)
format!(".{} {}", LONG_TRANSACT_COMMAND, args)
},
&Command::Help(ref args) => {
format!(".{} {:?}", HELP_COMMAND, args)
@ -135,13 +135,13 @@ pub fn command(s: &str) -> Result<Command, cli::Error> {
let query_parser = try(string(LONG_QUERY_COMMAND)).or(try(string(SHORT_QUERY_COMMAND)))
.with(edn_arg_parser())
.map(|x| {
Ok(Command::Query(x.into_iter().collect()))
Ok(Command::Query(x))
});
let transact_parser = try(string(LONG_TRANSACT_COMMAND)).or(try(string(SHORT_TRANSACT_COMMAND)))
.with(edn_arg_parser())
.map( |x| {
Ok(Command::Transact(x.into_iter().collect()))
Ok(Command::Transact(x))
});
spaces()

View file

@ -17,10 +17,10 @@ use command_parser::{
Command,
HELP_COMMAND,
OPEN_COMMAND,
QUERY_COMMAND,
ALT_QUERY_COMMAND,
TRANSACT_COMMAND,
ALT_TRANSACT_COMMAND,
LONG_QUERY_COMMAND,
SHORT_QUERY_COMMAND,
LONG_TRANSACT_COMMAND,
SHORT_TRANSACT_COMMAND,
};
use input::InputReader;
use input::InputResult::{
@ -39,10 +39,10 @@ lazy_static! {
let mut map = HashMap::new();
map.insert(HELP_COMMAND, "Show help for commands.");
map.insert(OPEN_COMMAND, "Open a database at path.");
map.insert(QUERY_COMMAND, "Execute a query against the current open database.");
map.insert(ALT_QUERY_COMMAND, "Shortcut for `.query`. Execute a query against the current open database.");
map.insert(TRANSACT_COMMAND, "Execute a transact against the current open database.");
map.insert(ALT_TRANSACT_COMMAND, "Shortcut for `.transact`. Execute a transact against the current open database.");
map.insert(LONG_QUERY_COMMAND, "Execute a query against the current open database.");
map.insert(SHORT_QUERY_COMMAND, "Shortcut for `.query`. Execute a query against the current open database.");
map.insert(LONG_TRANSACT_COMMAND, "Execute a transact against the current open database.");
map.insert(SHORT_TRANSACT_COMMAND, "Shortcut for `.transact`. Execute a transact against the current open database.");
map
};
}