Skip to content
Snippets Groups Projects
Commit 26d47cf5 authored by Iustin Pop's avatar Iustin Pop
Browse files

CLI: Prevent incompatible options to be selected

This patch makes CLI abort if more than one backend is selected.
parent b9017fa7
No related merge requests found
......@@ -152,6 +152,16 @@ loadExternalData opts = do
else env_inst
mhost = masterName opts
lsock = luxiSocket opts
setRapi = mhost /= ""
setLuxi = isJust lsock
setFiles = nodeSet opts || instSet opts
allSet = filter id [setRapi, setLuxi, setFiles]
when (length allSet > 1) $
do
hPutStrLn stderr "Error: Only one of the rapi, luxi, and data\
\ files options should be given."
exitWith $ ExitFailure 1
input_data <-
case () of
_ | mhost /= "" -> Rapi.loadData mhost
......
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