Skip to content
Snippets Groups Projects
Commit e6686611 authored by Jens Nolte's avatar Jens Nolte
Browse files

Improve block parser cli

parent 79eaa9ab
No related branches found
No related tags found
No related merge requests found
......@@ -64,19 +64,21 @@ barConfigurationParser = do
pure $ sequence_ blocks
blockParser :: Parser (BarIO ())
blockParser = subparser (
commandGroup "Available blocks:" <>
command "date" (info (pure $ addBlock dateBlock) (progDesc "Load the date and time block.")) <>
command "cpu" (info (pure $ addBlock $ cpuUsageBlock 1) (progDesc "Load the cpu usage block.")) <>
command "script" (info scriptBlockParser (progDesc "Display the output of an external script as a block."))
)
<|>
blockParser =
subparser (
hidden <>
commandGroup "Available presets:" <>
metavar "CONFIG..." <>
command "default" (info (pure defaultBarConfig) (progDesc "Load default set of blocks.")) <>
command "legacy" (info (pure legacyBarConfig) (progDesc "Load the legacy configuration. Requires some custom block scripts."))
)
<|>
subparser (
commandGroup "Available blocks:" <>
hidden <>
command "date" (info (pure $ addBlock dateBlock) (progDesc "Load the date and time block.")) <>
command "cpu" (info (pure $ addBlock $ cpuUsageBlock 1) (progDesc "Load the cpu usage block.")) <>
command "script" (info scriptBlockParser (progDesc "Display the output of an external script as a block."))
)
scriptBlockParser :: Parser (BarIO ())
scriptBlockParser = helper <*> do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment