summaryrefslogtreecommitdiff
path: root/src/parser.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser.rs')
-rw-r--r--src/parser.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/parser.rs b/src/parser.rs
index 2f65180..64ebf5b 100644
--- a/src/parser.rs
+++ b/src/parser.rs
@@ -15,6 +15,8 @@ pub enum Command {
Whitespace,
Exit,
GitInit(String),
+ GitUploadPack(String),
+ GitReceivePack(String),
}
impl FromStr for Command {
@@ -44,6 +46,14 @@ fn command_parser(input: &str) -> IResult<&str, Command> {
ws(tuple((tag("git-init"), multispace1, not_space))),
|(_, _, repo_name)| Command::GitInit(repo_name.to_owned()),
),
+ map(
+ ws(tuple((tag("git upload-pack"), multispace1, not_space))),
+ |(_, _, git_dir)| Command::GitUploadPack(git_dir.to_owned()),
+ ),
+ map(
+ ws(tuple((tag("git receive-pack"), multispace1, not_space))),
+ |(_, _, git_dir)| Command::GitReceivePack(git_dir.to_owned()),
+ ),
))(input)
}