Files
ropkg/ropam/sync.c
T

84 lines
1.9 KiB
C
Raw Normal View History

#include "commands.h"
2026-06-22 17:45:54 +01:00
#include <fx/cmdline/cmd.h>
enum {
OPT_SYNC_DB,
OPT_SYNC_ALL,
ARG_PACKAGE,
};
static int sync(
2026-06-22 17:45:54 +01:00
const fx_command *self,
const fx_arglist *opt,
const fx_array *args)
{
return 0;
}
2026-06-22 17:45:54 +01:00
FX_COMMAND(CMD_SYNC, CMD_ROOT)
{
2026-06-22 17:45:54 +01:00
FX_COMMAND_NAME("sync");
FX_COMMAND_SHORT_NAME('S');
FX_COMMAND_DESC(
"synchronise your machine with the your registered package "
"vendor(s). this command can be used to synchronise packages, "
"installing them or updating them to the latest available "
"version. all installed packages can be synchronised to update "
"the whole system, or the package database itself can be "
"synchronised to gain access to new and updated packages.");
2026-06-22 17:45:54 +01:00
FX_COMMAND_FLAGS(FX_COMMAND_SHOW_HELP_BY_DEFAULT);
FX_COMMAND_FUNCTION(sync);
2026-06-22 17:45:54 +01:00
FX_COMMAND_HELP_OPTION();
2026-06-22 17:45:54 +01:00
FX_COMMAND_OPTION(OPT_SYNC_DB)
{
2026-06-22 17:45:54 +01:00
FX_OPTION_SHORT_NAME('y');
FX_OPTION_LONG_NAME("database");
FX_OPTION_DESC(
"synchronise the package database before synchronising "
"any packages. this option can be specified without "
"any package names to synchronise the package database "
"on its own.");
}
2026-06-22 17:45:54 +01:00
FX_COMMAND_OPTION(OPT_SYNC_ALL)
{
2026-06-22 17:45:54 +01:00
FX_OPTION_SHORT_NAME('u');
FX_OPTION_LONG_NAME("synchronise-all");
FX_OPTION_DESC(
"synchronise all packages currently installed on the "
"system, updating them to the latest available "
"version.");
}
2026-06-22 17:45:54 +01:00
FX_COMMAND_ARG(ARG_PACKAGE)
{
2026-06-22 17:45:54 +01:00
FX_ARG_NAME("package-name");
FX_ARG_DESC(
"the names of the packages to synchronise. if a named "
"package is not installed, the latest version will be "
"installed. otherwise, the already-installed package "
"will be updated to the latest version.");
2026-06-22 17:45:54 +01:00
FX_ARG_NR_VALUES(FX_ARG_0_OR_MORE_VALUES);
}
2026-06-22 17:45:54 +01:00
FX_COMMAND_USAGE()
{
2026-06-22 17:45:54 +01:00
FX_COMMAND_USAGE_ARG(ARG_PACKAGE);
}
FX_COMMAND_USAGE()
{
FX_COMMAND_USAGE_OPT(OPT_SYNC_DB);
}
FX_COMMAND_USAGE()
{
FX_COMMAND_USAGE_OPT(OPT_SYNC_DB);
FX_COMMAND_USAGE_OPT(OPT_SYNC_ALL);
}
}