Subversion Repositories HelenOS

Rev

Rev 3277 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3277 Rev 3311
Line 1... Line 1...
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";
Line 17... Line 20...
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
{
Line 34... Line 37...
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