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:
19
mu/mu-cmd.cc
19
mu/mu-cmd.cc
@ -35,6 +35,10 @@
|
||||
#include "message/mu-message.hh"
|
||||
#include "message/mu-mime-object.hh"
|
||||
|
||||
#if BUILD_GUILE
|
||||
#include "scm/mu-scm.hh"
|
||||
#endif/*BUILD_GUILE*/
|
||||
|
||||
#include "utils/mu-error.hh"
|
||||
#include "utils/mu-utils-file.hh"
|
||||
#include "utils/mu-utils.hh"
|
||||
@ -43,7 +47,6 @@
|
||||
|
||||
using namespace Mu;
|
||||
|
||||
|
||||
static Result<void>
|
||||
cmd_fields(const Options& opts)
|
||||
{
|
||||
@ -63,6 +66,17 @@ cmd_find(const Options& opts)
|
||||
return mu_cmd_find(*store, opts);
|
||||
}
|
||||
|
||||
static Result<void>
|
||||
cmd_scm(const Store& store, const Options& opts)
|
||||
{
|
||||
#if !BUILD_SCM
|
||||
return Err(Error::Code::InvalidArgument,
|
||||
"scm/guile is not available in this build");
|
||||
#else
|
||||
return Mu::Scm::run(Mu::Scm::Config{store, opts});
|
||||
#endif /*BUILD_SCM*/
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
show_usage(void)
|
||||
@ -133,6 +147,9 @@ Mu::mu_cmd_execute(const Options& opts) try {
|
||||
return cmd_find(opts);
|
||||
case Options::SubCommand::Info:
|
||||
return with_readonly_store(mu_cmd_info, opts);
|
||||
case Options::SubCommand::Scm:
|
||||
return with_readonly_store(cmd_scm, opts);
|
||||
|
||||
|
||||
/* writable store */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user