2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 2012,2013, by the GROMACS development team, led by
5 * David van der Spoel, Berk Hess, Erik Lindahl, and including many
6 * others, as listed in the AUTHORS file in the top-level source
7 * directory and at http://www.gromacs.org.
9 * GROMACS is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * as published by the Free Software Foundation; either version 2.1
12 * of the License, or (at your option) any later version.
14 * GROMACS is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with GROMACS; if not, see
21 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 * If you want to redistribute modifications to GROMACS, please
25 * consider that scientific software is very special. Version
26 * control is crucial - bugs must be traceable. We will be happy to
27 * consider code for inclusion in the official distribution, but
28 * derived work must not be called official GROMACS. Details are found
29 * in the README & COPYING files - if they are missing, get the
30 * official version at http://www.gromacs.org.
32 * To help us fund GROMACS development, we humbly ask that you cite
33 * the research papers on the package. Check out http://www.gromacs.org.
37 * Implements gmx::CommandLineModuleManager.
39 * \author Teemu Murtola <teemu.murtola@gmail.com>
40 * \ingroup module_commandline
42 #include "cmdlinemodulemanager.h"
51 #include <boost/scoped_ptr.hpp>
53 #include "gromacs/legacyheaders/copyrite.h"
54 #include "gromacs/legacyheaders/network.h"
56 #include "gromacs/commandline/cmdlinehelpcontext.h"
57 #include "gromacs/commandline/cmdlinemodule.h"
58 #include "gromacs/commandline/cmdlineparser.h"
59 #include "gromacs/onlinehelp/helpformat.h"
60 #include "gromacs/onlinehelp/helpmanager.h"
61 #include "gromacs/onlinehelp/helptopic.h"
62 #include "gromacs/onlinehelp/helpwritercontext.h"
63 #include "gromacs/options/basicoptions.h"
64 #include "gromacs/options/options.h"
65 #include "gromacs/utility/exceptions.h"
66 #include "gromacs/utility/file.h"
67 #include "gromacs/utility/gmxassert.h"
68 #include "gromacs/utility/init.h"
69 #include "gromacs/utility/programinfo.h"
70 #include "gromacs/utility/stringutil.h"
75 //! Container type for mapping module names to module objects.
76 typedef std::map<std::string, CommandLineModulePointer> CommandLineModuleMap;
78 class CommandLineHelpModule;
83 /********************************************************************
89 static const char name[];
90 static const char title[];
91 static const char *const text[];
94 // The first two are not used.
95 const char RootHelpText::name[] = "";
96 const char RootHelpText::title[] = "";
97 const char *const RootHelpText::text[] = {
98 "Usage: [PROGRAM] <command> [<args>]",
102 * Help topic that forms the root of the help tree for the help subcommand.
104 * \ingroup module_commandline
106 class RootHelpTopic : public CompositeHelpTopic<RootHelpText>
110 * Creates a root help topic.
112 * \param[in] modules List of modules for to use for module listings.
116 explicit RootHelpTopic(const CommandLineModuleMap &modules)
121 virtual void writeHelp(const HelpWriterContext &context) const;
124 void printModuleList(const HelpWriterContext &context) const;
126 const CommandLineModuleMap &modules_;
128 GMX_DISALLOW_COPY_AND_ASSIGN(RootHelpTopic);
131 void RootHelpTopic::writeHelp(const HelpWriterContext &context) const
133 if (context.outputFormat() != eHelpOutputFormat_Console)
135 // TODO: Implement once the situation with Redmine issue #969 is more
137 GMX_THROW(NotImplementedError(
138 "Root help is not implemented for this output format"));
140 writeBasicHelpTopic(context, *this, helpText());
141 // TODO: If/when this list becomes long, it may be better to only print
142 // "common" commands here, and have a separate topic (e.g.,
143 // "help commands") that prints the full list.
144 printModuleList(context);
145 context.writeTextBlock(
146 "For additional help on a command, use '[PROGRAM] help <command>'");
147 writeSubTopicList(context,
148 "\nAdditional help is available on the following topics:");
149 context.writeTextBlock(
150 "To access the help, use '[PROGRAM] help <topic>'.");
153 void RootHelpTopic::printModuleList(const HelpWriterContext &context) const
155 if (context.outputFormat() != eHelpOutputFormat_Console)
157 // TODO: Implement once the situation with Redmine issue #969 is more
159 GMX_THROW(NotImplementedError(
160 "Module list is not implemented for this output format"));
162 int maxNameLength = 0;
163 CommandLineModuleMap::const_iterator module;
164 for (module = modules_.begin(); module != modules_.end(); ++module)
166 int nameLength = static_cast<int>(module->first.length());
167 if (module->second->shortDescription() != NULL
168 && nameLength > maxNameLength)
170 maxNameLength = nameLength;
173 File &file = context.outputFile();
174 TextTableFormatter formatter;
175 formatter.addColumn(NULL, maxNameLength + 1, false);
176 formatter.addColumn(NULL, 72 - maxNameLength, true);
177 formatter.setFirstColumnIndent(4);
179 file.writeLine("Available commands:");
180 for (module = modules_.begin(); module != modules_.end(); ++module)
182 const char *name = module->first.c_str();
183 const char *description = module->second->shortDescription();
184 if (description != NULL)
187 formatter.addColumnLine(0, name);
188 formatter.addColumnLine(1, description);
189 file.writeString(formatter.formatRow());
194 /********************************************************************
195 * ModuleHelpTopic declaration
199 * Help topic wrapper for a command-line module.
201 * This class implements HelpTopicInterface such that it wraps a
202 * CommandLineModuleInterface, allowing subcommand "help <command>"
203 * to produce the help for "<command>".
205 * \ingroup module_commandline
207 class ModuleHelpTopic : public HelpTopicInterface
210 //! Constructs a help topic for a specific module.
211 ModuleHelpTopic(const CommandLineModuleInterface &module,
212 const CommandLineHelpModule &helpModule)
213 : module_(module), helpModule_(helpModule)
217 virtual const char *name() const { return module_.name(); }
218 virtual const char *title() const { return NULL; }
219 virtual bool hasSubTopics() const { return false; }
220 virtual const HelpTopicInterface *findSubTopic(const char * /*name*/) const
224 virtual void writeHelp(const HelpWriterContext &context) const;
227 const CommandLineModuleInterface &module_;
228 const CommandLineHelpModule &helpModule_;
230 GMX_DISALLOW_COPY_AND_ASSIGN(ModuleHelpTopic);
233 /********************************************************************
234 * HelpExportInterface
238 * Callbacks for exporting help information for command-line modules.
240 * \ingroup module_commandline
242 class HelpExportInterface
245 virtual ~HelpExportInterface() {};
248 * Called to export the help for each module.
250 * \param[in] tag Unique tag for the module (gmx-something).
251 * \param[in] module Module for which the help should be exported.
253 virtual void exportModuleHelp(const std::string &tag,
254 const CommandLineModuleInterface &module) = 0;
257 /********************************************************************
262 * Implements export for man pages.
264 * \ingroup module_commandline
266 class HelpExportMan : public HelpExportInterface
269 virtual void exportModuleHelp(const std::string &tag,
270 const CommandLineModuleInterface &module);
273 void HelpExportMan::exportModuleHelp(const std::string &tag,
274 const CommandLineModuleInterface &module)
276 File file("man1/" + tag + ".1", "w");
278 // TODO: It would be nice to remove the VERSION prefix from the version
279 // string to make it shorter.
280 file.writeLine(formatString(".TH %s 1 \"\" \"%s\" \"GROMACS Manual\"\n",
283 file.writeLine(".SH NAME");
284 file.writeLine(formatString("%s - %s", tag.c_str(),
285 module.shortDescription()));
288 CommandLineHelpContext context(&file, eHelpOutputFormat_Man);
289 std::string displayName(tag);
290 std::replace(displayName.begin(), displayName.end(), '-', ' ');
291 context.setModuleDisplayName(displayName);
292 module.writeHelp(context);
294 file.writeLine(".SH SEE ALSO");
295 file.writeLine(".BR gromacs(7)");
297 file.writeLine("More information about \\fBGROMACS\\fR is available at <\\fIhttp://www.gromacs.org/\\fR>.");
304 /********************************************************************
305 * CommandLineHelpModule
310 * Command-line module for producing help.
312 * This module implements the 'help' subcommand that is automatically added by
313 * CommandLineModuleManager.
315 * \ingroup module_commandline
317 class CommandLineHelpModule : public CommandLineModuleInterface
321 * Creates a command-line help module.
323 * \param[in] modules List of modules for to use for module listings.
324 * \throws std::bad_alloc if out of memory.
326 explicit CommandLineHelpModule(const CommandLineModuleMap &modules);
329 * Adds a top-level help topic.
331 * \param[in] topic Help topic to add.
332 * \throws std::bad_alloc if out of memory.
334 void addTopic(HelpTopicPointer topic);
335 //! Sets whether hidden options will be shown in help.
336 void setShowHidden(bool bHidden) { bHidden_ = bHidden; }
338 * Sets an override to show the help for the given module.
340 * If called, the help module directly prints the help for the given
341 * module when called, skipping any other processing.
343 void setModuleOverride(const CommandLineModuleInterface &module)
345 moduleOverride_ = &module;
348 //! Returns the context object for help output.
349 const CommandLineHelpContext &context() const
354 virtual const char *name() const { return "help"; }
355 virtual const char *shortDescription() const
357 return "Print help information";
360 virtual int run(int argc, char *argv[]);
361 virtual void writeHelp(const CommandLineHelpContext &context) const;
364 void exportHelp(HelpExportInterface *exporter) const;
366 boost::scoped_ptr<RootHelpTopic> rootTopic_;
367 const CommandLineModuleMap &modules_;
369 CommandLineHelpContext *context_;
370 const CommandLineModuleInterface *moduleOverride_;
373 GMX_DISALLOW_COPY_AND_ASSIGN(CommandLineHelpModule);
376 CommandLineHelpModule::CommandLineHelpModule(const CommandLineModuleMap &modules)
377 : rootTopic_(new RootHelpTopic(modules)), modules_(modules),
378 context_(NULL), moduleOverride_(NULL), bHidden_(false)
382 void CommandLineHelpModule::addTopic(HelpTopicPointer topic)
384 rootTopic_->addSubTopic(move(topic));
387 int CommandLineHelpModule::run(int argc, char *argv[])
389 const char *const exportFormats[] = { "man", "html", "completion" };
390 std::string exportFormat;
391 Options options(NULL, NULL);
392 options.addOption(StringOption("export").store(&exportFormat)
393 .enumValue(exportFormats));
394 CommandLineParser(&options).parse(&argc, argv);
395 if (!exportFormat.empty())
397 boost::scoped_ptr<HelpExportInterface> exporter;
398 if (exportFormat == "man")
400 exporter.reset(new HelpExportMan);
404 GMX_THROW(NotImplementedError("This help format is not implemented"));
406 exportHelp(exporter.get());
410 boost::scoped_ptr<CommandLineHelpContext> context(
411 new CommandLineHelpContext(&File::standardOutput(),
412 eHelpOutputFormat_Console));
413 context->setShowHidden(bHidden_);
414 context_ = context.get();
415 if (moduleOverride_ != NULL)
417 ModuleHelpTopic(*moduleOverride_, *this).writeHelp(context->writerContext());
421 HelpManager helpManager(*rootTopic_, context->writerContext());
424 for (int i = 1; i < argc; ++i)
426 helpManager.enterTopic(argv[i]);
429 catch (const InvalidInputError &ex)
431 fprintf(stderr, "%s\n", ex.what());
434 helpManager.writeCurrentTopic();
438 void CommandLineHelpModule::writeHelp(const CommandLineHelpContext &context) const
440 const HelpWriterContext &writerContext = context.writerContext();
442 if (writerContext.outputFormat() != eHelpOutputFormat_Console)
446 writerContext.writeTextBlock(
447 "Usage: [PROGRAM] help [<command>|<topic> [<subtopic> [...]]]");
448 // TODO: More information.
451 void CommandLineHelpModule::exportHelp(HelpExportInterface *exporter) const
453 // TODO: Would be nicer to have the file names supplied by the build system
454 // and/or export a list of files from here.
455 const char *const program =
456 ProgramInfo::getInstance().invariantProgramName().c_str();
458 CommandLineModuleMap::const_iterator module;
459 for (module = modules_.begin(); module != modules_.end(); ++module)
461 if (module->second->shortDescription() != NULL)
463 const char *const moduleName = module->first.c_str();
464 std::string tag(formatString("%s-%s", program, moduleName));
465 exporter->exportModuleHelp(tag, *module->second);
473 /********************************************************************
474 * ModuleHelpTopic implementation
477 void ModuleHelpTopic::writeHelp(const HelpWriterContext & /*context*/) const
479 module_.writeHelp(helpModule_.context());
482 /********************************************************************
483 * CMainCommandLineModule
487 * Implements a CommandLineModuleInterface, given a function with C/C++ main()
490 * \ingroup module_commandline
492 class CMainCommandLineModule : public CommandLineModuleInterface
495 //! \copydoc gmx::CommandLineModuleManager::CMainFunction
496 typedef CommandLineModuleManager::CMainFunction CMainFunction;
499 * Creates a wrapper module for the given main function.
501 * \param[in] name Name for the module.
502 * \param[in] shortDescription One-line description for the module.
503 * \param[in] mainFunction Main function to wrap.
505 * Does not throw. This is essential for correct implementation of
506 * CommandLineModuleManager::runAsMainCMain().
508 CMainCommandLineModule(const char *name, const char *shortDescription,
509 CMainFunction mainFunction)
510 : name_(name), shortDescription_(shortDescription),
511 mainFunction_(mainFunction)
515 virtual const char *name() const
519 virtual const char *shortDescription() const
521 return shortDescription_;
524 virtual int run(int argc, char *argv[])
526 return mainFunction_(argc, argv);
528 virtual void writeHelp(const CommandLineHelpContext &context) const
530 const HelpOutputFormat format = context.writerContext().outputFormat();
534 case eHelpOutputFormat_Console:
537 case eHelpOutputFormat_Man:
541 GMX_THROW(NotImplementedError(
542 "Command-line help is not implemented for this output format"));
546 // TODO: The constness should not be cast away.
547 argv[0] = const_cast<char *>(name_);
548 argv[1] = const_cast<char *>("-man");
549 argv[2] = const_cast<char *>(type);
551 GlobalCommandLineHelpContext global(context);
552 mainFunction_(argc, argv);
557 const char *shortDescription_;
558 CMainFunction mainFunction_;
564 /********************************************************************
565 * CommandLineModuleManager::Impl
569 * Private implementation class for CommandLineModuleManager.
571 * \ingroup module_commandline
573 class CommandLineModuleManager::Impl
577 * Initializes the implementation class.
579 * \param programInfo Program information for the running binary.
581 explicit Impl(ProgramInfo *programInfo);
584 * Helper method that adds a given module to the module manager.
586 * \throws std::bad_alloc if out of memory.
588 void addModule(CommandLineModulePointer module);
590 * Creates the help module if it does not yet exist.
592 * \throws std::bad_alloc if out of memory.
594 * This method should be called before accessing \a helpModule_.
596 void ensureHelpModuleExists();
599 * Finds a module that matches a name.
601 * \param[in] name Module name to find.
602 * \returns Iterator to the found module, or
603 * \c modules_.end() if not found.
607 CommandLineModuleMap::const_iterator
608 findModuleByName(const std::string &name) const;
610 * Finds a module that the name of the binary.
612 * \param[in] programInfo Program information object to use.
613 * \throws std::bad_alloc if out of memory.
614 * \returns Iterator to the found module, or
615 * \c modules_.end() if not found.
617 * Checks whether the program is invoked through a symlink whose name
618 * is different from ProgramInfo::realBinaryName(), and if so, checks
619 * if a module name matches the name of the symlink.
621 * Note that the \p programInfo parameter is currently not necessary
622 * (as the program info object is also contained as a member), but it
623 * clarifies the control flow.
625 CommandLineModuleMap::const_iterator
626 findModuleFromBinaryName(const ProgramInfo &programInfo) const;
629 * Processes command-line options for the wrapper binary.
631 * \param[in,out] argc On input, argc passed to run().
632 * On output, argc to be passed to the module.
633 * \param[in,out] argv On input, argv passed to run().
634 * On output, argv to be passed to the module.
635 * \throws InvalidInputError if there are invalid options.
636 * \returns The module that should be run.
638 * Handles command-line options that affect the wrapper binary
639 * (potentially changing the members of \c this in response to the
640 * options). Also finds the module that should be run and the
641 * arguments that should be passed to it.
643 CommandLineModuleInterface *
644 processCommonOptions(int *argc, char ***argv);
647 * Maps module names to module objects.
649 * Owns the contained modules.
651 CommandLineModuleMap modules_;
652 //! Information about the currently running program.
653 ProgramInfo &programInfo_;
655 * Module that implements help for the binary.
657 * The pointed module is owned by the \a modules_ container.
659 CommandLineHelpModule *helpModule_;
660 //! Settings for what to write in the startup header.
661 BinaryInformationSettings binaryInfoSettings_;
662 //! If non-NULL, run this module in single-module mode.
663 CommandLineModuleInterface *singleModule_;
664 //! Whether all stderr output should be suppressed.
666 //! Whether to write the startup information to stdout iso stderr.
670 GMX_DISALLOW_COPY_AND_ASSIGN(Impl);
673 CommandLineModuleManager::Impl::Impl(ProgramInfo *programInfo)
674 : programInfo_(*programInfo), helpModule_(NULL), singleModule_(NULL),
675 bQuiet_(false), bStdOutInfo_(false)
677 binaryInfoSettings_.copyright(true);
680 void CommandLineModuleManager::Impl::addModule(CommandLineModulePointer module)
682 GMX_ASSERT(modules_.find(module->name()) == modules_.end(),
683 "Attempted to register a duplicate module name");
684 ensureHelpModuleExists();
685 HelpTopicPointer helpTopic(new ModuleHelpTopic(*module, *helpModule_));
686 modules_.insert(std::make_pair(std::string(module->name()),
688 helpModule_->addTopic(move(helpTopic));
691 void CommandLineModuleManager::Impl::ensureHelpModuleExists()
693 if (helpModule_ == NULL)
695 helpModule_ = new CommandLineHelpModule(modules_);
696 addModule(CommandLineModulePointer(helpModule_));
700 CommandLineModuleMap::const_iterator
701 CommandLineModuleManager::Impl::findModuleByName(const std::string &name) const
703 // TODO: Accept unambiguous prefixes?
704 return modules_.find(name);
707 CommandLineModuleMap::const_iterator
708 CommandLineModuleManager::Impl::findModuleFromBinaryName(
709 const ProgramInfo &programInfo) const
711 std::string binaryName = programInfo.invariantProgramName();
712 if (binaryName == programInfo.realBinaryName())
714 return modules_.end();
716 if (binaryName.compare(0, 2, "g_") == 0)
718 binaryName.erase(0, 2);
720 if (binaryName.compare(0, 3, "gmx") == 0)
722 binaryName.erase(0, 3);
724 return findModuleByName(binaryName);
727 CommandLineModuleInterface *
728 CommandLineModuleManager::Impl::processCommonOptions(int *argc, char ***argv)
730 // Check if we are directly invoking a certain module.
731 CommandLineModuleInterface *module = singleModule_;
734 // Also check for invokation through named symlinks.
735 CommandLineModuleMap::const_iterator moduleIter
736 = findModuleFromBinaryName(programInfo_);
737 if (moduleIter != modules_.end())
739 module = moduleIter->second.get();
744 bool bHidden = false;
745 bool bVersion = false;
746 bool bCopyright = true;
747 // TODO: Print the common options into the help.
748 // TODO: It would be nice to propagate at least the -quiet option to
749 // the modules so that they can also be quiet in response to this.
750 Options options(NULL, NULL);
751 options.addOption(BooleanOption("h").store(&bHelp));
752 options.addOption(BooleanOption("hidden").store(&bHidden));
753 options.addOption(BooleanOption("quiet").store(&bQuiet_));
754 options.addOption(BooleanOption("version").store(&bVersion));
755 options.addOption(BooleanOption("copyright").store(&bCopyright));
759 // If not in single-module mode, process options to the wrapper binary.
760 // TODO: Ideally, this could be done by CommandLineParser.
761 int argcForWrapper = 1;
762 while (argcForWrapper < *argc && (*argv)[argcForWrapper][0] == '-')
766 if (argcForWrapper > 1)
768 CommandLineParser(&options).parse(&argcForWrapper, *argv);
770 // If no action requested and there is a module specified, process it.
771 if (argcForWrapper < *argc && !bHelp && !bVersion)
773 const char *moduleName = (*argv)[argcForWrapper];
774 CommandLineModuleMap::const_iterator moduleIter
775 = findModuleByName(moduleName);
776 if (moduleIter == modules_.end())
778 std::string message =
779 formatString("'%s' is not a GROMACS command.", moduleName);
780 GMX_THROW(InvalidInputError(message));
782 module = moduleIter->second.get();
783 programInfo_.setDisplayName(
784 programInfo_.realBinaryName() + "-" + moduleIter->first);
785 *argc -= argcForWrapper;
786 *argv += argcForWrapper;
787 // After this point, argc and argv are the same independent of
788 // which path is taken: (*argv)[0] is the module name.
793 // Recognize the common options also after the module name.
794 // TODO: It could be nicer to only recognize -h/-hidden if module is not
796 CommandLineParser(&options).skipUnknown(true).parse(argc, *argv);
799 binaryInfoSettings_.extendedInfo(bVersion);
800 binaryInfoSettings_.copyright(bCopyright);
807 // If no module specified and no other action, show the help.
808 // Also explicitly specifying -h for the wrapper binary goes here.
809 if (module == NULL || bHelp)
811 ensureHelpModuleExists();
814 helpModule_->setModuleOverride(*module);
817 module = helpModule_;
819 if (module == helpModule_)
821 helpModule_->setShowHidden(bHidden);
826 /********************************************************************
827 * CommandLineModuleManager
830 CommandLineModuleManager::CommandLineModuleManager(ProgramInfo *programInfo)
831 : impl_(new Impl(programInfo))
835 CommandLineModuleManager::~CommandLineModuleManager()
839 void CommandLineModuleManager::setQuiet(bool bQuiet)
841 impl_->bQuiet_ = bQuiet;
844 void CommandLineModuleManager::addModule(CommandLineModulePointer module)
846 impl_->addModule(move(module));
849 void CommandLineModuleManager::addModuleCMain(
850 const char *name, const char *shortDescription,
851 CMainFunction mainFunction)
853 CommandLineModulePointer module(
854 new CMainCommandLineModule(name, shortDescription, mainFunction));
855 addModule(move(module));
858 void CommandLineModuleManager::addHelpTopic(HelpTopicPointer topic)
860 impl_->ensureHelpModuleExists();
861 impl_->helpModule_->addTopic(move(topic));
864 int CommandLineModuleManager::run(int argc, char *argv[])
866 CommandLineModuleInterface *module;
867 const bool bMaster = (!gmx_mpi_initialized() || gmx_node_rank() == 0);
870 module = impl_->processCommonOptions(&argc, &argv);
872 catch (const std::exception &)
874 if (bMaster && !impl_->bQuiet_)
876 printBinaryInformation(stderr, impl_->programInfo_,
877 impl_->binaryInfoSettings_);
883 impl_->bQuiet_ = true;
887 FILE *out = (impl_->bStdOutInfo_ ? stdout : stderr);
888 printBinaryInformation(out, impl_->programInfo_,
889 impl_->binaryInfoSettings_);
896 int rc = module->run(argc, argv);
905 int CommandLineModuleManager::runAsMainSingleModule(
906 int argc, char *argv[], CommandLineModuleInterface *module)
908 ProgramInfo &programInfo = gmx::init(&argc, &argv);
911 CommandLineModuleManager manager(&programInfo);
912 manager.impl_->singleModule_ = module;
913 int rc = manager.run(argc, argv);
917 catch (const std::exception &ex)
919 printFatalErrorMessage(stderr, ex);
920 return processExceptionAtExit(ex);
925 int CommandLineModuleManager::runAsMainCMain(
926 int argc, char *argv[], CMainFunction mainFunction)
928 CMainCommandLineModule module(argv[0], NULL, mainFunction);
929 return runAsMainSingleModule(argc, argv, &module);