MCPcopy Create free account
hub / github.com/MemNixFS/MemNixFS / parse_fish_cmd

Function parse_fish_cmd

src/os/linux/bash_history.cpp:246–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

244}
245
246bool parse_fish_cmd(const std::string& line, std::string& command) {
247 std::string t = trim(line);
248 const std::string k1 = "- cmd:";
249 const std::string k2 = "cmd:";
250 if (t.rfind(k1, 0) == 0) command = trim(t.substr(k1.size()));
251 else if (t.rfind(k2, 0) == 0) command = trim(t.substr(k2.size()));
252 else return false;
253 return looks_like_command(ByteBuf(command.begin(), command.end()));
254}
255
256std::vector<std::string> extract_printable_strings(const std::vector<u8>& buf,
257 std::size_t min_len = 4) {

Callers 1

scan_shell_historyFunction · 0.85

Calls 3

trimFunction · 0.85
looks_like_commandFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected