1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-06-25 16:57:12 -07:00

clean up separator-printing code

This commit is contained in:
Connor Olding 2017-05-17 20:11:23 +00:00
parent 3dbecd2fc2
commit 719ff3374b

View File

@ -68,19 +68,23 @@ compile() {
fi
fi
local once=0
printsep() {
[ $once -eq 1 ] && echo -n "|" >&2 || once=1
}
if [ $# -lt 2 ]; then
echo -n "usage: compile [" >&2
local once=0
if [ -n "$clang" ]; then
if [ $once -eq 1 ]; then echo -n "|" >&2; fi; once=1
printsep
echo -n "clang" >&2
fi
if [ -n "$gcc" ]; then
if [ $once -eq 1 ]; then echo -n "|" >&2; fi; once=1
printsep
echo -n "gcc" >&2
fi
if [ -n "$cl" ]; then
if [ $once -eq 1 ]; then echo -n "|" >&2; fi; once=1
printsep
echo -n "msvc" >&2
fi
echo "] {debug|derelease|release|hardened} [flags...] {source file}" >&2