Skip to content

Commit 3c39bf6

Browse files
Basic help for registry, --show-X
1 parent 6813051 commit 3c39bf6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+520
-8
lines changed

aggregator/src/array.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ impl AggregatorBe for ImplBe {
1717
return vec!["array", "arr"];
1818
}
1919

20+
fn help_meta() -> Option<&'static str> {
21+
return Some("key");
22+
}
23+
24+
fn help_msg() -> &'static str {
25+
return "collect values into an array";
26+
}
27+
2028
fn add(state: &mut Vec<Record>, a: &Arc<str>, r: Record) {
2129
state.push(r.get_path(a));
2230
}

aggregator/src/average.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ impl AggregatorBe for ImplBe {
1717
return vec!["average", "avg"];
1818
}
1919

20+
fn help_meta() -> Option<&'static str> {
21+
return Some("key");
22+
}
23+
24+
fn help_msg() -> &'static str {
25+
return "compute average of numeric values";
26+
}
27+
2028
fn add(state: &mut (f64, f64), a: &Arc<str>, r: Record) {
2129
let v = r.get_path(a);
2230
let v = v.coerce_f64();

aggregator/src/concat.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ impl AggregatorBe for ImplBe {
1717
return vec!["concatenate", "concat"];
1818
}
1919

20+
fn help_meta() -> Option<&'static str> {
21+
return Some("delim,key");
22+
}
23+
24+
fn help_msg() -> &'static str {
25+
return "collect values into a string joined by a delimter";
26+
}
27+
2028
fn add(state: &mut Vec<String>, a: &(Arc<str>, Arc<str>), r: Record) {
2129
state.push(r.get_path(&a.1).expect_string().to_string());
2230
}

aggregator/src/count.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ impl AggregatorBe for ImplBe {
1515
return vec!["count", "ct"];
1616
}
1717

18+
fn help_msg() -> &'static str {
19+
return "count records";
20+
}
21+
1822
fn add(state: &mut i64, _a: &(), _r: Record) {
1923
*state += 1;
2024
}

aggregator/src/count_by.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ impl AggregatorBe for ImplBe {
1818
return vec!["countby", "ctby", "cb"];
1919
}
2020

21+
fn help_meta() -> Option<&'static str> {
22+
return Some("key");
23+
}
24+
25+
fn help_msg() -> &'static str {
26+
return "collect counts of values into a hash";
27+
}
28+
2129
fn add(state: &mut HashMap<Arc<str>, i64>, a: &Arc<str>, r: Record) {
2230
*state.entry(r.get_path(a).expect_string()).or_insert(0) += 1;
2331
}

aggregator/src/distinct_array.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ impl AggregatorBe for ImplBe {
5151
return vec!["darray", "darr"];
5252
}
5353

54+
fn help_meta() -> Option<&'static str> {
55+
return Some("key");
56+
}
57+
58+
fn help_msg() -> &'static str {
59+
return "collect distinct values into an array";
60+
}
61+
5462
fn add(state: &mut DistinctSet<Record>, a: &Arc<str>, r: Record) {
5563
state.add(r.get_path(&a));
5664
}

aggregator/src/distinct_concat.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ impl AggregatorBe for ImplBe {
1818
return vec!["dconcatenate", "dconcat"];
1919
}
2020

21+
fn help_meta() -> Option<&'static str> {
22+
return Some("key");
23+
}
24+
25+
fn help_msg() -> &'static str {
26+
return "collect distinct values into a string joined by a delimter";
27+
}
28+
2129
fn add(state: &mut DistinctSet<String>, a: &(Arc<str>, Arc<str>), r: Record) {
2230
state.add(r.get_path(&a.1).expect_string().to_string());
2331
}

aggregator/src/distinct_count.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ impl AggregatorBe for ImplBe {
1717
return vec!["dcount", "dct"];
1818
}
1919

20+
fn help_meta() -> Option<&'static str> {
21+
return Some("key");
22+
}
23+
24+
fn help_msg() -> &'static str {
25+
return "count distinct values";
26+
}
27+
2028
fn add(state: &mut DistinctSet<Record>, a: &Arc<str>, r: Record) {
2129
state.add(r.get_path(&a));
2230
}

aggregator/src/first.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ impl AggregatorBe for ImplBe {
1616
return vec!["first"];
1717
}
1818

19+
fn help_meta() -> Option<&'static str> {
20+
return Some("key");
21+
}
22+
23+
fn help_msg() -> &'static str {
24+
return "track the first value";
25+
}
26+
1927
fn add(state: &mut Option<Record>, a: &Arc<str>, r: Record) {
2028
state.get_or_insert(r.get_path(a));
2129
}

aggregator/src/first_record.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ impl AggregatorBe for ImplBe {
1515
return vec!["firstrecord", "firstrec"];
1616
}
1717

18+
fn help_msg() -> &'static str {
19+
return "track first record";
20+
}
21+
1822
fn add(state: &mut Option<Record>, _a: &(), r: Record) {
1923
state.get_or_insert(r);
2024
}

0 commit comments

Comments
 (0)