This repository has been archived on 2024-06-20. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
coffee.pygments/tests/examplefiles/execline/example.exec
Oleh Prypin 6f43092173
Also add auto-updatable output-based tests to examplefiles (#1689)
Co-authored-by: Georg Brandl <georg@python.org>
2021-01-20 10:48:45 +01:00

37 lines
773 B
Text

#!/usr/bin/execlineb
importas -iu SPEC 1
shift
elgetpositionals
ifelse -nX {
heredoc -d 0 ${SPEC}
s6-grep -qE "^([[:alpha:]]+(_[[:digit:]]+)?/)*([[:alpha:]]+(_[[:digit:]]+)?):[[:digit:]]+$"
} {
foreground {
fdmove 1 2
echo "Bad argument"
}
exit 1
}
multidefine -0d: ${SPEC} { QUEUESPEC THREADSPEC }
define -s -d/ QUEUELIST ${QUEUESPEC}
backtick -ni CMDLINE {
forx -o0 QUEUEPAT { ${QUEUELIST} }
importas -i Q QUEUEPAT
ifelse -X {
heredoc -d 0 ${Q}
s6-grep -qE "^[[:alpha:]]+_[[:digit:]]+$"
} {
multidefine -0d_ ${Q} { QNAM QPRIO }
echo -n "-q ${QNAM},${QPRIO} "
}
echo -n "-q ${Q} "
}
importas -ui CMDLINE CMDLINE
define -s -d" " ARGS ${CMDLINE}
${@} ${ARGS} -c ${THREADSPEC}