module Darcs.UI.Commands.ShowBug ( showBug ) where
import Prelude ()
import Darcs.Prelude
import Darcs.UI.Commands ( DarcsCommand(..), withStdOpts, nodefaults, findRepository )
import Darcs.UI.Flags ( DarcsFlag )
import Darcs.UI.Options ( DarcsOption, oid, odesc, ocheck, onormalise, defaultFlags )
import qualified Darcs.UI.Options.All as O ( workingRepoDir, StdCmdAction, Verbosity, UseCache )
import Darcs.Util.Path ( AbsolutePath )
#include "impossible.h"
showBugDescription :: String
showBugDescription = "Simulate a run-time failure."
showBugHelp :: String
showBugHelp =
"Show bug can be used to see what darcs would show you if you encountered.\n"
++"a bug in darcs.\n"
showBugBasicOpts :: DarcsOption a (Maybe String -> a)
showBugBasicOpts = O.workingRepoDir
showBugOpts :: DarcsOption a
(Maybe String
-> Maybe O.StdCmdAction
-> Bool
-> Bool
-> O.Verbosity
-> Bool
-> O.UseCache
-> Maybe String
-> Bool
-> Maybe String
-> Bool
-> a)
showBugOpts = showBugBasicOpts `withStdOpts` oid
showBug :: DarcsCommand [DarcsFlag]
showBug = DarcsCommand
{ commandProgramName = "darcs"
, commandName = "bug"
, commandHelp = showBugHelp
, commandDescription = showBugDescription
, commandExtraArgs = 0
, commandExtraArgHelp = []
, commandCommand = showBugCmd
, commandPrereq = findRepository
, commandGetArgPossibilities = return []
, commandArgdefaults = nodefaults
, commandAdvancedOptions = []
, commandBasicOptions = odesc showBugBasicOpts
, commandDefaults = defaultFlags showBugOpts
, commandCheckOptions = ocheck showBugOpts
, commandParseOptions = onormalise showBugOpts
}
showBugCmd :: (AbsolutePath, AbsolutePath) -> [DarcsFlag] -> [String] -> IO ()
showBugCmd _ _ _ = bug "This is actually a fake bug in darcs."