darcs-2.14.1: a distributed, interactive, smart revision control system

Safe HaskellNone
LanguageHaskell2010

Darcs.UI.Flags

Contents

Synopsis

Documentation

data DarcsFlag #

The DarcsFlag type is a list of all flags that can ever be passed to darcs, or to one of its commands.

Instances
Eq DarcsFlag # 
Instance details

Defined in Darcs.UI.Options.Flags

Show DarcsFlag # 
Instance details

Defined in Darcs.UI.Options.Flags

scanKnown :: LookForAdds -> IncludeBoring -> ScanKnown #

Non-trivial interaction between options.

wantGuiPause :: Config -> WantGuiPause #

This will become dis-entangled as soon as we inline these functions.

isInteractive :: Bool -> Config -> Bool #

Non-trivial interaction between options. Explicit -i or -a dominates, else --count, --xml, or --dry-run imply -a, else use the def argument.

willRemoveLogFile :: Config -> Bool #

includeBoring :: Config -> Bool #

setDefault :: Bool -> Config -> SetDefault #

hasXmlOutput :: Config -> Bool #

quiet :: Config -> Bool #

verbose :: Config -> Bool #

enumeratePatches :: Config -> Bool #

fixRemoteRepos :: AbsolutePath -> Config -> IO Config #

Ugly. The alternative is to put the remoteRepos accessor into the IO monad, which is hardly better.

fixUrl :: AbsolutePath -> String -> IO String #

fixUrl takes a String that may be a file path or a URL. It returns either the URL, or an absolute version of the path.

fixSubPaths :: (AbsolutePath, AbsolutePath) -> [FilePath] -> IO [SubPath] #

fixSubPaths is a variant of maybeFixSubPaths that throws out non-repository paths and duplicates from the result. See there for details. TODO: why filter out null paths from the input? why here and not in maybeFixSubPaths?

maybeFixSubPaths :: (AbsolutePath, AbsolutePath) -> [FilePath] -> IO [Maybe SubPath] #

maybeFixSubPaths (repo_path, orig_path) file_paths tries to turn file_paths into SubPaths, taking into account the repository path and the original path from which darcs was invoked.

A SubPath is a path under (or inside) the repo path. This does not mean it must exist as a file or directory, nor that the path has been added to the repository; it merely means that it could be added.

When converting a relative path to an absolute one, this function first tries to interpret the relative path with respect to the current working directory. If that fails, it tries to interpret it with respect to the repository directory. Only when that fails does it put a Nothing in the result at the position of the path that cannot be converted.

It is intended for validating file arguments to darcs commands.

getRepourl :: Config -> Maybe String #

getRepourl takes a list of flags and returns the url of the repository specified by Repodir "directory" in that list of flags, if any. This flag is present if darcs was invoked with --repodir=DIRECTORY

getAuthor :: Maybe String -> Bool -> IO String #

getAuthor takes a list of flags and returns the author of the change specified by Author "Leo Tolstoy" in that list of flags, if any. Otherwise, if Pipe is present, asks the user who is the author and returns the answer. If neither are present, try to guess the author, from repository or global preference files or environment variables, and if it's not possible, ask the user.

promptAuthor :: Bool -> Bool -> IO String #

promptAuthor try to guess the author, from repository or global preference files or environment variables, and if it's not possible or alwaysAsk parameter is true, ask the user. If store parameter is true, the new author is added into _darcs/prefs.

getEasyAuthor :: IO [String] #

getEasyAuthor tries to get the author name first from the repository preferences, then from global preferences, then from environment variables. Returns [] if it could not get it. Note that it may only return multiple possibilities when reading from global preferences

getSendmailCmd :: Config -> IO String #

getSendmailCmd takes a list of flags and returns the sendmail command to be used by darcs send. Looks for a command specified by SendmailCmd "command" in that list of flags, if any. This flag is present if darcs was invoked with --sendmail-command=COMMAND Alternatively the user can set $SENDMAIL which will be used as a fallback if present.

getSubject :: Config -> Maybe String #

getSubject takes a list of flags and returns the subject of the mail to be sent by darcs send. Looks for a subject specified by Subject "subject" in that list of flags, if any. This flag is present if darcs was invoked with --subject=SUBJECT

getInReplyTo :: Config -> Maybe String #

getCc :: Config -> String #

getCc takes a list of flags and returns the addresses to send a copy of the patch bundle to when using darcs send. looks for a cc address specified by Cc "address" in that list of flags. Returns the addresses as a comma separated string.

getOutput :: Config -> FilePath -> Maybe AbsolutePathOrStd #

Accessor for output option

Re-exports

maxCount :: PrimDarcsOption (Maybe Int) #

TODO: Returning -1 if the argument cannot be parsed as an integer is not something I expected to find in a Haskell program. Instead, the flag should take either a plain String argument (leaving it to a later stage to parse the String to an Int), or else a Maybe Int, taking the possibility of a failed parse into account.

matchAny :: MatchOption #

onlyToFiles :: PrimDarcsOption Bool #

TODO: see issue2395

dryRun :: PrimDarcsOption DryRun #

TODO someone wrote here long ago that any time --dry-run is a possibility automated users should be able to examine the results more easily with --xml. See also issue2397. dryRun w/o xml is currently used in add, pull, and repair.