Page MenuHomeDevCentral

D2751.diff
No OneTemporary

D2751.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
Sat, Dec 21, 10:25 (17 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2309362
Default Alt Text
D2751.diff (964 B)

Event Timeline