diff options
author | Eric Andersen | 2000-08-21 22:46:33 +0000 |
---|---|---|
committer | Eric Andersen | 2000-08-21 22:46:33 +0000 |
commit | 918507eddaa70b3f75196802b8f905f97bd5f5b6 (patch) | |
tree | 83f5bff33a0bb5d9087fdb64ea4e8da3d5e138db | |
parent | 851ce895bdf33b95ccbfc67061f8949e36fad196 (diff) | |
download | busybox-918507eddaa70b3f75196802b8f905f97bd5f5b6.zip busybox-918507eddaa70b3f75196802b8f905f97bd5f5b6.tar.gz |
Added the 'rdate' command, thanks to Sterling Huxley <sterling@europa.com>.
I added the docs, and made behavior identical to the GNU version.
-Erik
-rw-r--r-- | Changelog | 2 | ||||
-rw-r--r-- | applets/busybox.c | 3 | ||||
-rw-r--r-- | applets/usage.c | 12 | ||||
-rw-r--r-- | busybox.c | 3 | ||||
-rw-r--r-- | busybox.def.h | 1 | ||||
-rw-r--r-- | docs/busybox.pod | 17 | ||||
-rw-r--r-- | docs/busybox.sgml | 23 | ||||
-rw-r--r-- | internal.h | 2 | ||||
-rw-r--r-- | usage.c | 12 |
9 files changed, 73 insertions, 2 deletions
@@ -12,6 +12,8 @@ * Add optional ls file sorting, thanks to a patch from Sterling Huxley <sterling@europa.com> * lsmod now uses the query_module syscall, rather then /proc + * Added 'rdate' command from Sterling Huxley <sterling@europa.com> + * Added 'getopt' command from "Alfred M. Szmidt" <ams@trillian.itslinux.org> -Erik Andersen diff --git a/applets/busybox.c b/applets/busybox.c index d93fc51..d4fbb89 100644 --- a/applets/busybox.c +++ b/applets/busybox.c @@ -226,6 +226,9 @@ const struct BB_applet applets[] = { #ifdef BB_PWD {"pwd", pwd_main, _BB_DIR_BIN, pwd_usage}, #endif +#ifdef BB_RDATE + {"rdate", rdate_main, _BB_DIR_USR_BIN, rdate_usage}, +#endif #ifdef BB_REBOOT {"reboot", reboot_main, _BB_DIR_SBIN, reboot_usage}, #endif diff --git a/applets/usage.c b/applets/usage.c index eaa77cc..7cd05c8 100644 --- a/applets/usage.c +++ b/applets/usage.c @@ -855,6 +855,18 @@ const char pwd_usage[] = ; #endif +#if defined BB_RDATE +const char rdate_usage[] = + "rdate [OPTION] HOST\n" +#ifndef BB_FEATURE_TRIVIAL_HELP + "\nGet and possibly set the system date and time from a remote HOST.\n" + "Options:\n" + "\t-s\tSet the system date and time (default).\n" + "\t-p\tPrint the date and time.\n" +#endif + ; +#endif + #if defined BB_REBOOT const char reboot_usage[] = "reboot\n" @@ -226,6 +226,9 @@ const struct BB_applet applets[] = { #ifdef BB_PWD {"pwd", pwd_main, _BB_DIR_BIN, pwd_usage}, #endif +#ifdef BB_RDATE + {"rdate", rdate_main, _BB_DIR_USR_BIN, rdate_usage}, +#endif #ifdef BB_REBOOT {"reboot", reboot_main, _BB_DIR_SBIN, reboot_usage}, #endif diff --git a/busybox.def.h b/busybox.def.h index 692c721..63b8306 100644 --- a/busybox.def.h +++ b/busybox.def.h @@ -73,6 +73,7 @@ #define BB_PRINTF #define BB_PS #define BB_PWD +#define BB_RDATE #define BB_REBOOT #define BB_RENICE #define BB_RESET diff --git a/docs/busybox.pod b/docs/busybox.pod index 4fba7ea..a2d4e02 100644 --- a/docs/busybox.pod +++ b/docs/busybox.pod @@ -61,7 +61,7 @@ fdflush, find, free, freeramdisk, fsck.minix, getopt, grep, gunzip, gzip, halt, head, hostid, hostname, id, init, insmod, kill, killall, length, ln, loadacm, loadfont, loadkmap, logger, logname, ls, lsmod, makedevs, mkdir, mkfifo, mkfs.minix, mknod, mkswap, mktemp, more, mount, mt, mv, nc, -nslookup, ping, poweroff, printf, ps, pwd, reboot, renice, reset, rm, rmdir, rmmod, sed, +nslookup, ping, poweroff, printf, ps, pwd, rdate, reboot, renice, reset, rm, rmdir, rmmod, sed, setkeycodes, sh, sleep, sort, swapoff, swapon, sync, syslogd, tail, tar, tee, telnet, test, touch, tr, true, tty, umount, uname, uniq, update, uptime, usleep, uudecode, uuencode, wc, which, whoami, yes, zcat, [ @@ -1422,6 +1422,19 @@ Example: ------------------------------- +=item rdate + +Usage: rdate [OPTION] HOST + +Get and possibly set the system date and time from a remote HOST. + +Options: + + -s Set the system date and time (default). + -p Print the date and time. + +------------------------------- + =item reboot Instructs the kernel to reboot the system. @@ -2094,4 +2107,4 @@ Enrique Zanardi <ezanardi@ull.es> =cut -# $Id: busybox.pod,v 1.62 2000/08/21 22:02:34 andersen Exp $ +# $Id: busybox.pod,v 1.63 2000/08/21 22:46:33 andersen Exp $ diff --git a/docs/busybox.sgml b/docs/busybox.sgml index f53be8d..d590237 100644 --- a/docs/busybox.sgml +++ b/docs/busybox.sgml @@ -2488,6 +2488,29 @@ </para> </sect1> + <sect1 id="rdate"> + <title>rdate</title> + + <para> + Usage: rdate [OPTION] HOST + </para> + + <para> + Get and possibly set the system date and time from a remote HOST. + </para> + + <para> + Options: + </para> + + <para> + <screen> + -s Set the system date and time (default). + -p Print the date and time. + </screen> + </para> + </sect1> + <sect1 id="reboot"> <title>reboot</title> @@ -177,6 +177,7 @@ extern int poweroff_main(int argc, char **argv); extern int printf_main(int argc, char** argv); extern int ps_main(int argc, char** argv); extern int pwd_main(int argc, char** argv); +extern int rdate_main(int argc, char** argv); extern int reboot_main(int argc, char** argv); extern int renice_main(int argc, char** argv); extern int reset_main(int argc, char** argv); @@ -283,6 +284,7 @@ extern const char poweroff_usage[]; extern const char printf_usage[]; extern const char ps_usage[]; extern const char pwd_usage[]; +extern const char rdate_usage[]; extern const char reboot_usage[]; extern const char renice_usage[]; extern const char reset_usage[]; @@ -855,6 +855,18 @@ const char pwd_usage[] = ; #endif +#if defined BB_RDATE +const char rdate_usage[] = + "rdate [OPTION] HOST\n" +#ifndef BB_FEATURE_TRIVIAL_HELP + "\nGet and possibly set the system date and time from a remote HOST.\n" + "Options:\n" + "\t-s\tSet the system date and time (default).\n" + "\t-p\tPrint the date and time.\n" +#endif + ; +#endif + #if defined BB_REBOOT const char reboot_usage[] = "reboot\n" |