#include "commands.h" #include enum { OPT_SYNC_DB, OPT_SYNC_ALL, ARG_PACKAGE, }; static int sync( const fx_command *self, const fx_arglist *opt, const fx_array *args) { return 0; } FX_COMMAND(CMD_SYNC, CMD_ROOT) { 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."); FX_COMMAND_FLAGS(FX_COMMAND_SHOW_HELP_BY_DEFAULT); FX_COMMAND_FUNCTION(sync); FX_COMMAND_HELP_OPTION(); FX_COMMAND_OPTION(OPT_SYNC_DB) { 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."); } FX_COMMAND_OPTION(OPT_SYNC_ALL) { 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."); } FX_COMMAND_ARG(ARG_PACKAGE) { 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."); FX_ARG_NR_VALUES(FX_ARG_0_OR_MORE_VALUES); } FX_COMMAND_USAGE() { 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); } }