#include #include #include #include #include #include #include #include "database.hpp" #include "main_all.hpp" #include "main_upd.hpp" #define FILESPEC_TEXT\ "The may be either a file path or a Thalassa object\n"\ "specification. In case the argument contains at least one ``/'',\n"\ "it is taken as a path to an existing file; the Thalassa database\n"\ "is not even loaded in this case. If the argument contains at\n"\ "least one ``='', it is considered to be a Thalassa object\n"\ "specification, which must either specify a pageset page ID,\n"\ "or a comment ID for either a list item page, or a pageset page.\n"\ "In case there's neither a ``/'' nor a ``='' in the argument\n"\ "(which is not recommended, it is better to use ./name for files\n"\ "and setID=pgID for pageset pages), Thalassa will first try a\n"\ "file in the current working directory, and if there's no such\n"\ "file or it is not a regular file, will try to load the database\n"\ "and use the given name as a pageset page ID (which only works if\n"\ "you've got exactly one pageset).\n"\ "\n"\ "Thalassa object specifications have the form\n"\ "\n"\ " [=[=]][=]\n"\ "\n"\ "where is one of ``list'', ``set'' or ``pageset'' (the\n"\ "latter two are equal), but is in most cases simply omitted;\n"\ " is an ID of either a list or a pageset;\n"\ " is either a pageset page ID, or an item ID within\n"\ "a list with item pages;\n"\ " is, well, the comment ID.\n"\ "Please note that in case the is omitted, then the\n"\ "type must not be ``list'' and the realmID must not be a list ID\n"\ "because list item pages don't have source files, and this command\n"\ "is only intended to work with headed text files. The may\n"\ "only be omitted in case you only have one realm: either exactly one\n"\ "pageset and no lists, or no pagesets and exactly one list. If you\n"\ "specify a pair like XXX=YYY, it is considered to be pageID=commentID\n"\ "if and only if you have exactly one realm, otherwise it is\n"\ "interpreted as setID=pageID.\n" void help_update(FILE *stream) { fprintf(stream, "The ``update'' command updates a ``headed text'' (page/comment) file." "\n" "Usage:\n" "\n" " thalassa [...] update []\n" "\n" FILESPEC_TEXT "\n" "Valid options are:\n" "\n" " -n dry run: show what would be done but don't do\n" " +T add the tag\n" " -T remove the tag\n" " +F add the flag\n" " -F remove the flag\n" " +L