haskdogs 0.5.1 → 0.5.3
raw patch · 3 files changed
+30/−11 lines, 3 files
Files
- README.md +10/−0
- haskdogs.cabal +1/−1
- src/Main.hs +19/−10
README.md view
@@ -112,6 +112,16 @@ Just copy the code above to your ~/.vimrc and reload the vim. ++NIXOS Note+----------++The easiest way to generate tags file on NixOS is to open a shell containing+neccesary programs. Nix-shell should do it if run as follows:++ nix-shell -p haskellPackages.haskdogs haskellPackages.hasktags haskellPackages.Cabal ghc++ -- Sergey <grrwlf@gmail.com>
haskdogs.cabal view
@@ -1,5 +1,5 @@ Name: haskdogs-Version: 0.5.1+Version: 0.5.3 Synopsis: Generate tags file for Haskell project and its nearest deps Homepage: http://github.com/grwlf/haskdogs License: BSD3
src/Main.hs view
@@ -35,6 +35,7 @@ , cli_stack_args :: String , cli_ghc_pkgs_args :: String , cli_use_stack :: Tristate+ , cli_deps_dir :: FilePath -- , cli_use_sandbox :: Tristate , cli_hasktags_args2 :: [String] } deriving(Show)@@ -44,20 +45,20 @@ def_hasktags_args = words "-c -x" -optsParser :: Parser Opts-optsParser = Opts+optsParser :: FilePath -> Parser Opts+optsParser def_deps_dir = Opts <$> strOption ( long "dir-list" <> short 'd' <> metavar "FILE" <> value "" <>- help "File containing directory list to process" )+ help "File containing directory list to process (use '-' to read from stdin)" ) <*> strOption ( long "file-list" <> short 'f' <> metavar "FILE" <> value "" <>- help "File containing Haskell sources to process" )+ help "File containing Haskell sources to process (use '-' to read from stdin)" ) <*> strOption ( long "hasktags-args" <> metavar "OPTS" <>@@ -77,6 +78,11 @@ long "use-stack" <> value AUTO <> help "Execute ghc-pkg via stack, arg is ON, OFF or AUTO (the default)")+ <*> strOption (+ long "deps-dir" <>+ metavar "PATH" <>+ value def_deps_dir <>+ help ("Specify the directory PATH to save the dependencies of the project. Default is [" <> def_deps_dir <> "]")) -- <*> option auto ( -- long "include-sandbox" <> -- value AUTO <>@@ -90,7 +96,7 @@ versionParser = infoOption (exename ++ " version " ++ (showVersion Paths.version)) (long "version" <> help "Show version number") -opts = info (helper <*> versionParser <*> optsParser)+opts def_deps_dir = info (helper <*> versionParser <*> (optsParser def_deps_dir)) ( fullDesc <> header (exename ++ " - Recursive hasktags-based TAGS generator for a Haskell project" )) {-@@ -105,15 +111,16 @@ main :: IO() main = do - Opts {..} <- execParser opts+ def_deps_dir <- (</> ".haskdogs") <$> getHomeDirectory + Opts {..} <- execParser (opts def_deps_dir)+ let -- Directory to unpack sources into getDataDir :: IO FilePath getDataDir = do- x <- (</> ".haskdogs") <$> getHomeDirectory- createDirectoryIfMissing False x- return x+ createDirectoryIfMissing False cli_deps_dir+ return cli_deps_dir cli_verbose = True @@ -231,7 +238,9 @@ fail $ "Haskdogs were not able to find any sources in " <> (intercalate ", " dirs) ss_l1deps <- findModules ss_local >>= inames2modules >>= unpackModules >>= findSources return $ ss_local `mappend` ss_l1deps- runp "hasktags" ((if null cli_hasktags_args then def_hasktags_args else cli_hasktags_args) ++ Set.toList files) []+ sfiles <- pure $ unlines $ Set.toList files+ vprint sfiles+ runp "hasktags" ((if null cli_hasktags_args then def_hasktags_args else cli_hasktags_args) ++ ["STDIN"]) sfiles putStrLn "\nSuccess" {- _real_main_ -}