mu: add 'scm' command

Add the "scm" command, the way to get a Guile/Scheme shell.

This is experimental but will replace the current guile support in guile/ at
some point.
This commit is contained in:
Dirk-Jan C. Binnema
2025-05-31 12:41:37 +03:00
parent 7f274fe518
commit f9c24c7166
6 changed files with 73 additions and 6 deletions

View File

@ -545,7 +545,15 @@ sub_server(CLI::App& sub, Options& opts)
sub.add_flag("--allow-temp-file", opts.server.allow_temp_file,
"Allow for the temp-file optimization")
->excludes("--commands");
}
static void
sub_scm(CLI::App& sub, Options& opts)
{
sub.add_option("script-path", opts.scm.script_path, "Path to script")
->type_name("<path>");
sub.add_option("script-args", opts.scm.params, "Parameters for script")
->type_name("<parameters>");
}
static void
@ -665,9 +673,13 @@ AssocPairs<SubCommand, CommandInfo, Options::SubCommandNum> SubCommandInfos= {{
{Category::NeedsWritableStore,
"remove", "Remove message from file-system and database", sub_remove }
},
{ SubCommand::Scm,
{Category::None,
"scm", "Start Guile/Scheme shell",sub_scm}
},
{ SubCommand::Script,
// Note: SubCommand::Script is special; there's no literal
// "script" subcommand, there subcommands for all the scripts.
// "script" subcommand, there are subcommands for all the scripts.
{Category::None,
"script", "Invoke a script", {}}
},