diff options
| author | Mirek Kratochvil <miroslav.kratochvil@uni.lu> | 2025-07-23 11:15:33 +0200 |
|---|---|---|
| committer | Mirek Kratochvil <miroslav.kratochvil@uni.lu> | 2025-07-23 11:18:27 +0200 |
| commit | 8f9677e40fe7e8e23d07da0b06be04ed10d3f649 (patch) | |
| tree | 524b9f7002412481e4c205aa33fc9a31b06374a3 /Opts.hs | |
| parent | b52b106ac50a0100e41843e2bd2edcbb74a10b6e (diff) | |
| download | werge-8f9677e40fe7e8e23d07da0b06be04ed10d3f649.tar.gz werge-8f9677e40fe7e8e23d07da0b06be04ed10d3f649.tar.bz2 | |
improve the patch subcommand a little
closes https://github.com/exaexa/werge/issues/1
Diffstat (limited to 'Opts.hs')
| -rw-r--r-- | Opts.hs | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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" |
