Add librsync and dmd

This commit is contained in:
2023-10-20 19:23:21 +02:00
parent 3a6d17952b
commit 8a69240d88
5 changed files with 81 additions and 89 deletions

View File

@ -7,7 +7,6 @@ module SlackBuilder.CommandLine
) where
import Data.Text (Text)
import qualified Data.Text as Text
import Options.Applicative
( Parser
, ParserInfo(..)
@ -21,7 +20,7 @@ import Options.Applicative
)
data SlackBuilderCommand
= TextCommand TextArguments
= CategoryCommand Text
| SlackBuildCommand Text Text
| CommitCommand Text Text
| ExistsCommand Text
@ -47,16 +46,12 @@ data TextArguments = TextArguments
, textURL :: Text
}
textArguments :: Parser TextArguments
textArguments = TextArguments Text.strip
<$> argument str (metavar "URL")
slackBuilderParser :: ParserInfo SlackBuilderCommand
slackBuilderParser = info slackBuilderCommand fullDesc
slackBuilderCommand :: Parser SlackBuilderCommand
slackBuilderCommand = subparser
$ command "text" (info (TextCommand <$> textArguments) mempty)
$ command "category" (info categoryCommand mempty)
<> command "slackbuild" (info slackBuildCommand mempty)
<> command "commit" (info commitCommand mempty)
<> command "exists" (info existsCommand mempty)
@ -66,6 +61,8 @@ slackBuilderCommand = subparser
<> command "deploy" (info deployCommand mempty)
<> command "up2date" (info up2DateCommand mempty)
where
categoryCommand = CategoryCommand
<$> argument str (metavar "PKGNAM")
slackBuildCommand = SlackBuildCommand
<$> argument str (metavar "PATH")
<*> argument str (metavar "VERSION")