Add module with an info file parser
This commit is contained in:
@ -20,8 +20,7 @@ import Options.Applicative
|
||||
)
|
||||
|
||||
data SlackBuilderCommand
|
||||
= PackagistCommand PackagistArguments
|
||||
| TextCommand TextArguments
|
||||
= TextCommand TextArguments
|
||||
| GhCommand GhArguments
|
||||
| SlackBuildCommand Text Text
|
||||
| CommitCommand Text Text
|
||||
@ -47,11 +46,6 @@ data GhArguments = GhArguments
|
||||
newtype TextArguments = TextArguments Text
|
||||
deriving (Eq, Show)
|
||||
|
||||
packagistArguments :: Parser PackagistArguments
|
||||
packagistArguments = PackagistArguments
|
||||
<$> argument str (metavar "VENDOR")
|
||||
<*> argument str (metavar"NAME")
|
||||
|
||||
textArguments :: Parser TextArguments
|
||||
textArguments = TextArguments <$> argument str (metavar "URL")
|
||||
|
||||
@ -66,8 +60,7 @@ slackBuilderParser = info slackBuilderCommand fullDesc
|
||||
|
||||
slackBuilderCommand :: Parser SlackBuilderCommand
|
||||
slackBuilderCommand = subparser
|
||||
$ command "packagist" (info (PackagistCommand <$> packagistArguments) mempty)
|
||||
<> command "text" (info (TextCommand <$> textArguments) mempty)
|
||||
$ command "text" (info (TextCommand <$> textArguments) mempty)
|
||||
<> command "github" (info (GhCommand <$> ghArguments) mempty)
|
||||
<> command "slackbuild" (info slackBuildCommand mempty)
|
||||
<> command "commit" (info commitCommand mempty)
|
||||
|
Reference in New Issue
Block a user