Use truthy in pasta

* Use EXIT_SUCCESS and EXIT_FAILURE macros in truthy for clarity
This commit is contained in:
Dylan Lom 2021-02-23 17:49:52 +11:00
parent ef891d2b66
commit 683ea1a138
2 changed files with 7 additions and 9 deletions

View File

@ -27,11 +27,11 @@ done
name="$1"
[ -z "$name" ] && usage
if [ -z "$concat" ]; then
([ ! -z "$png" ] && import png:- || cat) | \
ssh "$sshdomain" "cat > $destpath/$name"
if truthy "$concat"; then
ssh "$sshdomain" "cat >> $destpath/$name"
else
ssh "$sshdomain" "cat >> $destpath/$name"
(truthy "$png" && import png:- || cat) | \
ssh "$sshdomain" "cat > $destpath/$name"
fi
echo "$destdomain/$name"

View File

@ -23,9 +23,7 @@
const char *argv0;
/*
* Check if s is a valid decimal number.
*/
/* Check if s is a valid decimal number */
bool
isnum(const char *s)
{
@ -63,6 +61,6 @@ main(int argc, char *argv[])
SET_ARGV0();
if (argc < 1 || !truthy(argv[0]))
return 1;
return 0;
return EXIT_FAILURE;
return EXIT_SUCCESS;
}