mirror of https://github.com/dirtbags/moth.git
pointscli no longer fails on success
This commit is contained in:
parent
b8296a5414
commit
0bcfe50137
|
@ -12,7 +12,8 @@ main(int argc, char *argv[])
|
||||||
char comment[512];
|
char comment[512];
|
||||||
|
|
||||||
if (argc != 5) {
|
if (argc != 5) {
|
||||||
fprintf(stderr, "Usage: pointscli TEAM CATEGORY POINTS 'COMMENT'\n");
|
fprintf(stderr,
|
||||||
|
"Usage: pointscli TEAM CATEGORY POINTS 'COMMENT'\n");
|
||||||
return EX_USAGE;
|
return EX_USAGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,6 +27,8 @@ main(int argc, char *argv[])
|
||||||
|
|
||||||
ret = award_points(argv[1], argv[2], points, comment);
|
ret = award_points(argv[1], argv[2], points, comment);
|
||||||
switch (ret) {
|
switch (ret) {
|
||||||
|
case 0:
|
||||||
|
return 0;
|
||||||
case ERR_GENERAL:
|
case ERR_GENERAL:
|
||||||
perror("General error");
|
perror("General error");
|
||||||
return EX_UNAVAILABLE;
|
return EX_UNAVAILABLE;
|
||||||
|
|
|
@ -116,7 +116,7 @@ EOD
|
||||||
fn=$BASE/$hash/$cat.$points
|
fn=$BASE/$hash/$cat.$points
|
||||||
if log $hash | grep -Fxq "$cat $points"; then
|
if log $hash | grep -Fxq "$cat $points"; then
|
||||||
echo "You've already received points for this answer."
|
echo "You've already received points for this answer."
|
||||||
elif pointscli $hash $cat $points p2console; then
|
elif /opt/p2/bin/pointscli $hash $cat $points p2console; then
|
||||||
echo "You get [1m$points[0m more points in the [1m$cat[0m category."
|
echo "You get [1m$points[0m more points in the [1m$cat[0m category."
|
||||||
else
|
else
|
||||||
echo "[1mError recording points. Tell the officials![0m"
|
echo "[1mError recording points. Tell the officials![0m"
|
||||||
|
|
Loading…
Reference in New Issue