Page MenuHomeDevCentral

D2751.id6986.diff
No OneTemporary

D2751.id6986.diff

diff --git a/fantoir-datasource/src/commands/query.rs b/fantoir-datasource/src/commands/query.rs
--- a/fantoir-datasource/src/commands/query.rs
+++ b/fantoir-datasource/src/commands/query.rs
@@ -48,13 +48,21 @@
async fn search_libelle(pool: &PgPool, args: QueryArgs) {
let expression = args.libelle.join(" ");
- query_libelle(pool, &expression)
- .await
- .iter()
- .filter(|&entry| entry_matches_conditions(entry, &args))
- .for_each(|entry| {
- println!("{}", entry);
- });
+ let mut found = false;
+
+ query_libelle(pool, &expression)
+ .await
+ .iter()
+ .filter(|&entry| entry_matches_conditions(entry, &args))
+ .for_each(|entry| {
+ found = true;
+
+ println!("{}", entry);
+ });
+
+ if !found {
+ exit(EXIT_CODE_NO_RESULT_FOUND);
+ }
}
fn entry_matches_conditions(entry: &FantoirVoieResult, conditions: &QueryArgs) -> bool {

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 19, 09:26 (21 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2252319
Default Alt Text
D2751.id6986.diff (964 B)

Event Timeline