lord 2.20140323 → 2.20140324
raw patch · 4 files changed
+20/−13 lines, 4 filesdep ~optparse-applicative
Dependency ranges changed: optparse-applicative
Files
- CHANGELOG +4/−0
- Web/Radio/EightTracks/User.hs +1/−1
- lord.cabal +2/−2
- main.hs +13/−10
CHANGELOG view
@@ -1,5 +1,9 @@ CHANGELOG +2.20140323 -> 2.20140324+ - Update to optparse-applicative-0.8+ - Slight fix to 8tracks.com api+ 2.20131220 -> 2.20140323 - Update to aeson-0.7 - Fix douban listen musician/album
Web/Radio/EightTracks/User.hs view
@@ -16,7 +16,7 @@ { user :: User , status :: String , errors :: Maybe String- , notices :: String+ , notices :: Maybe String , logged_in :: Bool , api_version :: Int } deriving (Show, Generic)
lord.cabal view
@@ -1,5 +1,5 @@ name: lord-version: 2.20140323+version: 2.20140324 synopsis: A command line interface to online radios. description: A unified command line interface to several online radios, use mpd (<http://musicpd.org>) as backend by default. Will fallback to mplayer (<http://www.mplayerhq.hu>) when mpd is unavailable.@@ -108,7 +108,7 @@ http-conduit >= 1.9, http-types >= 0.8, libmpd >= 0.8,- optparse-applicative >= 0.5,+ optparse-applicative >= 0.8, process >= 1.1, text >= 0.11, transformers >= 0.3,
main.hs view
@@ -3,11 +3,10 @@ import Network.MPD (withMPD, clear, status, stState) import Network.MPD.Commands.Extensions (toggle) import Options.Applicative-import Options.Applicative.Types (ParserPrefs) import System.Directory (createDirectoryIfMissing) import System.Environment (getArgs, getProgName) import System.Exit (exitWith, exitSuccess, ExitCode(..))-import System.IO (hPutStr, stderr, SeekMode(..))+import System.IO (hPutStrLn, stderr, SeekMode(..)) import System.Log.FastLogger ( newFileLoggerSet, newStdoutLoggerSet , defaultBufSize ) import System.Posix.Daemon@@ -134,15 +133,19 @@ when (null args) $ lordStatus >> exitSuccess case execParserPure pprefs pinfo args of- Right a -> return a- Left failure -> do+ Success a -> return a+ Failure failure -> do progn <- getProgName- let c = errExitCode failure- msg <- errMessage failure progn- case c of- ExitSuccess -> putStr msg- _ -> hPutStr stderr msg- exitWith c+ let (msg, exit) = execFailure failure progn+ case exit of+ ExitSuccess -> putStrLn msg+ _ -> hPutStrLn stderr msg+ exitWith exit+ CompletionInvoked compl -> do+ progn <- getProgName+ msg <- execCompletion compl progn+ putStr msg+ exitWith ExitSuccess cmdOptions :: Parser Command cmdOptions = CmdFM <$> subparser