Commit 27618136 authored by Duncan Coutts's avatar Duncan Coutts

Display examples in cabal install --help

Examples: 
  cabal install                     Package in the current directory
  cabal install foo                 Package from the hackage server
  cabal install foo-1.0             Specific version of a package
  cabal install 'foo < 2'           Constrained package version
parent 45b4dc62
......@@ -400,6 +400,20 @@ installCommand = configureCommand {
commandName = "install",
commandSynopsis = "Installs a list of packages.",
commandUsage = usagePackages "install",
commandDescription = Just $ \pname ->
let original = case commandDescription configureCommand of
Just desc -> desc pname ++ "\n"
Nothing -> ""
in original
++ "Examples: \n"
++ " " ++ pname ++ " install "
++ " Package in the current directory\n"
++ " " ++ pname ++ " install foo "
++ " Package from the hackage server\n"
++ " " ++ pname ++ " install foo-1.0 "
++ " Specific version of a package\n"
++ " " ++ pname ++ " install 'foo < 2' "
++ " Constrained package version\n",
commandDefaultFlags = (mempty, mempty),
commandOptions = \showOrParseArgs ->
liftOptionsFst (commandOptions configureCommand showOrParseArgs) ++
......
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