Add true and false.

This commit is contained in:
Rob Landley 2007-04-30 00:08:48 -04:00
parent 0c93f6c7ab
commit f2ccc2d1d6
4 changed files with 37 additions and 0 deletions

View File

@ -77,6 +77,13 @@ config ECHO
\r carriage return
\t horizontal tab
\v vertical tab
config FALSE
bool "false"
default n
help
Return nonzero.
config HELLO
bool "hello"
default n
@ -350,6 +357,12 @@ config TOYSH_BUILTINS
Adds the commands exec, fg, bg, help, jobs, pwd, export, source, set,
unset, read, alias.
config TRUE
bool "true"
default n
help
Return zero.
config WHICH
bool "which"
default n

11
toys/false.c Normal file
View File

@ -0,0 +1,11 @@
/* vi: set sw=4 ts=4: */
/*
* false.c - Return nonzero.
*/
#include "toys.h"
int false_main(void)
{
return 1;
}

View File

@ -90,6 +90,7 @@ USE_TOYSH(NEWTOY(cd, NULL, TOYFLAG_NOFORK))
USE_DF(NEWTOY(df, "Pkt*a", TOYFLAG_USR|TOYFLAG_SBIN))
USE_ECHO(NEWTOY(echo, "+en", TOYFLAG_BIN))
USE_TOYSH(NEWTOY(exit, NULL, TOYFLAG_NOFORK))
USE_FALSE(NEWTOY(false, NULL, TOYFLAG_BIN))
USE_HELLO(NEWTOY(hello, NULL, TOYFLAG_USR))
USE_MKE2FS(NEWTOY(mke2fs, MKE2FS_OPTSTRING, TOYFLAG_SBIN))
USE_ONEIT(NEWTOY(oneit, "+<1p", TOYFLAG_SBIN))
@ -99,5 +100,6 @@ USE_TOYSH(OLDTOY(sh, toysh, "c:i", TOYFLAG_BIN))
USE_SYNC(NEWTOY(sync, NULL, TOYFLAG_BIN))
USE_TOUCH(NEWTOY(touch, "l#t:r:mca", TOYFLAG_BIN))
USE_TOYSH(NEWTOY(toysh, "c:i", TOYFLAG_BIN))
USE_TRUE(NEWTOY(true, NULL, TOYFLAG_BIN))
USE_WHICH(NEWTOY(which, "a", TOYFLAG_USR|TOYFLAG_BIN))
USE_YES(NEWTOY(yes, "", TOYFLAG_USR|TOYFLAG_BIN))

11
toys/true.c Normal file
View File

@ -0,0 +1,11 @@
/* vi: set sw=4 ts=4: */
/*
* true.c - Return zero.
*/
#include "toys.h"
int true_main(void)
{
return 0;
}