parseArgs :: [String] -> Either String Arguments
parseArgs (d:c:p) = if and [isJust mCmd, length p == length mPorts] then Right args else Left helpMsg
    where
        mCmd = parseCommand c
        mPorts = mapMaybe parsePort p
        args = Arguments d (fromJust mCmd) (if null mPorts then [Port0 ..] else mPorts)
parseArgs :: [String] -> Either String Arguments
parseArgs (d:c:p) = if and [isJust mCmd, length p == length mPorts] then Right args else Left helpMsg
    where
        mCmd = parseCommand c
        mPorts = mapMaybe parsePort p
        args = Arguments d (fromJust mCmd) (if null mPorts then [Port0 ..] else mPorts)
parseArgs (d:c:p) = if and [isJust mCmd, length p == length mPorts] then Right args else Left helpMsg
    where
        mCmd = parseCommand c
        mPorts = mapMaybe parsePort p
        args = Arguments d (fromJust mCmd) (if null mPorts then [Port0 ..] else mPorts)