mirror of
https://github.com/ventoy/Ventoy.git
synced 2026-11-20 12:43:34 +01:00
VtoyTool add cmds.
This commit is contained in:
+8
-6
@@ -7,12 +7,12 @@
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
@@ -38,10 +38,11 @@ int vtoyloader_main(int argc, char **argv);
|
||||
int vtoyvine_main(int argc, char **argv);
|
||||
int vtoyksym_main(int argc, char **argv);
|
||||
int vtoykmod_main(int argc, char **argv);
|
||||
int vtoygpt_main(int argc, char **argv);
|
||||
int vtoyexpand_main(int argc, char **argv);
|
||||
|
||||
static char *g_vtoytool_name = NULL;
|
||||
static cmd_def g_cmd_list[] =
|
||||
static cmd_def g_cmd_list[] =
|
||||
{
|
||||
{ "vine_patch_loader", vtoyvine_main },
|
||||
{ "vtoydump", vtoydump_main },
|
||||
@@ -51,6 +52,7 @@ static cmd_def g_cmd_list[] =
|
||||
{ "vtoyksym", vtoyksym_main },
|
||||
{ "vtoykmod", vtoykmod_main },
|
||||
{ "vtoyexpand", vtoyexpand_main },
|
||||
{ "vtoygpt", vtoygpt_main },
|
||||
{ "--install", vtoytool_install },
|
||||
};
|
||||
|
||||
@@ -60,7 +62,7 @@ int vtoytool_install(int argc, char **argv)
|
||||
int i;
|
||||
char toolpath[128];
|
||||
char filepath[128];
|
||||
|
||||
|
||||
for (i = 0; i < sizeof(g_cmd_list) / sizeof(g_cmd_list[0]); i++)
|
||||
{
|
||||
if (g_cmd_list[i].cmd[0] != '-')
|
||||
@@ -70,14 +72,14 @@ int vtoytool_install(int argc, char **argv)
|
||||
link(toolpath, filepath);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
if ((g_vtoytool_name = strstr(argv[0], "vtoytool")) != NULL)
|
||||
{
|
||||
argc--;
|
||||
|
||||
Reference in New Issue
Block a user