Skip to content

Commit

Permalink
Commit for creating tag v0.0.45
Browse files Browse the repository at this point in the history
  • Loading branch information
jfgiraud committed Nov 24, 2023
1 parent 556b9c9 commit aa678ba
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 23 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# CHANGELOG

## 0.0.45 (2023-11-24)
* qaj: escape &/ in -A, -B and -j options
* uq

## 0.0.44 (2023-04-21)
* Add -v option to display version
10 changes: 5 additions & 5 deletions bin/qaj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
function usage() {
(cat <<-EOF
#BEGIN_DO_NOT_MODIFY:make update-doc
QAJ(1) User commands QAJ(1)
QAJ(1) User commands QAJ(1)
NAME
qaj - quote and join words or lines in files
Expand Down Expand Up @@ -146,10 +146,10 @@ AUTHOR
Written by Jean-François Giraud.
COPYRIGHT
Copyright © 2023 Jean-François Giraud. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. 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 <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the
extent permitted by law.
quote-and-join 0.0.44 2023-04-21 QAJ(1)
quote-and-join 0.0.45 2023-04-21 QAJ(1)
#END_DO_NOT_MODIFY:make update-doc
EOF
) | awk '/#BEGIN_DO_NOT_MODIFY:make update-doc/,/^#END_DO_NOT_MODIFY:make update-doc/' | awk '/NAME/,/AUTHOR/' | tail -n +1 | head -n -1
Expand Down Expand Up @@ -315,7 +315,7 @@ function mysort() {
}

function escaped_replacement() {
echo "$1" # | sed 's/[&/\]/\\&/g'
echo "$1" | sed 's/[&/]/\\&/g'
}

before_escaped=$(escaped_replacement "${before}")
Expand Down
10 changes: 5 additions & 5 deletions bin/uqaj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
function usage() {
(cat <<-EOF
#BEGIN_DO_NOT_MODIFY:make update-doc
UQAJ(1) User commands UQAJ(1)
UQAJ(1) User commands UQAJ(1)
NAME
uqaj - split and unquote lines in files
Expand Down Expand Up @@ -93,10 +93,10 @@ AUTHOR
Written by Jean-François Giraud.
COPYRIGHT
Copyright © 2023 Jean-François Giraud. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. 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 <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the
extent permitted by law.
quote-and-join 0.0.44 2023-04-21 UQAJ(1)
quote-and-join 0.0.45 2023-04-21 UQAJ(1)
#END_DO_NOT_MODIFY:make update-doc
EOF
) | awk '/#BEGIN_DO_NOT_MODIFY:make update-doc/,/^#END_DO_NOT_MODIFY:make update-doc/' | awk '/NAME/,/AUTHOR/' | tail -n +1 | head -n -1
Expand Down Expand Up @@ -227,7 +227,7 @@ while [[ -n "$file" ]];
do
cat "$file" | sed -ze "s/${right_escaped}${trim}${join_escaped}${trim}${left_escaped}/${right_replacement}\n${left_replacement}/g" \
| sed -ze "1s/^${trim}${before_escaped}${trim}${left_escaped}/${left_replacement}/" \
| sed -ze "\$s/${right_escaped}${trim}${after_escaped}${trim}/${right_replacement}/" \
| sed -ze "\$s/${right_escaped}${trim}${after_escaped}${trim}$/${right_replacement}/" \
| sed -e "s/^${left_trim}${left_escaped}//" -e "s/${right_escaped}${right_trim}$//"
shift
file="$1"
Expand Down
2 changes: 1 addition & 1 deletion doc/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.44
0.0.45
4 changes: 2 additions & 2 deletions doc/generated/man/man1/qaj.1
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
.\" Generator: Asciidoctor 1.5.5
.\" Date: 2023-04-21
.\" Manual: User commands
.\" Source: quote-and-join 0.0.44
.\" Source: quote-and-join 0.0.45
.\" Language: English
.\"
.TH "QAJ" "1" "2023-04-21" "quote\-and\-join 0.0.44" "User commands"
.TH "QAJ" "1" "2023-04-21" "quote\-and\-join 0.0.45" "User commands"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
Expand Down
4 changes: 2 additions & 2 deletions doc/generated/man/man1/uqaj.1
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
.\" Generator: Asciidoctor 1.5.5
.\" Date: 2023-04-21
.\" Manual: User commands
.\" Source: quote-and-join 0.0.44
.\" Source: quote-and-join 0.0.45
.\" Language: English
.\"
.TH "UQAJ" "1" "2023-04-21" "quote\-and\-join 0.0.44" "User commands"
.TH "UQAJ" "1" "2023-04-21" "quote\-and\-join 0.0.45" "User commands"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
Expand Down
8 changes: 4 additions & 4 deletions doc/generated/txt/qaj.1.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
QAJ(1) User commands QAJ(1)
QAJ(1) User commands QAJ(1)

NAME
qaj - quote and join words or lines in files
Expand Down Expand Up @@ -140,7 +140,7 @@ AUTHOR
Written by Jean-François Giraud.

COPYRIGHT
Copyright © 2023 Jean-François Giraud. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. 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 <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the
extent permitted by law.

quote-and-join 0.0.44 2023-04-21 QAJ(1)
quote-and-join 0.0.45 2023-04-21 QAJ(1)
8 changes: 4 additions & 4 deletions doc/generated/txt/uqaj.1.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
UQAJ(1) User commands UQAJ(1)
UQAJ(1) User commands UQAJ(1)

NAME
uqaj - split and unquote lines in files
Expand Down Expand Up @@ -88,7 +88,7 @@ AUTHOR
Written by Jean-François Giraud.

COPYRIGHT
Copyright © 2023 Jean-François Giraud. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. 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 <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the
extent permitted by law.

quote-and-join 0.0.44 2023-04-21 UQAJ(1)
quote-and-join 0.0.45 2023-04-21 UQAJ(1)
4 changes: 4 additions & 0 deletions tests/qaj_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ assert_exec_equals \
'printf "a\nb\nc\n" | ../bin/qaj -P"[" -j",\n" -qq' \
$'["a",\n"b",\n"c"]'

assert_exec_equals \
'printf "a\nb\nc\n" | ../bin/qaj -A"/*" -B"*/" -a"/*" -b"*/" -j",\n"' \
$'/*/*a*/,\n/*b*/,\n/*c*/*/'

echo "${ok}/${total} (${ko} errors)"

if [[ ${ok} -ne ${total} ]]; then
Expand Down
4 changes: 4 additions & 0 deletions tests/uqaj_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ assert_exec_equals \
'printf "[\"a\",\n\"b\",\n\"c\"\n]" | ../bin/uqaj -P"[" -j",\n" -qq' \
$'a\nb\nc'

assert_exec_equals \
'printf "/*/*a*/,\n/*b*/,\n/*c*/*/" | ../bin/uqaj -A"/*" -B"*/" -a"/*" -b"*/" -j",\n"' \
$'a\nb\nc'

echo "${ok}/${total} (${ko} errors)"

if [[ ${ok} -ne ${total} ]]; then
Expand Down

0 comments on commit aa678ba

Please sign in to comment.