mirror of
https://github.com/notwa/rc
synced 2025-03-19 08:05:36 -07:00
clean up separator-printing code
This commit is contained in:
parent
3dbecd2fc2
commit
719ff3374b
1 changed files with 8 additions and 4 deletions
12
sh/compile
12
sh/compile
|
@ -68,19 +68,23 @@ compile() {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
local once=0
|
||||||
|
printsep() {
|
||||||
|
[ $once -eq 1 ] && echo -n "|" >&2 || once=1
|
||||||
|
}
|
||||||
|
|
||||||
if [ $# -lt 2 ]; then
|
if [ $# -lt 2 ]; then
|
||||||
echo -n "usage: compile [" >&2
|
echo -n "usage: compile [" >&2
|
||||||
local once=0
|
|
||||||
if [ -n "$clang" ]; then
|
if [ -n "$clang" ]; then
|
||||||
if [ $once -eq 1 ]; then echo -n "|" >&2; fi; once=1
|
printsep
|
||||||
echo -n "clang" >&2
|
echo -n "clang" >&2
|
||||||
fi
|
fi
|
||||||
if [ -n "$gcc" ]; then
|
if [ -n "$gcc" ]; then
|
||||||
if [ $once -eq 1 ]; then echo -n "|" >&2; fi; once=1
|
printsep
|
||||||
echo -n "gcc" >&2
|
echo -n "gcc" >&2
|
||||||
fi
|
fi
|
||||||
if [ -n "$cl" ]; then
|
if [ -n "$cl" ]; then
|
||||||
if [ $once -eq 1 ]; then echo -n "|" >&2; fi; once=1
|
printsep
|
||||||
echo -n "msvc" >&2
|
echo -n "msvc" >&2
|
||||||
fi
|
fi
|
||||||
echo "] {debug|derelease|release|hardened} [flags...] {source file}" >&2
|
echo "] {debug|derelease|release|hardened} [flags...] {source file}" >&2
|
||||||
|
|
Loading…
Add table
Reference in a new issue