MCPcopy Create free account
hub / github.com/Genivia/ugrep / confirm

Method confirm

src/query.cpp:3131–3149  ·  view source on GitHub ↗

return true if prompt is confirmed

Source from the content-addressed store, hash-verified

3129
3130// return true if prompt is confirmed
3131bool Query::confirm(const char *prompt)
3132{
3133 if (!flag_confirm)
3134 return true;
3135
3136 message(std::string(prompt).append("? (y/n) [n] "));
3137
3138 VKey::flush();
3139
3140 int key = VKey::get();
3141
3142 if (key == 'y' || key == 'Y')
3143 return true;
3144
3145 message_ = false;
3146 draw();
3147
3148 return false;
3149}
3150
3151// display help page
3152bool Query::help()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected