@@ -474,6 +474,7 @@ com_sh(exec_context& ec, std::string cmdline, std::vector<std::string>& args)
474474 return Ok (std::string ());
475475}
476476
477+ #ifdef HAVE_RUST_DEPS
477478namespace lnav_rs_ext {
478479
479480::rust::String
@@ -529,12 +530,14 @@ execute_external_command(::rust::String rs_src, ::rust::String rs_script)
529530}
530531
531532} // namespace lnav_rs_ext
533+ #endif
532534
533535static Result<std::string, lnav::console::user_message>
534536com_external_access (exec_context& ec,
535537 std::string cmdline,
536538 std::vector<std::string>& args)
537539{
540+ #ifdef HAVE_RUST_DEPS
538541 if (args.size () != 3 ) {
539542 return ec.make_error (" Expecting port number and API key" );
540543 }
@@ -550,7 +553,8 @@ com_external_access(exec_context& ec,
550553
551554 auto scan_res = scn::scan_int<uint16_t >(args[1 ]);
552555 if (!scan_res || !scan_res.value ().range ().empty ()) {
553- return ec.make_error (FMT_STRING (" port value is not a number: {}" ), args[1 ]);
556+ return ec.make_error (FMT_STRING (" port value is not a number: {}" ),
557+ args[1 ]);
554558 }
555559 auto port = scan_res->value ();
556560
@@ -567,6 +571,9 @@ com_external_access(exec_context& ec,
567571 setenv (" LNAV_EXTERNAL_URL" , url.c_str (), 1 );
568572
569573 return Ok (retval);
574+ #else
575+ return ec.make_error (" lnav was compiled without Rust extensions" );
576+ #endif
570577}
571578
572579static readline_context::command_t SCRIPTING_COMMANDS [] = {
0 commit comments