Jan Kundrát | dc2b072 | 2018-03-02 14:13:37 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 CESNET, https://photonics.cesnet.cz/ |
Jan Kundrát | a274044 | 2018-03-22 16:56:43 +0100 | [diff] [blame] | 3 | * Copyright (C) 2018 FIT CVUT, https://fit.cvut.cz/ |
Jan Kundrát | dc2b072 | 2018-03-02 14:13:37 +0100 | [diff] [blame] | 4 | * |
Václav Kubernát | 624a887 | 2018-03-02 17:28:47 +0100 | [diff] [blame] | 5 | * Written by Václav Kubernát <kubervac@fit.cvut.cz> |
Jan Kundrát | dc2b072 | 2018-03-02 14:13:37 +0100 | [diff] [blame] | 6 | * |
| 7 | */ |
Václav Kubernát | fd26116 | 2020-11-12 02:36:29 +0100 | [diff] [blame] | 8 | #include <atomic> |
Jan Kundrát | dc2b072 | 2018-03-02 14:13:37 +0100 | [diff] [blame] | 9 | #include <docopt.h> |
Václav Kubernát | 624a887 | 2018-03-02 17:28:47 +0100 | [diff] [blame] | 10 | #include <iostream> |
Václav Kubernát | 435706e | 2019-02-20 18:05:59 +0100 | [diff] [blame] | 11 | #include <optional> |
Václav Kubernát | a395d33 | 2019-02-13 16:49:20 +0100 | [diff] [blame] | 12 | #include <replxx.hxx> |
Václav Kubernát | 90de950 | 2019-11-20 17:19:44 +0100 | [diff] [blame] | 13 | #include <sstream> |
Jan Kundrát | dc2b072 | 2018-03-02 14:13:37 +0100 | [diff] [blame] | 14 | #include "NETCONF_CLI_VERSION.h" |
Václav Kubernát | 96344a1 | 2018-05-28 16:33:39 +0200 | [diff] [blame] | 15 | #include "interpreter.hpp" |
Václav Kubernát | 48e9dfa | 2020-07-08 10:55:12 +0200 | [diff] [blame] | 16 | #include "proxy_datastore.hpp" |
Václav Kubernát | e2e15ee | 2020-02-05 17:38:13 +0100 | [diff] [blame] | 17 | #include "yang_schema.hpp" |
Václav Kubernát | b79f3ca | 2020-02-04 15:56:01 +0100 | [diff] [blame] | 18 | #if defined(SYSREPO_CLI) |
Václav Kubernát | 6415b82 | 2018-08-22 17:40:01 +0200 | [diff] [blame] | 19 | #include "sysrepo_access.hpp" |
Václav Kubernát | b79f3ca | 2020-02-04 15:56:01 +0100 | [diff] [blame] | 20 | #define PROGRAM_NAME "sysrepo-cli" |
Václav Kubernát | 715c85c | 2020-04-14 01:46:08 +0200 | [diff] [blame] | 21 | static const auto usage = R"(CLI interface to sysrepo |
| 22 | |
| 23 | Usage: |
| 24 | sysrepo-cli [-d <datastore>] |
| 25 | sysrepo-cli (-h | --help) |
| 26 | sysrepo-cli --version |
| 27 | |
| 28 | Options: |
| 29 | -d <datastore> can be "running" or "startup" [default: running])"; |
Václav Kubernát | 74487df | 2020-06-04 01:29:28 +0200 | [diff] [blame] | 30 | #elif defined(YANG_CLI) |
| 31 | #include <boost/spirit/home/x3.hpp> |
Václav Kubernát | 619e654 | 2020-06-29 14:13:43 +0200 | [diff] [blame] | 32 | #include <filesystem> |
Václav Kubernát | 74487df | 2020-06-04 01:29:28 +0200 | [diff] [blame] | 33 | #include "yang_access.hpp" |
| 34 | #define PROGRAM_NAME "yang-cli" |
| 35 | static const auto usage = R"(CLI interface for creating local YANG data instances |
| 36 | |
Václav Kubernát | 619e654 | 2020-06-29 14:13:43 +0200 | [diff] [blame] | 37 | The <schema_file_or_module_name> argument is treated as a file name if a file |
| 38 | with such a path exists, otherwise it's treated as a module name. Search dirs |
| 39 | will be used to find a schema for that module. |
| 40 | |
Václav Kubernát | 74487df | 2020-06-04 01:29:28 +0200 | [diff] [blame] | 41 | Usage: |
Václav Kubernát | 28cf336 | 2020-06-29 17:52:51 +0200 | [diff] [blame] | 42 | yang-cli [--configonly] [-s <search_dir>] [-e enable_features]... [-i data_file]... <schema_file_or_module_name>... |
Václav Kubernát | 74487df | 2020-06-04 01:29:28 +0200 | [diff] [blame] | 43 | yang-cli (-h | --help) |
| 44 | yang-cli --version |
| 45 | |
| 46 | Options: |
| 47 | -s <search_dir> Set search for schema lookup |
Václav Kubernát | 548cb19 | 2020-06-26 14:00:42 +0200 | [diff] [blame] | 48 | -e <enable_features> Feature to enable after modules are loaded. This option can be supplied more than once. Format: <module_name>:<feature> |
Václav Kubernát | 28cf336 | 2020-06-29 17:52:51 +0200 | [diff] [blame] | 49 | -i <data_file> File to import data from |
| 50 | --configonly Disable editing of operational data)"; |
Václav Kubernát | e2e15ee | 2020-02-05 17:38:13 +0100 | [diff] [blame] | 51 | #elif defined(NETCONF_CLI) |
| 52 | // FIXME: improve usage |
| 53 | static const auto usage = R"(CLI interface for NETCONF |
| 54 | |
| 55 | Usage: |
| 56 | netconf-cli [-v] [-p <port>] <host> |
| 57 | netconf-cli (-h | --help) |
| 58 | netconf-cli --version |
| 59 | |
| 60 | Options: |
| 61 | -v enable verbose mode |
| 62 | -p <port> port number [default: 830] |
| 63 | )"; |
Václav Kubernát | e2e15ee | 2020-02-05 17:38:13 +0100 | [diff] [blame] | 64 | #include "cli-netconf.hpp" |
Václav Kubernát | b4e5b18 | 2020-11-16 19:55:09 +0100 | [diff] [blame] | 65 | #include "netconf_access.hpp" |
Václav Kubernát | e2e15ee | 2020-02-05 17:38:13 +0100 | [diff] [blame] | 66 | #define PROGRAM_NAME "netconf-access" |
Václav Kubernát | fd26116 | 2020-11-12 02:36:29 +0100 | [diff] [blame] | 67 | // FIXME: this should be replaced by C++20 std::jthread at some point |
| 68 | struct PoorMansJThread { |
| 69 | ~PoorMansJThread() |
| 70 | { |
| 71 | if (thread.joinable()) { |
| 72 | thread.join(); |
| 73 | } |
| 74 | } |
| 75 | std::thread thread; |
| 76 | }; |
Václav Kubernát | b79f3ca | 2020-02-04 15:56:01 +0100 | [diff] [blame] | 77 | #else |
| 78 | #error "Unknown CLI backend" |
| 79 | #endif |
Jan Kundrát | dc2b072 | 2018-03-02 14:13:37 +0100 | [diff] [blame] | 80 | |
Václav Kubernát | b79f3ca | 2020-02-04 15:56:01 +0100 | [diff] [blame] | 81 | const auto HISTORY_FILE_NAME = PROGRAM_NAME "_history"; |
| 82 | |
Jan Kundrát | dc2b072 | 2018-03-02 14:13:37 +0100 | [diff] [blame] | 83 | int main(int argc, char* argv[]) |
| 84 | { |
| 85 | auto args = docopt::docopt(usage, |
| 86 | {argv + 1, argv + argc}, |
| 87 | true, |
Václav Kubernát | b79f3ca | 2020-02-04 15:56:01 +0100 | [diff] [blame] | 88 | PROGRAM_NAME " " NETCONF_CLI_VERSION, |
Jan Kundrát | dc2b072 | 2018-03-02 14:13:37 +0100 | [diff] [blame] | 89 | true); |
Václav Kubernát | 28cf336 | 2020-06-29 17:52:51 +0200 | [diff] [blame] | 90 | WritableOps writableOps = WritableOps::No; |
Václav Kubernát | ff2c9f6 | 2018-05-16 20:26:31 +0200 | [diff] [blame] | 91 | |
Václav Kubernát | fd26116 | 2020-11-12 02:36:29 +0100 | [diff] [blame] | 92 | using replxx::Replxx; |
| 93 | Replxx lineEditor; |
| 94 | std::atomic<int> backendReturnCode = 0; |
| 95 | |
Václav Kubernát | b79f3ca | 2020-02-04 15:56:01 +0100 | [diff] [blame] | 96 | #if defined(SYSREPO_CLI) |
Václav Kubernát | 715c85c | 2020-04-14 01:46:08 +0200 | [diff] [blame] | 97 | auto datastoreType = Datastore::Running; |
| 98 | if (const auto& ds = args["-d"]) { |
| 99 | if (ds.asString() == "startup") { |
| 100 | datastoreType = Datastore::Startup; |
| 101 | } else if (ds.asString() == "running") { |
| 102 | datastoreType = Datastore::Running; |
| 103 | } else { |
Václav Kubernát | b4e5b18 | 2020-11-16 19:55:09 +0100 | [diff] [blame] | 104 | std::cerr << PROGRAM_NAME << ": unknown datastore: " << ds.asString() << "\n"; |
Václav Kubernát | 715c85c | 2020-04-14 01:46:08 +0200 | [diff] [blame] | 105 | return 1; |
| 106 | } |
| 107 | } |
Václav Kubernát | 654303f | 2020-07-31 13:16:54 +0200 | [diff] [blame] | 108 | auto datastore = std::make_shared<SysrepoAccess>(datastoreType); |
Václav Kubernát | 715c85c | 2020-04-14 01:46:08 +0200 | [diff] [blame] | 109 | std::cout << "Connected to sysrepo [datastore: " << (datastoreType == Datastore::Startup ? "startup" : "running") << "]" << std::endl; |
Václav Kubernát | 74487df | 2020-06-04 01:29:28 +0200 | [diff] [blame] | 110 | #elif defined(YANG_CLI) |
Václav Kubernát | 48e9dfa | 2020-07-08 10:55:12 +0200 | [diff] [blame] | 111 | auto datastore = std::make_shared<YangAccess>(); |
Václav Kubernát | 28cf336 | 2020-06-29 17:52:51 +0200 | [diff] [blame] | 112 | if (args["--configonly"].asBool()) { |
| 113 | writableOps = WritableOps::No; |
| 114 | } else { |
| 115 | writableOps = WritableOps::Yes; |
| 116 | std::cout << "ops is writable" << std::endl; |
| 117 | } |
Václav Kubernát | 74487df | 2020-06-04 01:29:28 +0200 | [diff] [blame] | 118 | if (const auto& search_dir = args["-s"]) { |
Václav Kubernát | 48e9dfa | 2020-07-08 10:55:12 +0200 | [diff] [blame] | 119 | datastore->addSchemaDir(search_dir.asString()); |
Václav Kubernát | 74487df | 2020-06-04 01:29:28 +0200 | [diff] [blame] | 120 | } |
Václav Kubernát | 619e654 | 2020-06-29 14:13:43 +0200 | [diff] [blame] | 121 | for (const auto& schemaFile : args["<schema_file_or_module_name>"].asStringList()) { |
| 122 | if (std::filesystem::exists(schemaFile)) { |
Václav Kubernát | 48e9dfa | 2020-07-08 10:55:12 +0200 | [diff] [blame] | 123 | datastore->addSchemaFile(schemaFile); |
Václav Kubernát | 619e654 | 2020-06-29 14:13:43 +0200 | [diff] [blame] | 124 | } else if (schemaFile.find('/') == std::string::npos) { // Module names cannot have a slash |
Václav Kubernát | 48e9dfa | 2020-07-08 10:55:12 +0200 | [diff] [blame] | 125 | datastore->loadModule(schemaFile); |
Václav Kubernát | 619e654 | 2020-06-29 14:13:43 +0200 | [diff] [blame] | 126 | } else { |
| 127 | std::cerr << "Cannot load YANG module " << schemaFile << "\n"; |
| 128 | } |
Václav Kubernát | 74487df | 2020-06-04 01:29:28 +0200 | [diff] [blame] | 129 | } |
| 130 | if (const auto& enableFeatures = args["-e"]) { |
| 131 | namespace x3 = boost::spirit::x3; |
| 132 | auto grammar = +(x3::char_-":") >> ":" >> +(x3::char_-":"); |
| 133 | for (const auto& enableFeature : enableFeatures.asStringList()) { |
| 134 | std::pair<std::string, std::string> parsed; |
| 135 | auto it = enableFeature.begin(); |
| 136 | auto res = x3::parse(it, enableFeature.cend(), grammar, parsed); |
| 137 | if (!res || it != enableFeature.cend()) { |
| 138 | std::cerr << "Error parsing feature enable flags: " << enableFeature << "\n"; |
| 139 | return 1; |
| 140 | } |
| 141 | try { |
Václav Kubernát | 48e9dfa | 2020-07-08 10:55:12 +0200 | [diff] [blame] | 142 | datastore->enableFeature(parsed.first, parsed.second); |
Václav Kubernát | 74487df | 2020-06-04 01:29:28 +0200 | [diff] [blame] | 143 | } catch (std::runtime_error& ex) { |
| 144 | std::cerr << ex.what() << "\n"; |
| 145 | return 1; |
| 146 | } |
Václav Kubernát | 74487df | 2020-06-04 01:29:28 +0200 | [diff] [blame] | 147 | } |
| 148 | } |
Václav Kubernát | 548cb19 | 2020-06-26 14:00:42 +0200 | [diff] [blame] | 149 | if (const auto& dataFiles = args["-i"]) { |
| 150 | for (const auto& dataFile : dataFiles.asStringList()) { |
Václav Kubernát | 48e9dfa | 2020-07-08 10:55:12 +0200 | [diff] [blame] | 151 | datastore->addDataFile(dataFile); |
Václav Kubernát | 548cb19 | 2020-06-26 14:00:42 +0200 | [diff] [blame] | 152 | } |
| 153 | } |
Václav Kubernát | e2e15ee | 2020-02-05 17:38:13 +0100 | [diff] [blame] | 154 | #elif defined(NETCONF_CLI) |
| 155 | auto verbose = args.at("-v").asBool(); |
| 156 | if (verbose) { |
| 157 | NetconfAccess::setNcLogLevel(NC_VERB_DEBUG); |
| 158 | } |
| 159 | |
| 160 | SshProcess process; |
Václav Kubernát | fd26116 | 2020-11-12 02:36:29 +0100 | [diff] [blame] | 161 | PoorMansJThread processWatcher; |
Václav Kubernát | e2e15ee | 2020-02-05 17:38:13 +0100 | [diff] [blame] | 162 | std::shared_ptr<NetconfAccess> datastore; |
| 163 | |
| 164 | try { |
| 165 | process = sshProcess(args.at("<host>").asString(), args.at("-p").asString()); |
Václav Kubernát | fd26116 | 2020-11-12 02:36:29 +0100 | [diff] [blame] | 166 | processWatcher.thread = std::thread([&process, &lineEditor, &backendReturnCode] () { |
| 167 | process.process.wait(); |
| 168 | backendReturnCode = process.process.exit_code(); |
| 169 | // CTRL-U clears from the cursor to the start of the line |
| 170 | // CTRL-K clears from the cursor to the end of the line |
| 171 | // CTRL-D send EOF |
| 172 | lineEditor.emulate_key_press(replxx::Replxx::KEY::control('U')); |
| 173 | lineEditor.emulate_key_press(replxx::Replxx::KEY::control('K')); |
| 174 | lineEditor.emulate_key_press(replxx::Replxx::KEY::control('D')); |
| 175 | }); |
Václav Kubernát | e2e15ee | 2020-02-05 17:38:13 +0100 | [diff] [blame] | 176 | datastore = std::make_shared<NetconfAccess>(process.std_out.native_source(), process.std_in.native_sink()); |
| 177 | } catch (std::runtime_error& ex) { |
| 178 | std::cerr << "SSH connection failed: " << ex.what() << "\n"; |
| 179 | return 1; |
| 180 | } |
Václav Kubernát | b79f3ca | 2020-02-04 15:56:01 +0100 | [diff] [blame] | 181 | #else |
| 182 | #error "Unknown CLI backend" |
| 183 | #endif |
| 184 | |
Václav Kubernát | e2e15ee | 2020-02-05 17:38:13 +0100 | [diff] [blame] | 185 | #if defined(SYSREPO_CLI) || defined(NETCONF_CLI) |
Václav Kubernát | e7248b2 | 2020-06-26 15:38:59 +0200 | [diff] [blame] | 186 | auto createTemporaryDatastore = [](const std::shared_ptr<DatastoreAccess>& datastore) { |
| 187 | return std::make_shared<YangAccess>(std::static_pointer_cast<YangSchema>(datastore->schema())); |
| 188 | }; |
| 189 | #elif defined(YANG_CLI) |
| 190 | auto createTemporaryDatastore = [](const std::shared_ptr<DatastoreAccess>&) { |
| 191 | return nullptr; |
| 192 | }; |
| 193 | #endif |
| 194 | |
| 195 | ProxyDatastore proxyDatastore(datastore, createTemporaryDatastore); |
Václav Kubernát | 48e9dfa | 2020-07-08 10:55:12 +0200 | [diff] [blame] | 196 | auto dataQuery = std::make_shared<DataQuery>(*datastore); |
| 197 | Parser parser(datastore->schema(), writableOps, dataQuery); |
Václav Kubernát | 395d92c | 2020-01-24 12:18:18 +0100 | [diff] [blame] | 198 | |
Václav Kubernát | b4e5b18 | 2020-11-16 19:55:09 +0100 | [diff] [blame] | 199 | lineEditor.bind_key(Replxx::KEY::meta(Replxx::KEY::BACKSPACE), [&lineEditor](const auto& code) { |
Václav Kubernát | 4863729 | 2020-07-08 16:54:13 +0200 | [diff] [blame] | 200 | return lineEditor.invoke(Replxx::ACTION::KILL_TO_BEGINING_OF_WORD, code); |
| 201 | }); |
Václav Kubernát | b4e5b18 | 2020-11-16 19:55:09 +0100 | [diff] [blame] | 202 | lineEditor.bind_key(Replxx::KEY::control('W'), [&lineEditor](const auto& code) { |
Václav Kubernát | 4863729 | 2020-07-08 16:54:13 +0200 | [diff] [blame] | 203 | return lineEditor.invoke(Replxx::ACTION::KILL_TO_WHITESPACE_ON_LEFT, code); |
| 204 | }); |
Václav Kubernát | 395d92c | 2020-01-24 12:18:18 +0100 | [diff] [blame] | 205 | |
| 206 | lineEditor.set_word_break_characters("\t _[]/:'\"=-%"); |
| 207 | |
Václav Kubernát | 1ed4aa3 | 2020-01-23 13:13:28 +0100 | [diff] [blame] | 208 | lineEditor.set_completion_callback([&parser](const std::string& input, int& context) { |
Václav Kubernát | a395d33 | 2019-02-13 16:49:20 +0100 | [diff] [blame] | 209 | std::stringstream stream; |
Václav Kubernát | 1ed4aa3 | 2020-01-23 13:13:28 +0100 | [diff] [blame] | 210 | auto completions = parser.completeCommand(input, stream); |
Václav Kubernát | a395d33 | 2019-02-13 16:49:20 +0100 | [diff] [blame] | 211 | |
Jan Kundrát | 8d8efe8 | 2019-10-18 10:21:36 +0200 | [diff] [blame] | 212 | std::vector<replxx::Replxx::Completion> res; |
Václav Kubernát | 1ed4aa3 | 2020-01-23 13:13:28 +0100 | [diff] [blame] | 213 | std::copy(completions.m_completions.begin(), completions.m_completions.end(), std::back_inserter(res)); |
| 214 | context = completions.m_contextLength; |
Václav Kubernát | a395d33 | 2019-02-13 16:49:20 +0100 | [diff] [blame] | 215 | return res; |
| 216 | }); |
Václav Kubernát | 2b68461 | 2018-08-09 18:55:24 +0200 | [diff] [blame] | 217 | |
Václav Kubernát | 435706e | 2019-02-20 18:05:59 +0100 | [diff] [blame] | 218 | std::optional<std::string> historyFile; |
| 219 | if (auto xdgHome = getenv("XDG_DATA_HOME")) { |
| 220 | historyFile = std::string(xdgHome) + "/" + HISTORY_FILE_NAME; |
| 221 | } else if (auto home = getenv("HOME")) { |
| 222 | historyFile = std::string(home) + "/.local/share/" + HISTORY_FILE_NAME; |
| 223 | } |
| 224 | |
Václav Kubernát | 3a43323 | 2020-07-08 17:52:50 +0200 | [diff] [blame] | 225 | if (historyFile) { |
Václav Kubernát | 435706e | 2019-02-20 18:05:59 +0100 | [diff] [blame] | 226 | lineEditor.history_load(historyFile.value()); |
Václav Kubernát | 3a43323 | 2020-07-08 17:52:50 +0200 | [diff] [blame] | 227 | } |
Václav Kubernát | 435706e | 2019-02-20 18:05:59 +0100 | [diff] [blame] | 228 | |
Václav Kubernát | fd26116 | 2020-11-12 02:36:29 +0100 | [diff] [blame] | 229 | while (backendReturnCode == 0) { |
Václav Kubernát | a395d33 | 2019-02-13 16:49:20 +0100 | [diff] [blame] | 230 | auto line = lineEditor.input(parser.currentNode() + "> "); |
| 231 | if (!line) { |
Václav Kubernát | 82bf131 | 2019-11-05 11:19:26 +0100 | [diff] [blame] | 232 | // If user pressed CTRL-C to abort the line, errno gets set to EAGAIN. |
| 233 | // If user pressed CTRL-D (for EOF), errno doesn't get set to EAGAIN, so we exit the program. |
| 234 | // I have no idea why replxx uses errno for this. |
| 235 | if (errno == EAGAIN) { |
| 236 | continue; |
| 237 | } else { |
| 238 | break; |
| 239 | } |
Václav Kubernát | 5b80e52 | 2019-01-25 12:17:03 +0100 | [diff] [blame] | 240 | } |
Václav Kubernát | ff2c9f6 | 2018-05-16 20:26:31 +0200 | [diff] [blame] | 241 | |
Jan Kundrát | e387702 | 2018-09-05 15:32:09 +0200 | [diff] [blame] | 242 | std::locale C_locale("C"); |
Václav Kubernát | a395d33 | 2019-02-13 16:49:20 +0100 | [diff] [blame] | 243 | std::string_view view{line}; |
| 244 | if (std::all_of(view.begin(), view.end(), |
Jan Kundrát | e387702 | 2018-09-05 15:32:09 +0200 | [diff] [blame] | 245 | [C_locale](const auto c) { return std::isspace(c, C_locale);})) { |
| 246 | continue; |
| 247 | } |
| 248 | |
Václav Kubernát | ff2c9f6 | 2018-05-16 20:26:31 +0200 | [diff] [blame] | 249 | try { |
Václav Kubernát | 5b80e52 | 2019-01-25 12:17:03 +0100 | [diff] [blame] | 250 | command_ cmd = parser.parseCommand(line, std::cout); |
Václav Kubernát | 48e9dfa | 2020-07-08 10:55:12 +0200 | [diff] [blame] | 251 | boost::apply_visitor(Interpreter(parser, proxyDatastore), cmd); |
Václav Kubernát | ff2c9f6 | 2018-05-16 20:26:31 +0200 | [diff] [blame] | 252 | } catch (InvalidCommandException& ex) { |
| 253 | std::cerr << ex.what() << std::endl; |
Václav Kubernát | c58e4aa | 2019-04-03 18:37:32 +0200 | [diff] [blame] | 254 | } catch (DatastoreException& ex) { |
| 255 | std::cerr << ex.what() << std::endl; |
Václav Kubernát | e7248b2 | 2020-06-26 15:38:59 +0200 | [diff] [blame] | 256 | } catch (std::runtime_error& ex) { |
| 257 | std::cerr << ex.what() << std::endl; |
Václav Kubernát | ff2c9f6 | 2018-05-16 20:26:31 +0200 | [diff] [blame] | 258 | } |
Václav Kubernát | 5b80e52 | 2019-01-25 12:17:03 +0100 | [diff] [blame] | 259 | |
Václav Kubernát | a395d33 | 2019-02-13 16:49:20 +0100 | [diff] [blame] | 260 | lineEditor.history_add(line); |
Václav Kubernát | ff2c9f6 | 2018-05-16 20:26:31 +0200 | [diff] [blame] | 261 | } |
| 262 | |
Václav Kubernát | 3a43323 | 2020-07-08 17:52:50 +0200 | [diff] [blame] | 263 | if (historyFile) { |
Václav Kubernát | 435706e | 2019-02-20 18:05:59 +0100 | [diff] [blame] | 264 | lineEditor.history_save(historyFile.value()); |
Václav Kubernát | 3a43323 | 2020-07-08 17:52:50 +0200 | [diff] [blame] | 265 | } |
Václav Kubernát | 435706e | 2019-02-20 18:05:59 +0100 | [diff] [blame] | 266 | |
Václav Kubernát | fd26116 | 2020-11-12 02:36:29 +0100 | [diff] [blame] | 267 | return backendReturnCode; |
Jan Kundrát | dc2b072 | 2018-03-02 14:13:37 +0100 | [diff] [blame] | 268 | } |