From 79eaa9ab7cd065df6b4922cd15a1983122af0e39 Mon Sep 17 00:00:00 2001 From: Jens Nolte <jens@nightmarestudio.de> Date: Sun, 1 Mar 2020 18:48:21 +0100 Subject: [PATCH] Require at least one block when running a server --- README.md | 2 +- src/QBar/Cli.hs | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7d71302..4cf7877 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ stack build You can also use the scripts in the `bin`-directory (all scripts will rebuild the project if required): ``` # Launch as swaybar status command while redirecting stderr to shell -./bin/run-sway +./bin/run-sway default # Run the binary directly (mostly used to control the bar via rpc) ./bin/run --help diff --git a/src/QBar/Cli.hs b/src/QBar/Cli.hs index 702c8a3..7ee51a0 100644 --- a/src/QBar/Cli.hs +++ b/src/QBar/Cli.hs @@ -60,11 +60,8 @@ pipeClientParser = do barConfigurationParser :: Parser (BarIO ()) barConfigurationParser = do - blocks <- many blockParser - pure $ case blocks of - -- Load default config if no blocks are selected on the command line - [] -> defaultBarConfig - l -> sequence_ l + blocks <- some blockParser + pure $ sequence_ blocks blockParser :: Parser (BarIO ()) blockParser = subparser ( -- GitLab