73 lines
1.7 KiB
C
73 lines
1.7 KiB
C
|
|
#include "commands.h"
|
||
|
|
|
||
|
|
#include <blue/cmd.h>
|
||
|
|
|
||
|
|
enum {
|
||
|
|
OPT_SYNC_DB,
|
||
|
|
OPT_SYNC_ALL,
|
||
|
|
|
||
|
|
ARG_PACKAGE,
|
||
|
|
};
|
||
|
|
|
||
|
|
static int sync(
|
||
|
|
const b_command *self,
|
||
|
|
const b_arglist *opt,
|
||
|
|
const b_array *args)
|
||
|
|
{
|
||
|
|
return 0;
|
||
|
|
}
|
||
|
|
|
||
|
|
B_COMMAND(CMD_SYNC, CMD_ROOT)
|
||
|
|
{
|
||
|
|
B_COMMAND_NAME("sync");
|
||
|
|
B_COMMAND_SHORT_NAME('S');
|
||
|
|
B_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.");
|
||
|
|
B_COMMAND_FLAGS(B_COMMAND_SHOW_HELP_BY_DEFAULT);
|
||
|
|
B_COMMAND_FUNCTION(sync);
|
||
|
|
|
||
|
|
B_COMMAND_HELP_OPTION();
|
||
|
|
|
||
|
|
B_COMMAND_OPTION(OPT_SYNC_DB)
|
||
|
|
{
|
||
|
|
B_OPTION_SHORT_NAME('y');
|
||
|
|
B_OPTION_LONG_NAME("database");
|
||
|
|
B_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.");
|
||
|
|
}
|
||
|
|
|
||
|
|
B_COMMAND_OPTION(OPT_SYNC_ALL)
|
||
|
|
{
|
||
|
|
B_OPTION_SHORT_NAME('u');
|
||
|
|
B_OPTION_LONG_NAME("synchronise-all");
|
||
|
|
B_OPTION_DESC(
|
||
|
|
"synchronise all packages currently installed on the "
|
||
|
|
"system, updating them to the latest available "
|
||
|
|
"version.");
|
||
|
|
}
|
||
|
|
|
||
|
|
B_COMMAND_ARG(ARG_PACKAGE)
|
||
|
|
{
|
||
|
|
B_ARG_NAME("package-name");
|
||
|
|
B_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.");
|
||
|
|
B_ARG_NR_VALUES(B_ARG_1_OR_MORE_VALUES);
|
||
|
|
}
|
||
|
|
|
||
|
|
B_COMMAND_USAGE()
|
||
|
|
{
|
||
|
|
B_COMMAND_USAGE_ARG(ARG_PACKAGE);
|
||
|
|
}
|
||
|
|
}
|