cmd_consolewidth :: String -> IP.IdrisParser (Either String Command)
cmd_consolewidth name = do
    w <- pConsoleWidth
    return (Right (SetConsoleWidth w))

    where
        pConsoleWidth :: IP.IdrisParser ConsoleWidth
        pConsoleWidth = do discard (IP.symbol "auto"); return AutomaticWidth
                    <|> do discard (IP.symbol "infinite"); return InfinitelyWide
                    <|> do n <- fromInteger <$> IP.natural
                           return (ColsWide n)
cmd_consolewidth :: String -> IP.IdrisParser (Either String Command)
cmd_consolewidth name = do
    w <- pConsoleWidth
    return (Right (SetConsoleWidth w))

    where
        pConsoleWidth :: IP.IdrisParser ConsoleWidth
        pConsoleWidth = do discard (IP.symbol "auto"); return AutomaticWidth
                    <|> do discard (IP.symbol "infinite"); return InfinitelyWide
                    <|> do n <- fromInteger <$> IP.natural
                           return (ColsWide n)
cmd_consolewidth name = do
    w <- pConsoleWidth
    return (Right (SetConsoleWidth w))

    where
        pConsoleWidth :: IP.IdrisParser ConsoleWidth
        pConsoleWidth = do discard (IP.symbol "auto"); return AutomaticWidth
                    <|> do discard (IP.symbol "infinite"); return InfinitelyWide
                    <|> do n <- fromInteger <$> IP.natural
                           return (ColsWide n)