1
0
Fork 0
mirror of https://github.com/malob/prefmanager.git synced 2024-12-14 11:57:49 +00:00

Add list-domains command

This commit is contained in:
Malo Bourgon 2020-08-21 16:33:46 -07:00
parent 139f6ff959
commit fa8eb3416c
2 changed files with 22 additions and 19 deletions

View file

@ -1,2 +0,0 @@
import Distribution.Simple
main = defaultMain

View file

@ -20,21 +20,26 @@ opts = info
-- | App CLI commands
commands :: Parser (IO ())
commands = hsubparser
(command "watch"
(info
( watch . S.fromList <$> some
(Domain <$> strArgument
( metavar "DOMAIN..."
<> completer (listIOCompleter $ fmap coerce . S.toList <$> domains)
<> help "Domain(s) that will be watched"
)
)
<|> flag' (watch =<< domains)
( long "all"
<> short 'a'
<> help "Watch all domains including NSGlobalDomain"
)
)
(progDesc "Watch domain(s) for changes")
)
( command "watch"
(info
( watch . S.fromList <$> some
(Domain <$> strArgument
( metavar "DOMAIN..."
<> completer (listIOCompleter $ fmap coerce . S.toList <$> domains)
<> help "Domain(s) that will be watched"
)
)
<|> flag' (watch =<< domains)
( long "all"
<> short 'a'
<> help "Watch all domains including NSGlobalDomain"
)
)
$ progDesc "Watch domain(s) for changes"
)
<> command "list-domains"
(info
(pure $ S.toList <$> domains >>= mapM_ (putStrLn . coerce))
(progDesc "List all domains")
)
)