Commit d9f9d732 authored by Michael Hanus's avatar Michael Hanus
Browse files

CPM updated

parent f2c1ca9a
\section{\texttt{cpm}: The Curry Package Manager} \section{\texttt{cypm}: The Curry Package Manager}
\label{sec-cpm} \label{sec-cpm}
The Curry package manager (CPM) is a tool to The Curry package manager (CPM) is a tool to
......
...@@ -48,13 +48,13 @@ cpmBanner :: String ...@@ -48,13 +48,13 @@ cpmBanner :: String
cpmBanner = unlines [bannerLine,bannerText,bannerLine] cpmBanner = unlines [bannerLine,bannerText,bannerLine]
where where
bannerText = bannerText =
"Curry Package Manager <curry-language.org/tools/cpm> (version of 20/10/2017)" "Curry Package Manager <curry-language.org/tools/cpm> (version of 25/10/2017)"
bannerLine = take (length bannerText) (repeat '-') bannerLine = take (length bannerText) (repeat '-')
main :: IO () main :: IO ()
main = do main = do
args <- getArgs args <- getArgs
parseResult <- return $ parse (intercalate " " args) optionParser "cypm" parseResult <- return $ parse (unwords args) (optionParser args) "cypm"
case parseResult of case parseResult of
Left err -> do putStrLn cpmBanner Left err -> do putStrLn cpmBanner
putStrLn err putStrLn err
...@@ -62,7 +62,7 @@ main = do ...@@ -62,7 +62,7 @@ main = do
exitWith 1 exitWith 1
Right r -> case applyParse r of Right r -> case applyParse r of
Left err -> do putStrLn cpmBanner Left err -> do putStrLn cpmBanner
--printUsage "cypm" 80 optionParser --printUsage "cypm" 80 (optionParser args)
putStrLn err putStrLn err
exitWith 1 exitWith 1
Right opts -> runWithArgs opts Right opts -> runWithArgs opts
...@@ -337,8 +337,8 @@ a >.> f = case a of ...@@ -337,8 +337,8 @@ a >.> f = case a of
Left err -> Left err Left err -> Left err
Right v -> Right $ f v Right v -> Right $ f v
optionParser :: ParseSpec (Options -> Either String Options) optionParser :: [String] -> ParseSpec (Options -> Either String Options)
optionParser = optParser optionParser allargs = optParser
( option (\s a -> readLogLevel s >.> \ll -> a { optLogLevel = ll }) ( option (\s a -> readLogLevel s >.> \ll -> a { optLogLevel = ll })
( long "verbosity" ( long "verbosity"
<> short "v" <> short "v"
...@@ -473,18 +473,22 @@ optionParser = optParser ...@@ -473,18 +473,22 @@ optionParser = optParser
<> help "The name of the new project" ) <> help "The name of the new project" )
curryArgs = curryArgs =
rest (\s a -> Right $ a { optCommand = Compiler (compOpts a) rest (\_ a -> Right $ a { optCommand = Compiler (compOpts a)
{ comCommand = s } }) { comCommand = unwords remargs } })
( metavar "ARGS" ( metavar "ARGS"
<> help "The options to pass to the compiler" <> help "The options to pass to the compiler"
<> optional ) <> optional )
where
remargs = tail (snd (break (=="curry") allargs))
execArgs = execArgs =
rest (\s a -> Right $ a { optCommand = Exec (execOpts a) rest (\_ a -> Right $ a { optCommand = Exec (execOpts a)
{ exeCommand = s } }) { exeCommand = unwords remargs } })
( metavar "CMD" ( metavar "CMD"
<> help "The command to execute. Don't forget the quotes!" <> help "The command to execute. Don't forget the quotes!"
<> optional ) <> optional )
where
remargs = tail (snd (break (=="exec") allargs))
infoArgs = infoArgs =
arg (\s a -> Right $ a { optCommand = PkgInfo (infoOpts a) arg (\s a -> Right $ a { optCommand = PkgInfo (infoOpts a)
......
...@@ -13,10 +13,14 @@ ...@@ -13,10 +13,14 @@
}, },
"license": "BSD-3-Clause", "license": "BSD-3-Clause",
"licenseFile": "LICENSE", "licenseFile": "LICENSE",
"testsuite": { "testsuite": [
"src-dir": "examples", { "src-dir": "examples",
"modules": [ "ABC" ] "modules": [ "ABC" ]
}, },
{ "src-dir": "test",
"modules": [ "TestRegExp" ]
}
],
"source": { "source": {
"git": "https://git.ps.informatik.uni-kiel.de/curry-packages/regexp.git", "git": "https://git.ps.informatik.uni-kiel.de/curry-packages/regexp.git",
"tag": "$version" "tag": "$version"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment