projects
/
fgen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
851ea94
)
Simplify get_label() and get_frame_id()
author
Hugo Villeneuve
<hugo@hugovil.com>
Fri, 6 Oct 2023 21:51:42 +0000
(17:51 -0400)
committer
Hugo Villeneuve
<hugo@hugovil.com>
Sat, 7 Oct 2023 15:51:24 +0000
(11:51 -0400)
Remove return values.
fgen.sh
patch
|
blob
|
history
diff --git
a/fgen.sh
b/fgen.sh
index
45b3001
..
6e66b49
100755
(executable)
--- a/
fgen.sh
+++ b/
fgen.sh
@@
-50,27
+50,16
@@
function get_pos()
# Arg1: line
function get_label()
{
# Arg1: line
function get_label()
{
- frame=$(echo "${1}" | ${SED} "s/.*label:\(.*\),geometry.*/\1/g")
-
- if [ x"${frame}" = x"" ]; then
- echo ""
- return 1
- else
- echo "${frame}"
- return 0
- fi
+ local token
+ token=$(echo "${1}" | ${SED} "s/.*label:\(.*\),geometry.*/\1/g")
+ echo "${token}"
}
# Arg1: line
function get_frame_id()
{
frame=$(echo "${1}" | grep -e "label:[0-9]\+," | ${SED} "s/.*label:\([0-9]\+\),.*/\1/g")
}
# Arg1: line
function get_frame_id()
{
frame=$(echo "${1}" | grep -e "label:[0-9]\+," | ${SED} "s/.*label:\([0-9]\+\),.*/\1/g")
-
- if [ x"${frame}" = x"" ]; then
- echo ""
- else
- echo "${frame}"
- fi
+ echo "${frame}"
}
# Arg1: line
}
# Arg1: line