20 int main(
int argc,
char *argv[]) {
24 program.add_argument(
"--complete")
26 .nargs(argparse::nargs_pattern::any);
29 program.add_argument(
"--install-completions")
44 for (
int i = 1; i < argc; i++) {
45 if (std::string_view(argv[i]) ==
"--complete") {
46 std::string prefix = (i + 1 < argc) ? argv[i + 1] :
"";
47 std::vector<std::string> context;
48 for (
int j = i + 2; j < argc; j++) {
49 context.emplace_back(argv[j]);
57 program.parse_args(argc, argv);
59 catch (
const std::exception& err) {
61 std::cerr << err.what() << std::endl;
78 if (program.get<
bool>(
"--install-completions")) {
Module for MCMC diagnostic analysis.
Module for extracting penalty terms from systematic chains.
Core program class for the MaCh3 command-line interface.
Module for processing MCMC chains and producing diagnostic plots.
Module for performing diagnostic analysis on MCMC chains.
Module for extracting specific penalty terms from MCMC chains.
const MaCh3ArgumentParser & get_subcommand_used() const
Get the subcommand that was used in parsing.
Main program class that manages modules, plugins, and command-line parsing.
void add_core_module(IModule &module)
Add a core module to the program.
void completions(const std::string &prefix, const std::vector< std::string > &context) const
Generate completion suggestions given the current prefix and preceding words.
void install_completions() const
Install shell completion scripts for bash and zsh.
int Run()
Run the selected subcommand.
void load_dynamic_plugins()
Load dynamic plugins from the MACH3_PLUGINS environment variable.
Module for processing MCMC chains and producing various diagnostic plots.
int main(int argc, char *argv[])
Main entry point for the MaCh3 application.