- // No parameter may be named "preview", because that is a required
- // flag for all commands.
-
- switch (code) {
- case BIBITEM_CODE: {
- static const char * const paramnames[] = {"label", "key", ""};
- static const bool isoptional[] = {true, false};
- static const CommandInfo info = {2, paramnames, isoptional};
- return &info;
- }
- case BIBTEX_CODE: {
- static const char * const paramnames[] =
- {"options", "btprint", "bibfiles", ""};
- static const bool isoptional[] = {true, true, false};
- static const CommandInfo info = {3, paramnames, isoptional};
- return &info;
- }
- case CITE_CODE: {
- // standard cite does only take one argument if jurabib is
- // not used, but jurabib extends this to two arguments, so
- // we have to allow both here. InsetCitation takes care that
- // LaTeX output is nevertheless correct.
- static const char * const paramnames[] =
- {"after", "before", "key", ""};
- static const bool isoptional[] = {true, true, false};
- static const CommandInfo info = {3, paramnames, isoptional};
- return &info;
- }
- case FLOAT_LIST_CODE: {
- static const char * const paramnames[] = {"type", ""};
- static const bool isoptional[] = {false};
- static const CommandInfo info = {1, paramnames, isoptional};
- return &info;
- }
- case HFILL_CODE: {
- static const char * const paramnames[] = {""};
- static const CommandInfo info = {0, paramnames, 0};
- return &info;
- }
- case HYPERLINK_CODE: {
- static const char * const paramnames[] =
- {"name", "target", ""};
- static const bool isoptional[] = {true, false};
- static const CommandInfo info = {2, paramnames, isoptional};
- return &info;
- }
- case INCLUDE_CODE: {
- //This is only correct for the case of listings, but it'll do for now.
- //In the other cases, this second parameter should just be empty.
- static const char * const paramnames[] = {"filename", "lstparams", ""};
- static const bool isoptional[] = {false, true};
- static const CommandInfo info = {2, paramnames, isoptional};
- return &info;
- }
- case INDEX_CODE:
- case INDEX_PRINT_CODE:
- case LABEL_CODE: {
- static const char * const paramnames[] = {"name", ""};
- static const bool isoptional[] = {false};
- static const CommandInfo info = {1, paramnames, isoptional};
- return &info;
- }
- case NOMENCL_CODE: {
- static const char * const paramnames[] = {"prefix", "symbol", "description", ""};
- static const bool isoptional[] = {true, false, false};
- static const CommandInfo info = {3, paramnames, isoptional};
- return &info;
- }
- case NOMENCL_PRINT_CODE: {
- static const char * const paramnames[] = {"labelwidth", ""};
- static const bool isoptional[] = {true};
- static const CommandInfo info = {1, paramnames, isoptional};
- return &info;
- }
- case REF_CODE: {
- static const char * const paramnames[] =
- {"name", "reference", ""};
- static const bool isoptional[] = {true, false};
- static const CommandInfo info = {2, paramnames, isoptional};
- return &info;
- }
- case TOC_CODE: {
- static const char * const paramnames[] = {"type", ""};
- static const bool isoptional[] = {false};
- static const CommandInfo info = {1, paramnames, isoptional};
- return &info;
- }
- default:
- BOOST_ASSERT(false);
- }
- return 0;