Rev 3277 | Rev 3319 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3277 | Rev 3311 | ||
---|---|---|---|
1 | /* Automatically generated by mknewcmd on Mon Aug 11 00:21:59 PHT 2008 |
1 | /* Automatically generated by mknewcmd on Wed Aug 13 15:41:09 PHT 2008 |
2 | * This is machine generated output. The author of mknewcmd claims no |
2 | * This is machine generated output. The author of mknewcmd claims no |
3 | * copyright over the contents of this file. Where legally permitted, the |
3 | * copyright over the contents of this file. Where legally permitted, the |
4 | * contents herein are donated to the public domain. |
4 | * contents herein are donated to the public domain. |
5 | * |
5 | * |
6 | * You should apply any license and copyright that you wish to this file, |
6 | * You should apply any license and copyright that you wish to this file, |
7 | * replacing this header in its entirety. */ |
7 | * replacing this header in its entirety. */ |
8 | 8 | ||
9 | #include <stdio.h> |
9 | #include <stdio.h> |
10 | #include <stdlib.h> |
10 | #include <stdlib.h> |
- | 11 | #include "config.h" |
|
- | 12 | #include "util.h" |
|
- | 13 | #include "errors.h" |
|
11 | #include "entry.h" |
14 | #include "entry.h" |
12 | #include "cat.h" |
15 | #include "cat.h" |
13 | #include "cmds.h" |
16 | #include "cmds.h" |
14 | 17 | ||
15 | static char *cmdname = "cat"; |
18 | static char *cmdname = "cat"; |
16 | 19 | ||
17 | /* Dispays help for cat in various levels */ |
20 | /* Dispays help for cat in various levels */ |
18 | void * help_cmd_cat(unsigned int level) |
21 | void * help_cmd_cat(unsigned int level) |
19 | { |
22 | { |
20 | printf("This is the %s help for '%s'.\n", |
23 | printf("This is the %s help for '%s'.\n", |
21 | level ? EXT_HELP : SHORT_HELP, cmdname); |
24 | level ? EXT_HELP : SHORT_HELP, cmdname); |
22 | return 0; |
25 | return CMD_VOID; |
23 | } |
26 | } |
24 | 27 | ||
25 | /* Main entry point for cat, accepts an array of arguments */ |
28 | /* Main entry point for cat, accepts an array of arguments */ |
26 | int * cmd_cat(char **argv) |
29 | int * cmd_cat(char **argv) |
27 | { |
30 | { |
28 | unsigned int argc; |
31 | unsigned int argc; |
29 | unsigned int i; |
32 | unsigned int i; |
30 | 33 | ||
31 | /* Count the arguments */ |
34 | /* Count the arguments */ |
32 | for (argc = 0; argv[argc] != NULL; argc ++); |
35 | for (argc = 0; argv[argc] != NULL; argc ++); |
33 | 36 | ||
34 | printf("%s %s\n", TEST_ANNOUNCE, cmdname); |
37 | printf("%s %s\n", TEST_ANNOUNCE, cmdname); |
35 | printf("%d arguments passed to %s", argc - 1, cmdname); |
38 | printf("%d arguments passed to %s", argc - 1, cmdname); |
36 | 39 | ||
37 | if (argc < 2) { |
40 | if (argc < 2) { |
38 | printf("\n"); |
41 | printf("\n"); |
39 | return 0; |
42 | return CMD_SUCCESS; |
40 | } |
43 | } |
41 | 44 | ||
42 | printf(":\n"); |
45 | printf(":\n"); |
43 | for (i = 1; i < argc; i++) |
46 | for (i = 1; i < argc; i++) |
44 | printf("[%d] -> %s\n", i, argv[i]); |
47 | printf("[%d] -> %s\n", i, argv[i]); |
45 | 48 | ||
46 | return 0; |
49 | return CMD_SUCCESS; |
47 | } |
50 | } |
48 | 51 | ||
49 | 52 |