rdiff-backup: Migrated

This commit is contained in:
2023-10-13 19:34:02 +02:00
parent 5e161c3dad
commit 4105ffa91f
4 changed files with 22 additions and 57 deletions

View File

@ -16,12 +16,11 @@ import Options.Applicative
, info
, fullDesc
, subparser
, command, optional
, command,
)
data SlackBuilderCommand
= TextCommand TextArguments
| GhCommand GhArguments
| SlackBuildCommand Text Text
| CommitCommand Text Text
| ExistsCommand Text
@ -49,19 +48,12 @@ newtype TextArguments = TextArguments Text
textArguments :: Parser TextArguments
textArguments = TextArguments <$> argument str (metavar "URL")
ghArguments :: Parser GhArguments
ghArguments = GhArguments
<$> argument str (metavar "OWNER")
<*> argument str (metavar "NAME")
<*> optional (argument str (metavar "TRANSFORM"))
slackBuilderParser :: ParserInfo SlackBuilderCommand
slackBuilderParser = info slackBuilderCommand fullDesc
slackBuilderCommand :: Parser SlackBuilderCommand
slackBuilderCommand = subparser
$ command "text" (info (TextCommand <$> textArguments) mempty)
<> command "github" (info (GhCommand <$> ghArguments) mempty)
<> command "slackbuild" (info slackBuildCommand mempty)
<> command "commit" (info commitCommand mempty)
<> command "exists" (info existsCommand mempty)