add basic tab completion to console

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-07-05 07:52:05 +00:00
parent b31e81a469
commit 5254eb4f72
4 changed files with 134 additions and 52 deletions

View file

@ -30,6 +30,12 @@ mod_dtor! {}
/// Install the admin command handler
#[allow(clippy::let_underscore_must_use)]
pub async fn init() {
_ = services()
.admin
.complete
.write()
.expect("locked for writing")
.insert(handler::complete);
_ = services().admin.handle.lock().await.insert(handler::handle);
}
@ -37,6 +43,12 @@ pub async fn init() {
#[allow(clippy::let_underscore_must_use)]
pub async fn fini() {
_ = services().admin.handle.lock().await.take();
_ = services()
.admin
.complete
.write()
.expect("locked for writing")
.take();
}
#[cfg(test)]