diff options
author | Eric Andersen | 1999-10-05 16:24:54 +0000 |
---|---|---|
committer | Eric Andersen | 1999-10-05 16:24:54 +0000 |
commit | cc8ed39b240180b58810784f844e253263594ac3 (patch) | |
tree | 15feebbb4be9a9168209609f48f0b100f9364420 /dyadic.c | |
download | busybox-cc8ed39b240180b58810784f844e253263594ac3.zip busybox-cc8ed39b240180b58810784f844e253263594ac3.tar.gz |
Initial revision0_29alpha2
Diffstat (limited to 'dyadic.c')
-rw-r--r-- | dyadic.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/dyadic.c b/dyadic.c new file mode 100644 index 0000000..8136bb5 --- /dev/null +++ b/dyadic.c @@ -0,0 +1,28 @@ +#include "internal.h" +#include <stdio.h> + +extern int +dyadic_main( + struct FileInfo * i +,int argc +,char * * argv) +{ + int flags; + + i->dyadic = 1; + i->destination = argv[argc - 1]; + + for ( flags = 0; flags < (argc - 1) && argv[flags + 1][0] == '-' ; flags++ ) + ; + if ( argc - flags < 3 ) { + usage(i->applet->usage); + return 1; + } + else if ( argc - flags > 3 ) { + if ( !is_a_directory(i->destination) ) { + fprintf(stderr, "%s: not a directory.\n", i->destination); + return 1; + } + } + return monadic_main(i, argc - 1, argv); +} |