Page MenuHomeDevCentral

D2751.id.diff
No OneTemporary

D2751.id.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
Sun, Nov 24, 13:51 (6 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2260272
Default Alt Text
D2751.id.diff (964 B)

Event Timeline