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

Add date block from cli (POC for push blocks)

parent 774fd979
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
module QBar.Cli where module QBar.Cli where
import QBar.Blocks
import QBar.Blocks.Pipe import QBar.Blocks.Pipe
import QBar.ControlSocket import QBar.ControlSocket
import QBar.Core import QBar.Core
...@@ -55,9 +56,14 @@ pipeBlockParser = do ...@@ -55,9 +56,14 @@ pipeBlockParser = do
barConfigurationParser :: Parser (BarIO ()) barConfigurationParser :: Parser (BarIO ())
barConfigurationParser = do barConfigurationParser = do
blocks <- many $ hsubparser ( blocks <- many blockParser
command "default" (info (pure defaultBarConfig) (progDesc "Load default set of blocks."))
)
pure $ case blocks of pure $ case blocks of
-- Load default config if no blocks are selected on the command line
[] -> defaultBarConfig [] -> defaultBarConfig
l -> sequence_ l l -> sequence_ l
blockParser :: Parser (BarIO ())
blockParser = hsubparser (
command "default" (info (pure defaultBarConfig) (progDesc "Load default set of blocks.")) <>
command "date" (info (pure $ addBlock dateBlock) (progDesc "Load the date and time block."))
)
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