mirror of
https://github.com/monero-project/monero.git
synced 2025-05-06 14:25:01 -04:00
Construct on first use for completion_commands
This commit is contained in:
parent
67dd4933e6
commit
1249a2a550
2 changed files with 23 additions and 15 deletions
|
@ -21,23 +21,15 @@ namespace rdln
|
|||
}
|
||||
void get_line(std::string& line) const;
|
||||
void set_prompt(const std::string& prompt);
|
||||
static void add_completion(const std::string& command)
|
||||
{
|
||||
if(std::find(completion_commands.begin(), completion_commands.end(), command) != completion_commands.end())
|
||||
return;
|
||||
completion_commands.push_back(command);
|
||||
}
|
||||
static const std::vector<std::string>& get_completions()
|
||||
{
|
||||
return completion_commands;
|
||||
}
|
||||
static void add_completion(const std::string& command);
|
||||
static const std::vector<std::string>& get_completions();
|
||||
|
||||
protected:
|
||||
virtual int sync();
|
||||
|
||||
private:
|
||||
std::streambuf* m_cout_buf;
|
||||
static std::vector<std::string> completion_commands;
|
||||
static std::vector<std::string>& completion_commands();
|
||||
};
|
||||
|
||||
class suspend_readline
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue