4 #include <aros/debug.h>
10 char *template = "COMMAND/A,ARGS/F";
11 char *cmdtemplate
= "LIST/S,SETUPS/S,INSTALL/S";
13 LONG
doCommand(char *name
, STRPTR command
, STRPTR args
) {
14 LONG retval
= RETURN_FAIL
;
15 IPTR myargs
[]={0,0,0,0};
16 struct RDArgs
*rdargs
;
17 struct RDArgs rda
= {{command
, strlen(command
), 0}, 0, 0, 0, NULL
, 0};
19 rda
.RDA_Source
.CS_Buffer
[rda
.RDA_Source
.CS_Length
]='\n';
20 rdargs
= ReadArgs(cmdtemplate
, myargs
, &rda
);
24 retval
= list(name
, args
);
26 retval
= setup(name
, args
);
28 retval
= install(name
, args
);
32 PrintFault(IoErr(), name
);
36 int main(int argc
, char **argv
) {
37 int retval
= RETURN_FAIL
;
39 struct RDArgs
*rdargs
;
41 rdargs
= ReadArgs(template, myargs
, NULL
);
44 retval
= doCommand(argv
[0], (STRPTR
)myargs
[0], (STRPTR
)myargs
[1]);
48 PrintFault(IoErr(), argv
[0]);