From 02a6b7f830b5845909272490bd7ba3789a8ad3d6 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Tue, 25 Aug 2015 09:19:44 +0300 Subject: [PATCH] Stop nagging people that call stack test (fixes #845) --- ChangeLog.md | 1 + src/main/Main.hs | 26 ++++++++------------------ 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index a6322eefca..366bfbe1f5 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -19,6 +19,7 @@ Other enhancements: * Set --enable-tests and --enable-benchmarks optimistically [#805](https://github.com/commercialhaskell/stack/issues/805) * `--only-configure` option added [#820](https://github.com/commercialhaskell/stack/issues/820) * Check for duplicate local package names +* Stop nagging people that call `stack test` [#845](https://github.com/commercialhaskell/stack/issues/845) Bug fixes: diff --git a/src/main/Main.hs b/src/main/Main.hs index 819d49b7ac..0a2ee5abf7 100644 --- a/src/main/Main.hs +++ b/src/main/Main.hs @@ -165,11 +165,11 @@ main = withInterpreterArgs stackProgName $ \args isInterpreter -> do globalOptsParser isTerminal) (do addCommand "build" "Build the project(s) in this directory/configuration" - (buildCmd Nothing) + buildCmd (buildOptsParser Build) addCommand "install" "Shortcut for 'build --copy-bins'" - (buildCmd $ Just ("install", "copy-bins")) + buildCmd (buildOptsParser Install) addCommand "uninstall" "DEPRECATED: This command performs no actions, and is present for documentation only" @@ -177,15 +177,15 @@ main = withInterpreterArgs stackProgName $ \args isInterpreter -> do (many $ strArgument $ metavar "IGNORED") addCommand "test" "Shortcut for 'build --test'" - (buildCmd $ Just ("test", "test")) + buildCmd (buildOptsParser Test) addCommand "bench" "Shortcut for 'build --bench'" - (buildCmd $ Just ("bench", "bench")) + buildCmd (buildOptsParser Bench) addCommand "haddock" "Shortcut for 'build --haddock'" - (buildCmd $ Just ("haddock", "haddock")) + buildCmd (buildOptsParser Haddock) addCommand "new" "Create a new project from a template. Run `stack templates' to see available templates." @@ -657,9 +657,8 @@ cleanCmd :: () -> GlobalOpts -> IO () cleanCmd () go = withBuildConfigAndLock go (\_ -> clean) -- | Helper for build and install commands -buildCmd :: Maybe (Text, Text) -- ^ option synonym - -> BuildOpts -> GlobalOpts -> IO () -buildCmd moptionSynonym opts go +buildCmd :: BuildOpts -> GlobalOpts -> IO () +buildCmd opts go | boptsFileWatch opts = let getProjectRoot = do (manager, lc) <- loadConfigWithOpts go @@ -670,16 +669,7 @@ buildCmd moptionSynonym opts go in fileWatch getProjectRoot inner | otherwise = inner $ const $ return () where - inner setLocalFiles = withBuildConfigAndLock go $ \lk -> do - case moptionSynonym of - Nothing -> return () - Just (cmd, opt) -> $logInfo $ T.concat - [ "NOTE: the " - , cmd - , " command is functionally equivalent to 'build --" - , opt - , "'" - ] + inner setLocalFiles = withBuildConfigAndLock go $ \lk -> globalFixCodePage go $ Stack.Build.build setLocalFiles (Just lk) opts globalFixCodePage :: (Catch.MonadMask m, MonadIO m, MonadLogger m)