Line 56... |
Line 56... |
56 |
ACTION_HELP
|
56 |
ACTION_HELP
|
57 |
};
|
57 |
};
|
58 |
|
58 |
|
59 |
|
59 |
|
60 |
static int showhelp(void) {
|
60 |
static int showhelp(void) {
|
61 |
puts("PKG ver " PVER " Copyright (C) " PDATE " Mateusz Viste");
|
61 |
outputnl("PKG ver " PVER " Copyright (C) " PDATE " Mateusz Viste");
|
62 |
puts("");
|
62 |
outputnl("");
|
63 |
puts(svarlang_str(1, 0)); /* "PKG is the SvarDOS package manager." */
|
63 |
outputnl(svarlang_str(1, 0)); /* "PKG is the SvarDOS package manager." */
|
64 |
puts("");
|
64 |
outputnl("");
|
65 |
puts(svarlang_str(1, 19)); /* "Usage:" */
|
65 |
outputnl(svarlang_str(1, 19)); /* "Usage:" */
|
66 |
puts("");
|
66 |
outputnl("");
|
67 |
puts(svarlang_str(1, 20)); /* "pkg install package.svp */
|
67 |
outputnl(svarlang_str(1, 20)); /* "pkg install package.svp */
|
68 |
puts(svarlang_str(1, 21)); /* "pkg update package.svp" */
|
68 |
outputnl(svarlang_str(1, 21)); /* "pkg update package.svp" */
|
69 |
puts(svarlang_str(1, 22)); /* "pkg del package" */
|
69 |
outputnl(svarlang_str(1, 22)); /* "pkg rm package" */
|
70 |
puts(svarlang_str(1, 23)); /* "pkg listfiles package" */
|
70 |
outputnl(svarlang_str(1, 23)); /* "pkg files package" */
|
71 |
puts(svarlang_str(1, 24)); /* "pkg listlocal [filter]" */
|
71 |
outputnl(svarlang_str(1, 24)); /* "pkg list [filter]" */
|
72 |
puts(svarlang_str(1, 25)); /* "pkg healthcheck [pkg]" */
|
72 |
outputnl(svarlang_str(1, 25)); /* "pkg check [pkg]" */
|
- |
|
73 |
outputnl(svarlang_str(1, 26)); /* "pkg check+ [pkg]" */
|
73 |
puts(svarlang_str(1, 27)); /* "pkg unzip file.zip" */
|
74 |
outputnl(svarlang_str(1, 27)); /* "pkg unzip file.zip" */
|
74 |
puts(svarlang_str(1, 29)); /* "pkg listzip file.zip" */
|
75 |
outputnl(svarlang_str(1, 29)); /* "pkg listzip file.zip" */
|
75 |
puts(svarlang_str(1, 28)); /* "pkg crc32 file" */
|
76 |
outputnl(svarlang_str(1, 28)); /* "pkg crc32 file" */
|
76 |
puts("");
|
77 |
outputnl("");
|
77 |
puts(svarlang_str(1, 40)); /* "PKG is published under the MIT license." */
|
78 |
outputnl(svarlang_str(1, 40)); /* "PKG is published under the MIT license." */
|
78 |
puts(svarlang_str(1, 41)); /* "It is configured through %DOSDIR%\CFG\PKG.CFG" */
|
79 |
outputnl(svarlang_str(1, 41)); /* "It is configured through %DOSDIR%\CFG\PKG.CFG" */
|
79 |
return(1);
|
80 |
return(1);
|
80 |
}
|
81 |
}
|
81 |
|
82 |
|
82 |
|
83 |
|
83 |
static enum ACTIONTYPES parsearg(int argc, char * const *argv) {
|
84 |
static enum ACTIONTYPES parsearg(int argc, char * const *argv) {
|
84 |
/* look for valid actions */
|
85 |
/* look for valid actions */
|
85 |
if ((argc == 3) && (strcasecmp(argv[1], "install") == 0)) {
|
86 |
if ((argc == 3) && (strcasecmp(argv[1], "install") == 0)) {
|
86 |
return(ACTION_INSTALL);
|
87 |
return(ACTION_INSTALL);
|
87 |
} else if ((argc == 3) && (strcasecmp(argv[1], "update") == 0)) {
|
88 |
} else if ((argc == 3) && (strcasecmp(argv[1], "update") == 0)) {
|
88 |
return(ACTION_UPDATE);
|
89 |
return(ACTION_UPDATE);
|
89 |
} else if ((argc == 3) && (strcasecmp(argv[1], "del") == 0)) {
|
90 |
} else if ((argc == 3) && (strcasecmp(argv[1], "rm") == 0)) {
|
90 |
return(ACTION_REMOVE);
|
91 |
return(ACTION_REMOVE);
|
91 |
} else if ((argc == 3) && (strcasecmp(argv[1], "listfiles") == 0)) {
|
92 |
} else if ((argc == 3) && (strcasecmp(argv[1], "files") == 0)) {
|
92 |
return(ACTION_LISTFILES);
|
93 |
return(ACTION_LISTFILES);
|
93 |
} else if ((argc >= 2) && (argc <= 3) && (strcasecmp(argv[1], "listlocal") == 0)) {
|
94 |
} else if ((argc >= 2) && (argc <= 3) && (strcasecmp(argv[1], "list") == 0)) {
|
94 |
return(ACTION_LISTLOCAL);
|
95 |
return(ACTION_LISTLOCAL);
|
95 |
} else if ((argc >= 2) && (argc <= 3) && (strcasecmp(argv[1], "healthcheck") == 0)) {
|
96 |
} else if ((argc >= 2) && (argc <= 3) && (strcasecmp(argv[1], "check") == 0)) {
|
96 |
return(ACTION_HEALTHCHECK);
|
97 |
return(ACTION_HEALTHCHECK);
|
97 |
} else if ((argc >= 2) && (argc <= 3) && (strcasecmp(argv[1], "healthcheck+") == 0)) {
|
98 |
} else if ((argc >= 2) && (argc <= 3) && (strcasecmp(argv[1], "check+") == 0)) {
|
98 |
return(ACTION_HEALTHCHECKEXT);
|
99 |
return(ACTION_HEALTHCHECKEXT);
|
99 |
} else if ((argc == 3) && (strcasecmp(argv[1], "unzip") == 0)) {
|
100 |
} else if ((argc == 3) && (strcasecmp(argv[1], "unzip") == 0)) {
|
100 |
return(ACTION_UNZIP);
|
101 |
return(ACTION_UNZIP);
|
101 |
} else if ((argc == 3) && (strcasecmp(argv[1], "listzip") == 0)) {
|
102 |
} else if ((argc == 3) && (strcasecmp(argv[1], "ziplist") == 0)) {
|
102 |
return(ACTION_LISTZIP);
|
103 |
return(ACTION_LISTZIP);
|
103 |
} else if ((argc == 3) && (strcasecmp(argv[1], "crc32") == 0)) {
|
104 |
} else if ((argc == 3) && (strcasecmp(argv[1], "crc32") == 0)) {
|
104 |
return(ACTION_CRC32);
|
105 |
return(ACTION_CRC32);
|
105 |
} else {
|
106 |
} else {
|
106 |
return(ACTION_HELP);
|
107 |
return(ACTION_HELP);
|