From 0a2cbe3ff178daa45e31ceafef0f8db224799218 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Giraud?= Date: Wed, 6 Dec 2023 16:09:07 +0100 Subject: [PATCH] Commit for creating tag v0.0.14 --- CHANGELOG.md | 3 +++ README.md | 7 +++--- bin/rbt | 34 ++++++++++++++++------------ doc/VERSION | 2 +- doc/generated/man/man1/rbt.1 | 44 ++++++++++++++++++++++-------------- doc/generated/md/rbt.md | 27 ++++++++++++++-------- doc/generated/txt/rbt.1.txt | 34 ++++++++++++++++------------ 7 files changed, 92 insertions(+), 59 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80022b9..88e7d7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # CHANGELOG +## 0.0.14 (2023-12-06) +* Add comment/uncomment feature + ## 0.0.13 (2023-10-23) * Documentation diff --git a/README.md b/README.md index 461cdfd..9f955cc 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Usage Examples ======== -**Replace between tags using stdout (`-s` option).** +**Replace between strings using stdout (`-s` option).** $ cat /tmp/lorem_ipsum Lorem ipsum dolor sit amet, consectetur adipiscing elit. *BEGIN*Pellentesque maximus faucibus lectus, in ultricies lorem volutpat in. @@ -48,7 +48,8 @@ Examples Lorem ipsum dolor sit amet, consectetur adipiscing elit. *BEGIN*new text here *END*Cras rhoncus aliquam tristique. -**Replace infile between tags and delete begin/end tags (`-d` option).** +**Replace infile between strings and delete begin/end strings (`-d` +option).** $ cat /tmp/lorem_ipsum Lorem ipsum dolor sit amet, consectetur adipiscing elit. *BEGIN*Pellentesque maximus faucibus lectus, in ultricies lorem volutpat in. @@ -62,7 +63,7 @@ Examples Lorem ipsum dolor sit amet, consectetur adipiscing elit. new text here Cras rhoncus aliquam tristique. -**Replace in file using the content of a file.** +**Replace in file using the content of a file (`-R` option).** $ cat x Lorem ipsum dolor sit amet, consectetur adipiscing elit. *BEGIN*Pellentesque maximus faucibus lectus, in ultricies lorem volutpat in. diff --git a/bin/rbt b/bin/rbt index 2819890..ea49d3c 100755 --- a/bin/rbt +++ b/bin/rbt @@ -14,7 +14,7 @@ import stat simulate = False _USAGE = '''#BEGIN_DO_NOT_MODIFY:make update-doc -RBT(1) User commands RBT(1) +RBT(1) User commands RBT(1) NAME rbt - Replace the text between begin and end tags @@ -29,10 +29,19 @@ DESCRIPTION OPTIONS -b string, --begin-string string - The begin tag to search. + The begin string to search. + + -d, --delete + Delete begin/end strings after replacing. + + -D, --dos + Use Dos/Windows line ending characters. -e string, --end-string string - The end tag to search. + The end string to search. + + -h + Display help. -r string, --replace string The string used to replace. @@ -43,17 +52,14 @@ OPTIONS -s, --simulate Force output to STDOUT. - -d, --delete - Delete begin/end tags after replacing. - - -h - Display help. + -U, --unix + Use Unix line ending character. -v Display version. EXAMPLES - Replace between tags using stdout (-s option) + Replace between strings using stdout (-s option) $ cat /tmp/lorem_ipsum Lorem ipsum dolor sit amet, consectetur adipiscing elit. *BEGIN*Pellentesque maximus faucibus lectus, in ultricies lorem volutpat in. @@ -65,7 +71,7 @@ EXAMPLES Lorem ipsum dolor sit amet, consectetur adipiscing elit. *BEGIN*new text here *END*Cras rhoncus aliquam tristique. - Replace infile between tags and delete begin/end tags (-d option) + Replace infile between strings and delete begin/end strings (-d option) $ cat /tmp/lorem_ipsum Lorem ipsum dolor sit amet, consectetur adipiscing elit. *BEGIN*Pellentesque maximus faucibus lectus, in ultricies lorem volutpat in. @@ -79,7 +85,7 @@ EXAMPLES Lorem ipsum dolor sit amet, consectetur adipiscing elit. new text here Cras rhoncus aliquam tristique. - Replace in file using the content of a file + Replace in file using the content of a file (-R option) $ cat x Lorem ipsum dolor sit amet, consectetur adipiscing elit. *BEGIN*Pellentesque maximus faucibus lectus, in ultricies lorem volutpat in. @@ -99,10 +105,10 @@ AUTHOR Written by Jean-François Giraud. COPYRIGHT - Copyright © 2023 Jean-François Giraud. License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the - extent permitted by law. + Copyright © 2023 Jean-François Giraud. License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO + WARRANTY, to the extent permitted by law. -replace-between-tags 0.0.13 2023-10-23 RBT(1) +replace-between-tags 0.0.14 2023-12-06 RBT(1) #END_DO_NOT_MODIFY:make update-doc ''' diff --git a/doc/VERSION b/doc/VERSION index 43b2961..9789c4c 100644 --- a/doc/VERSION +++ b/doc/VERSION @@ -1 +1 @@ -0.0.13 +0.0.14 diff --git a/doc/generated/man/man1/rbt.1 b/doc/generated/man/man1/rbt.1 index ffa5df8..7510a81 100644 --- a/doc/generated/man/man1/rbt.1 +++ b/doc/generated/man/man1/rbt.1 @@ -2,12 +2,12 @@ .\" Title: rbt .\" Author: [see the "AUTHORS" section] .\" Generator: Asciidoctor 1.5.5 -.\" Date: 2023-10-23 +.\" Date: 2023-12-06 .\" Manual: User commands -.\" Source: replace-between-tags 0.0.13 +.\" Source: replace-between-tags 0.0.14 .\" Language: English .\" -.TH "RBT" "1" "2023-10-23" "replace\-between\-tags 0.0.13" "User commands" +.TH "RBT" "1" "2023-12-06" "replace\-between\-tags 0.0.14" "User commands" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 @@ -30,14 +30,29 @@ rbt \- Replace the text between begin and end tags With no FILE, or when FILE is \f[CR]\-\fP, read standard input. .SH "OPTIONS" .sp -\fB\-b\fP \fIstring\fP, \fB\-\-begin\-tag\fP \fIstring\fP +\fB\-b\fP \fIstring\fP, \fB\-\-begin\-string\fP \fIstring\fP .RS 4 -The begin tag to search. +The begin string to search. .RE .sp -\fB\-e\fP \fIstring\fP, \fB\-\-end\-tag\fP \fIstring\fP +\fB\-d\fP, \fB\-\-delete\fP +.RS 4 +Delete begin/end strings after replacing. +.RE +.sp +\fB\-D\fP, \fB\-\-dos\fP +.RS 4 +Use Dos/Windows line ending characters. +.RE +.sp +\fB\-e\fP \fIstring\fP, \fB\-\-end\-string\fP \fIstring\fP +.RS 4 +The end string to search. +.RE +.sp +\fB\-h\fP .RS 4 -The end tag to search. +Display help. .RE .sp \fB\-r\fP \fIstring\fP, \fB\-\-replace\fP \fIstring\fP @@ -55,14 +70,9 @@ The file used to replace. Force output to STDOUT. .RE .sp -\fB\-d\fP, \fB\-\-delete\fP +\fB\-U\fP, \fB\-\-unix\fP .RS 4 -Delete begin/end tags after replacing. -.RE -.sp -\fB\-h\fP -.RS 4 -Display help. +Use Unix line ending character. .RE .sp \fB\-v\fP @@ -71,7 +81,7 @@ Display version. .RE .SH "EXAMPLES" .sp -.B Replace between tags using stdout (\f[CR]\-s\fP option) +.B Replace between strings using stdout (\f[CR]\-s\fP option) .br .sp .if n \{\ @@ -92,7 +102,7 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. *BEGIN*new text here .RE .\} .sp -.B Replace infile between tags and delete begin/end tags (\f[CR]\-d\fP option) +.B Replace infile between strings and delete begin/end strings (\f[CR]\-d\fP option) .br .sp .if n \{\ @@ -115,7 +125,7 @@ Cras rhoncus aliquam tristique. .RE .\} .sp -.B Replace in file using the content of a file +.B Replace in file using the content of a file (\f[CR]\-R\fP option) .br .sp .if n \{\ diff --git a/doc/generated/md/rbt.md b/doc/generated/md/rbt.md index 9d6df89..9bf0d84 100644 --- a/doc/generated/md/rbt.md +++ b/doc/generated/md/rbt.md @@ -20,10 +20,19 @@ OPTIONS ======= **-b** *string*, **--begin-string** *string* -The begin tag to search. +The begin string to search. + +**-d**, **--delete** +Delete begin/end strings after replacing. + +**-D**, **--dos** +Use Dos/Windows line ending characters. **-e** *string*, **--end-string** *string* -The end tag to search. +The end string to search. + +**-h** +Display help. **-r** *string*, **--replace** *string* The string used to replace. @@ -34,11 +43,8 @@ The file used to replace. **-s**, **--simulate** Force output to STDOUT. -**-d**, **--delete** -Delete begin/end tags after replacing. - -**-h** -Display help. +**-U**, **--unix** +Use Unix line ending character. **-v** Display version. @@ -46,7 +52,7 @@ Display version. EXAMPLES ======== -**Replace between tags using stdout (`-s` option).** +**Replace between strings using stdout (`-s` option).** $ cat /tmp/lorem_ipsum Lorem ipsum dolor sit amet, consectetur adipiscing elit. *BEGIN*Pellentesque maximus faucibus lectus, in ultricies lorem volutpat in. @@ -58,7 +64,8 @@ EXAMPLES Lorem ipsum dolor sit amet, consectetur adipiscing elit. *BEGIN*new text here *END*Cras rhoncus aliquam tristique. -**Replace infile between tags and delete begin/end tags (`-d` option).** +**Replace infile between strings and delete begin/end strings (`-d` +option).** $ cat /tmp/lorem_ipsum Lorem ipsum dolor sit amet, consectetur adipiscing elit. *BEGIN*Pellentesque maximus faucibus lectus, in ultricies lorem volutpat in. @@ -72,7 +79,7 @@ EXAMPLES Lorem ipsum dolor sit amet, consectetur adipiscing elit. new text here Cras rhoncus aliquam tristique. -**Replace in file using the content of a file.** +**Replace in file using the content of a file (`-R` option).** $ cat x Lorem ipsum dolor sit amet, consectetur adipiscing elit. *BEGIN*Pellentesque maximus faucibus lectus, in ultricies lorem volutpat in. diff --git a/doc/generated/txt/rbt.1.txt b/doc/generated/txt/rbt.1.txt index 19ae05e..dc2be6c 100644 --- a/doc/generated/txt/rbt.1.txt +++ b/doc/generated/txt/rbt.1.txt @@ -1,4 +1,4 @@ -RBT(1) User commands RBT(1) +RBT(1) User commands RBT(1) NAME rbt - Replace the text between begin and end tags @@ -13,10 +13,19 @@ DESCRIPTION OPTIONS -b string, --begin-string string - The begin tag to search. + The begin string to search. + + -d, --delete + Delete begin/end strings after replacing. + + -D, --dos + Use Dos/Windows line ending characters. -e string, --end-string string - The end tag to search. + The end string to search. + + -h + Display help. -r string, --replace string The string used to replace. @@ -27,17 +36,14 @@ OPTIONS -s, --simulate Force output to STDOUT. - -d, --delete - Delete begin/end tags after replacing. - - -h - Display help. + -U, --unix + Use Unix line ending character. -v Display version. EXAMPLES - Replace between tags using stdout (-s option) + Replace between strings using stdout (-s option) $ cat /tmp/lorem_ipsum Lorem ipsum dolor sit amet, consectetur adipiscing elit. *BEGIN*Pellentesque maximus faucibus lectus, in ultricies lorem volutpat in. @@ -49,7 +55,7 @@ EXAMPLES Lorem ipsum dolor sit amet, consectetur adipiscing elit. *BEGIN*new text here *END*Cras rhoncus aliquam tristique. - Replace infile between tags and delete begin/end tags (-d option) + Replace infile between strings and delete begin/end strings (-d option) $ cat /tmp/lorem_ipsum Lorem ipsum dolor sit amet, consectetur adipiscing elit. *BEGIN*Pellentesque maximus faucibus lectus, in ultricies lorem volutpat in. @@ -63,7 +69,7 @@ EXAMPLES Lorem ipsum dolor sit amet, consectetur adipiscing elit. new text here Cras rhoncus aliquam tristique. - Replace in file using the content of a file + Replace in file using the content of a file (-R option) $ cat x Lorem ipsum dolor sit amet, consectetur adipiscing elit. *BEGIN*Pellentesque maximus faucibus lectus, in ultricies lorem volutpat in. @@ -83,7 +89,7 @@ AUTHOR Written by Jean-François Giraud. COPYRIGHT - Copyright © 2023 Jean-François Giraud. License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the - extent permitted by law. + Copyright © 2023 Jean-François Giraud. License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO + WARRANTY, to the extent permitted by law. -replace-between-tags 0.0.13 2023-10-23 RBT(1) +replace-between-tags 0.0.14 2023-12-06 RBT(1)