diff options
| author | Eugen Wissner <belka@caraus.de> | 2025-02-18 11:57:18 +0100 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2025-02-18 11:57:18 +0100 |
| commit | 06fa97bfcf255fd033d3b5bd77d77d68ec8beef6 (patch) | |
| tree | 4714437eb7b10325be5aaeb5744935167156c11c /tea-cleaner/TeaCleaner/CommandLine.hs | |
| parent | 346b9dcfdf2a1c5d3339b4f3821080210316e6a9 (diff) | |
| download | kazbek-06fa97bfcf255fd033d3b5bd77d77d68ec8beef6.tar.gz | |
tea-cleaner: Read configuration file
Diffstat (limited to 'tea-cleaner/TeaCleaner/CommandLine.hs')
| -rw-r--r-- | tea-cleaner/TeaCleaner/CommandLine.hs | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/tea-cleaner/TeaCleaner/CommandLine.hs b/tea-cleaner/TeaCleaner/CommandLine.hs deleted file mode 100644 index b74263d..0000000 --- a/tea-cleaner/TeaCleaner/CommandLine.hs +++ /dev/null @@ -1,45 +0,0 @@ -module TeaCleaner.CommandLine - ( ProgramOptions(..) - , commandLineInfo - , execParser - ) where - -import Data.Text (Text) -import Options.Applicative - ( Parser - , ParserInfo - , (<**>) - , argument - , execParser - , fullDesc - , help - , helper - , info - , long - , metavar - , progDesc - , str - , switch - ) - -data ProgramOptions = ProgramOptions - { server :: Text - , token :: Text - , liveRun :: Bool - } deriving (Eq, Show) - -commandLineInfo :: ParserInfo ProgramOptions -commandLineInfo = info (commandLine <**> helper) - $ fullDesc <> progDesc "Helps to detect some spam gitea accounts" - -commandLine :: Parser ProgramOptions -commandLine = ProgramOptions - <$> serverOption - <*> tokenOption - <*> liveRunOption - where - serverOption = argument str - $ metavar "SERVER" <> help "Gitea server URL" - tokenOption = argument str - $ metavar "TOKEN" <> help "Access token" - liveRunOption = switch $ long "live-run" <> help "Purge suspicious users" |
