aboutsummaryrefslogtreecommitdiff
path: root/toys/pending/test.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2013-03-26 22:31:10 -0500
committerRob Landley <rob@landley.net>2013-03-26 22:31:10 -0500
commit94c95594994b10e3452c4c3e9b238e2364f981a3 (patch)
tree2d31fed7566135f495557ef1d299dbf7a1520abd /toys/pending/test.c
parentf5b4bbef5f186aa705d961c62817eab388f1c13e (diff)
downloadtoybox-94c95594994b10e3452c4c3e9b238e2364f981a3.tar.gz
Add help text for pending test command. (No actual implementation yet.)
Diffstat (limited to 'toys/pending/test.c')
-rw-r--r--toys/pending/test.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/toys/pending/test.c b/toys/pending/test.c
new file mode 100644
index 00000000..481eaec4
--- /dev/null
+++ b/toys/pending/test.c
@@ -0,0 +1,45 @@
+/* test.c - evaluate expression
+ *
+ * Copyright 2013 Rob Landley <rob@landley.net>
+ *
+ * See http://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html
+
+USE_TEST(NEWTOY(test, NULL, TOYFLAG_USR|TOYFLAG_BIN))
+
+config TEST
+ bool "test"
+ default n
+ help
+ usage: test [-bcdefghLPrSsuwx PATH] [-nz STRING] [-t FD] [X ?? Y]
+
+ Return true or false by performing tests. (With no arguments return false.)
+
+ --- Tests with a single argument (after the option):
+ PATH is/has:
+ -b block device -f regular file -p fifo -u setuid bit
+ -c char device -g setgid -r read bit -w write bit
+ -d directory -h symlink -S socket -x execute bit
+ -e exists -L symlink -s nonzero size
+ STRING is:
+ -n nonzero size -z zero size (STRING by itself implies -n)
+ FD (integer file descriptor) is:
+ -t a TTY
+
+ --- Tests with one argument on each side of an operator:
+ Two strings:
+ = are identical != differ
+ Two integers:
+ -eq equal -gt first > second -lt first < second
+ -ne not equal -ge first >= second -le first <= second
+
+ --- Modify or combine tests:
+ ! EXPR not (swap true/false) EXPR -a EXPR and (are both true)
+ ( EXPR ) evaluate this first EXPR -o EXPR or (is either true)
+*/
+
+#include "toys.h"
+
+void test_main(void)
+{
+ return;
+}