patch: use options instead of redirection (#22956)

Co-authored-by: Lena Pastwa <lena@lnps.me>
This commit is contained in:
Managor
2026-06-29 07:18:18 +03:00
committed by GitHub
parent c87f0315c7
commit ec85fc6e6b
+5 -5
View File
@@ -6,20 +6,20 @@
- Apply a patch using a diff file (filenames must be included in the diff file):
`patch < {{patch.diff}}`
`patch {{[-i|--input]}} {{patch.diff}}`
- Apply a patch to a specific file:
`patch < {{patch.diff}} {{path/to/file}}`
`patch {{[-i|--input]}} {{patch.diff}} {{path/to/file}}`
- Patch a file writing the result to a different file:
`patch < {{patch.diff}} {{path/to/input_file}} {{[-o|--output]}} {{path/to/output_file}}`
`patch {{[-i|--input]}} {{patch.diff}} {{path/to/input_file}} {{[-o|--output]}} {{path/to/output_file}}`
- Apply a patch to the current directory:
`patch < {{patch.diff}} {{[-p|--strip]}} 1`
`patch {{[-i|--input]}} {{patch.diff}} {{[-p|--strip]}} 1`
- Apply the reverse of a patch:
`patch < {{patch.diff}} {{[-R|--reverse]}}`
`patch {{[-i|--input]}} {{patch.diff}} {{[-R|--reverse]}}`