some clarification
This commit is contained in:
parent
370857104a
commit
c2c34e0f85
@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
subprogram="$(command -v "$0")"
|
subprogram="$(command -v "$0")"
|
||||||
if ! nonzero "$subprogram" && ! test -e "$0"; then
|
if ! str isvalue "$subprogram" && ! test -e "$0"; then
|
||||||
printf "%s: can't find myself!\n" "$0"
|
printf "%s: can't find myself!\n" "$0"
|
||||||
exit 70 # sysexits(3) EX_SOFTWARE
|
exit 70 # sysexits(3) EX_SOFTWARE
|
||||||
else
|
else
|
||||||
|
@ -22,7 +22,7 @@ emit "$(printf "Current level: %d%%" "$current_level")"
|
|||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
current_level=$(battery)
|
current_level=$(battery)
|
||||||
if ! [ $current_level -eq $previous_level ]; then
|
if ! streq $current_level $previous_level; then
|
||||||
[ $current_level -lt $previous_level ] \
|
[ $current_level -lt $previous_level ] \
|
||||||
&& emit "$(printf "Discharged: %d%% -> %d%%\n" $previous_level $current_level )" \
|
&& emit "$(printf "Discharged: %d%% -> %d%%\n" $previous_level $current_level )" \
|
||||||
|| emit "$(printf " Charged: %d%% -> %d%%\n" $previous_level $current_level )"
|
|| emit "$(printf " Charged: %d%% -> %d%%\n" $previous_level $current_level )"
|
||||||
|
@ -31,6 +31,8 @@ If either could be ignored the individual exit statuses could simply be printed.
|
|||||||
Pscat's function is redundant to the sh(1) construct
|
Pscat's function is redundant to the sh(1) construct
|
||||||
.RB { utility ; utility ;}
|
.RB { utility ; utility ;}
|
||||||
- this is a feature, not a bug.
|
- this is a feature, not a bug.
|
||||||
|
.PP
|
||||||
|
pscat [ cat | cat ] will pipe "pscat [ cat" into "cat ]", which is a potentially unexpected result of a command.
|
||||||
|
|
||||||
.SH COPYRIGHT
|
.SH COPYRIGHT
|
||||||
|
|
||||||
|
@ -44,11 +44,11 @@ check_arg(char **argv){
|
|||||||
return 0; /* syntax error */
|
return 0; /* syntax error */
|
||||||
break;
|
break;
|
||||||
default: /* >= INLPAREN */
|
default: /* >= INLPAREN */
|
||||||
if(SCMPFLAT(*argv, R_PAREN)){
|
if(argv[0][1] == '\0'){
|
||||||
--s;
|
s -= (argv[0][0] == R_PAREN);
|
||||||
terms += s == NORMAL;
|
terms += (argv[0][0] == R_PAREN && s == NORMAL);
|
||||||
}else if(SCMPFLAT(*argv, L_PAREN)) /* ineligant */
|
s += (argv[0][0] == L_PAREN);
|
||||||
++s;
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user