littlegraph 0.2.1

Command-line tools and network servers for the littlegraph graph database
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ShellCommand {
    Begin,
    Commit,
    Rollback,
    Exit,
}

pub fn parse_shell_command(input: &str) -> Option<ShellCommand> {
    match input {
        ":begin" => Some(ShellCommand::Begin),
        ":commit" => Some(ShellCommand::Commit),
        ":rollback" => Some(ShellCommand::Rollback),
        ":exit" | ":quit" | ".exit" | ".quit" => Some(ShellCommand::Exit),
        _ => None,
    }
}