module Darcs.Commands.Show ( showCommand, list, query ) where
import Darcs.Commands ( DarcsCommand(..),
CommandControl(CommandData, HiddenCommand),
commandAlias,
)
import Darcs.Commands.ShowAuthors ( showAuthors )
import Darcs.Commands.ShowBug ( showBug )
import Darcs.Commands.ShowContents ( showContents )
import Darcs.Commands.ShowFiles ( showFiles, manifestCmd, toListManifest )
import Darcs.Commands.ShowTags ( showTags )
import Darcs.Commands.ShowRepo ( showRepo )
import Darcs.Commands.ShowIndex ( showIndex, showPristineCmd )
import Darcs.Repository ( amInRepository )
showDescription :: String
showDescription = "Show information which is stored by darcs."
showHelp :: String
showHelp =
"Use the --help option with the subcommands to obtain help for\n"++
"subcommands (for example, \"darcs show files --help\").\n" ++
"\n" ++
"In previous releases, this command was called `darcs query'.\n" ++
"Currently this is a deprecated alias.\n"
showCommand :: DarcsCommand
showCommand = SuperCommand {commandProgramName = "darcs",
commandName = "show",
commandHelp = showHelp,
commandDescription = showDescription,
commandPrereq = amInRepository,
commandSubCommands = [HiddenCommand showBug,
CommandData showContents,
CommandData showFiles, HiddenCommand showManifest,
CommandData showIndex,
CommandData showPristine,
CommandData showRepo,
CommandData showAuthors,
CommandData showTags]
}
query :: DarcsCommand
query = commandAlias "query" Nothing showCommand
list :: DarcsCommand
list = commandAlias "list" Nothing showCommand
showPristine :: DarcsCommand
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." }
showManifest :: DarcsCommand
showManifest = (commandAlias "manifest" (Just showCommand) showFiles) {
commandCommand = manifestCmd toListManifest
}