Commit d90d3c26 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Improve the cabal --help output

Put the general info message at the top and make the explanation of
installing a hackage package somewhat clearer.
parent 27618136
...@@ -98,16 +98,17 @@ globalCommand :: CommandUI GlobalFlags ...@@ -98,16 +98,17 @@ globalCommand :: CommandUI GlobalFlags
globalCommand = CommandUI { globalCommand = CommandUI {
commandName = "", commandName = "",
commandSynopsis = "", commandSynopsis = "",
commandUsage = \_ ->
"This program is the command line interface "
++ "to the Haskell Cabal infrastructure.\n"
++ "See http://www.haskell.org/cabal/ for more information.\n",
commandDescription = Just $ \pname -> commandDescription = Just $ \pname ->
"Typical step for installing Cabal packages:\n" "For more information about a command use:\n"
++ " " ++ pname ++ " install [PACKAGES]\n" ++ " " ++ pname ++ " COMMAND --help\n\n"
++ "\nOccasionally you need to update the list of available packages:\n" ++ "To install Cabal packages from hackage use:\n"
++ " " ++ pname ++ " update\n" ++ " " ++ pname ++ " install foo [--dry-run]\n\n"
++ "\nFor more information about a command, try '" ++ "Occasionally you need to update the list of available packages:\n"
++ pname ++ " COMMAND --help'." ++ " " ++ pname ++ " update\n",
++ "\nThis program is the command line interface to the Haskell Cabal Infrastructure."
++ "\nSee http://www.haskell.org/cabal/ for more information.\n",
commandUsage = \_ -> [],
commandDefaultFlags = defaultGlobalFlags, commandDefaultFlags = defaultGlobalFlags,
commandOptions = \showOrParseArgs -> commandOptions = \showOrParseArgs ->
(case showOrParseArgs of ShowArgs -> take 2; ParseArgs -> id) (case showOrParseArgs of ShowArgs -> take 2; ParseArgs -> id)
...@@ -405,7 +406,7 @@ installCommand = configureCommand { ...@@ -405,7 +406,7 @@ installCommand = configureCommand {
Just desc -> desc pname ++ "\n" Just desc -> desc pname ++ "\n"
Nothing -> "" Nothing -> ""
in original in original
++ "Examples: \n" ++ "Examples:\n"
++ " " ++ pname ++ " install " ++ " " ++ pname ++ " install "
++ " Package in the current directory\n" ++ " Package in the current directory\n"
++ " " ++ pname ++ " install foo " ++ " " ++ pname ++ " install foo "
......
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