gregwebs/Shelly.hs

Inconsistency between what is displayed and what is being executed

Opened this issue · 1 comments

qwfy commented

The following code

{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ExtendedDefaultRules #-}
{-# OPTIONS_GHC -fno-warn-type-defaults #-}

import Shelly
import qualified Data.Text as T
import qualified System.IO

default (T.Text)

main = do
    System.IO.hSetBuffering System.IO.stdout System.IO.LineBuffering
    shelly $ verbosely $ do
        escaping False $ run "echo" ["He says: \"huh?\""]
        escaping True  $ run "echo" ["He says: \"huh?\""]

outputs:

echo 'He says: "huh?"'
He says: huh?
echo 'He says: "huh?"'
He says: "huh?"

verbosely says that they will do the same thing, (echo 'He says: "huh?"'), but they are not.

Yeah, the command printer does not take into account the escaping setting.