Mercurial > hg > toybox
comparison toys/pending/test.c @ 832:75526930cdd7
Add help text for pending test command. (No actual implementation yet.)
author | Rob Landley <rob@landley.net> |
---|---|
date | Tue, 26 Mar 2013 22:31:10 -0500 |
parents | |
children | 9927d1d1e7e2 |
comparison
equal
deleted
inserted
replaced
831:4b9b7c9a194f | 832:75526930cdd7 |
---|---|
1 /* test.c - evaluate expression | |
2 * | |
3 * Copyright 2013 Rob Landley <rob@landley.net> | |
4 * | |
5 * See http://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html | |
6 | |
7 USE_TEST(NEWTOY(test, NULL, TOYFLAG_USR|TOYFLAG_BIN)) | |
8 | |
9 config TEST | |
10 bool "test" | |
11 default n | |
12 help | |
13 usage: test [-bcdefghLPrSsuwx PATH] [-nz STRING] [-t FD] [X ?? Y] | |
14 | |
15 Return true or false by performing tests. (With no arguments return false.) | |
16 | |
17 --- Tests with a single argument (after the option): | |
18 PATH is/has: | |
19 -b block device -f regular file -p fifo -u setuid bit | |
20 -c char device -g setgid -r read bit -w write bit | |
21 -d directory -h symlink -S socket -x execute bit | |
22 -e exists -L symlink -s nonzero size | |
23 STRING is: | |
24 -n nonzero size -z zero size (STRING by itself implies -n) | |
25 FD (integer file descriptor) is: | |
26 -t a TTY | |
27 | |
28 --- Tests with one argument on each side of an operator: | |
29 Two strings: | |
30 = are identical != differ | |
31 Two integers: | |
32 -eq equal -gt first > second -lt first < second | |
33 -ne not equal -ge first >= second -le first <= second | |
34 | |
35 --- Modify or combine tests: | |
36 ! EXPR not (swap true/false) EXPR -a EXPR and (are both true) | |
37 ( EXPR ) evaluate this first EXPR -o EXPR or (is either true) | |
38 */ | |
39 | |
40 #include "toys.h" | |
41 | |
42 void test_main(void) | |
43 { | |
44 return; | |
45 } |