aboutsummaryrefslogtreecommitdiff
path: root/Opts.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Opts.hs')
-rw-r--r--Opts.hs12
1 files changed, 10 insertions, 2 deletions
diff --git a/Opts.hs b/Opts.hs
index 94b0065..fdded5a 100644
--- a/Opts.hs
+++ b/Opts.hs
@@ -229,7 +229,7 @@ data Command
, diffUnified :: Maybe Int
}
| CmdPatch
- { patchMy :: FilePath
+ { patchTarget :: Maybe FilePath
, patchInput :: Maybe FilePath
}
| CmdBreak
@@ -295,7 +295,15 @@ cmdDiff = do
cmdPatch :: Parser Command
cmdPatch = do
- patchMy <- strArgument $ metavar "MYFILE" <> help "File to be modified"
+ patchTarget <-
+ asum
+ [ Just <$> strArgument (metavar "MYFILE" <> help "File to be patched")
+ , flag' Nothing
+ $ long "format"
+ <> short 'f'
+ <> help
+ "Do not patch anything, only format the patch using conflict marks on joined tokens"
+ ]
patchInput <-
optional . strOption
$ long "patch"