diff --git a/README.org b/README.org index 83a76f1..d5bada6 100644 --- a/README.org +++ b/README.org @@ -134,6 +134,7 @@ markdown wasn't created to deal with todo list, etc... Org-mode file can handle meta-datas, can be presented with columns, sorted, can provide agenda views, etc... + * Why is this important? It is very important to put all those meta-data about your project inside the repository because: diff --git a/gpm.hs b/gpm.hs old mode 100644 new mode 100755 index 6a50136..ff0c9e6 --- a/gpm.hs +++ b/gpm.hs @@ -4,11 +4,43 @@ #! nix-shell -I nixpkgs="https://github.com/NixOS/nixpkgs/archive/16d475334409f7fa632929b2838421b4ffe34927.tar.gz" {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} -import Protolude hiding (stdout,(%)) +import Protolude hiding (stdout,(%),die) import Turtle main :: IO () main = do + x <- options "Git Project Manager" parser + case x of + Init -> init + NewIssue -> newIssue + StartReview br -> startReview br + EndReview br -> endReview br + +data Command = Init + | NewIssue + | StartReview (Maybe Text) + | EndReview (Maybe Text) + deriving (Eq) + +parser :: Parser Command +parser = subcommand "init" "Initialize gpm" (pure Init) + <|> subcommand "new-issue" "Create a new Issue" (pure NewIssue) + <|> StartReview <$> subcommand "start-review" "Start review (use current branch by default)" + (optional (argText "branch" "The git branch to review")) + <|> EndReview <$> subcommand "end-review" "End review (use current branch by default)" + (optional (argText "branch" "The git branch to end review")) + +newIssue :: IO () +newIssue = die "TODO" + +startReview :: Maybe Text -> IO () +startReview br = die "TODO" + +endReview :: Maybe Text -> IO () +endReview br = die "TODO" + +init :: IO () +init = do echo "# -- Git Project Manager" mkNewEmptyBranch "gpm" initIssues