This commit is contained in:
2025-05-02 15:12:52 +02:00
parent a2a6933058
commit 6bfc272c46
4 changed files with 167 additions and 6 deletions

View File

@@ -9,7 +9,7 @@ macro_rules! argdef {
pub fn usage() -> &'static str {
concat!("usage: ", $program_name, " ", $("[", stringify!($arg_id), "] "),*)
}
$(pub fn $arg_id(&self) -> &str { &self.$arg_id })*
}
@@ -39,7 +39,7 @@ macro_rules! argdef {
}
argdef!{
args Args("theseus-server") {
config_path,
}

View File

@@ -178,6 +178,11 @@ async fn new_question(
));
};
let question = question.to_string();
if question.len() == 0 {
return Ok(response!(main_page req,
"info", "You sent an empty question. Please try again."
));
}
// insert question
match state.questions.lock().await.add_new(question) {