module Darcs.UI.Commands.Show ( showCommand ) where
import Prelude ()
import Darcs.Prelude
import Darcs.UI.Commands ( DarcsCommand(..)
, normalCommand
, commandAlias, amInRepository
)
import Darcs.UI.Commands.ShowAuthors ( showAuthors )
import Darcs.UI.Commands.ShowContents ( showContents )
import Darcs.UI.Commands.ShowDependencies ( showDeps )
import Darcs.UI.Commands.ShowFiles ( showFiles )
import Darcs.UI.Commands.ShowTags ( showTags )
import Darcs.UI.Commands.ShowRepo ( showRepo )
import Darcs.UI.Commands.ShowIndex ( showIndex, showPristineCmd )
import Darcs.UI.Commands.ShowPatchIndex ( showPatchIndex )
import Darcs.UI.Flags ( DarcsFlag )
showDescription :: String
showDescription = "Show information about the given repository."
showHelp :: String
showHelp =
"Use the `--help` option with the subcommands to obtain help for\n"++
"subcommands (for example, `darcs show files --help`).\n"
showCommand :: DarcsCommand [DarcsFlag]
showCommand = SuperCommand
{ commandProgramName = "darcs"
, commandName = "show"
, commandHelp = showHelp
, commandDescription = showDescription
, commandPrereq = amInRepository
, commandSubCommands =
[ normalCommand showContents
, normalCommand showDeps
, normalCommand showFiles
, normalCommand showIndex
, normalCommand showPristine
, normalCommand showRepo
, normalCommand showAuthors
, normalCommand showTags
, normalCommand showPatchIndex ]
}
showPristine :: DarcsCommand [DarcsFlag]
showPristine = (commandAlias "pristine" (Just showCommand) showIndex) {
commandCommand = showPristineCmd,
commandDescription = "Dump contents of pristine cache.",
commandHelp =
"The `darcs show pristine` command lists all version-controlled files " ++
"and directories along with the hashes of their pristine copies. " ++
"For files, the fields correspond to file size, sha256 of the pristine " ++
"file content and the filename." }