/* Automatically generated by mknewcmd on Mon Aug 11 00:21:59 PHT 2008
* This is machine generated output. The author of mknewcmd claims no
* copyright over the contents of this file. Where legally permitted, the
* contents herein are donated to the public domain.
*
* You should apply any license and copyright that you wish to this file,
* replacing this header in its entirety. */
#include <stdio.h>
#include <stdlib.h>
#include "entry.h"
#include "cat.h"
#include "cmds.h"
static char *cmdname = "cat";
/* Dispays help for cat in various levels */
void * help_cmd_cat(unsigned int level)
{
printf("This is the %s help for '%s'.\n",
level ? EXT_HELP : SHORT_HELP, cmdname);
return 0;
}
/* Main entry point for cat, accepts an array of arguments */
int * cmd_cat(char **argv)
{
unsigned int argc;
unsigned int i;
/* Count the arguments */
for (argc = 0; argv[argc] != NULL; argc ++);
printf("%s %s\n", TEST_ANNOUNCE
, cmdname
);
printf("%d arguments passed to %s", argc
- 1, cmdname
);
if (argc < 2) {
return 0;
}
for (i = 1; i < argc; i++)
printf("[%d] -> %s\n", i
, argv
[i
]);
return 0;
}