Skip to content

Commit

Permalink
Update to nushell 0.98.0
Browse files Browse the repository at this point in the history
usage() is now description()
  • Loading branch information
drbrain committed Sep 24, 2024
1 parent 804487e commit b4b16c9
Show file tree
Hide file tree
Showing 12 changed files with 66 additions and 76 deletions.
102 changes: 46 additions & 56 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ categories = ["command-line-utilities"]
[dependencies]
chrono = "0.4.38"
nom = "7.1.3"
nu-plugin = "0.96.1"
nu-protocol = { version = "0.96.1", features = [ "plugin" ] }
nu-plugin = "0.98.0"
nu-protocol = { version = "0.98.0", features = [ "plugin" ] }
prometheus-http-query = "0.8.3"
reqwest = { version = "0.12.5", features = [ "native-tls" ] }
tokio = { version ="1.40.0", features = [ "macros", "rt" ] }
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
A nushell plugin for querying prometheus

Supports:
* nushell 0.96.1
* nushell 0.98.0
* Prometheus API
* Instant queries
* Range queryies
Expand Down
4 changes: 2 additions & 2 deletions src/prometheus/label_names_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ impl SimplePluginCommand for LabelNamesCommand {

fn signature(&self) -> Signature {
Signature::build(self.name())
.usage(self.usage())
.description(self.description())
.named(
"start",
SyntaxShape::DateTime,
Expand Down Expand Up @@ -50,7 +50,7 @@ impl SimplePluginCommand for LabelNamesCommand {
])
}

fn usage(&self) -> &str {
fn description(&self) -> &str {
"Query for label names"
}

Expand Down
4 changes: 2 additions & 2 deletions src/prometheus/label_values_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ impl SimplePluginCommand for LabelValuesCommand {

fn signature(&self) -> Signature {
Signature::build(self.name())
.usage(self.usage())
.description(self.description())
.named(
"start",
SyntaxShape::DateTime,
Expand Down Expand Up @@ -55,7 +55,7 @@ impl SimplePluginCommand for LabelValuesCommand {
])
}

fn usage(&self) -> &str {
fn description(&self) -> &str {
"Query for label values"
}

Expand Down
4 changes: 2 additions & 2 deletions src/prometheus/metric_metadata_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ impl SimplePluginCommand for MetricMetadataCommand {

fn signature(&self) -> nu_protocol::Signature {
Signature::build(self.name())
.usage(self.usage())
.description(self.description())
.named(
"source",
SyntaxShape::String,
Expand Down Expand Up @@ -46,7 +46,7 @@ impl SimplePluginCommand for MetricMetadataCommand {
])
}

fn usage(&self) -> &str {
fn description(&self) -> &str {
"Retrieve metric metadata"
}

Expand Down
2 changes: 1 addition & 1 deletion src/prometheus/prometheus_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ impl SimplePluginCommand for PrometheusCommand {
Signature::build(self.name()).input_output_type(Type::Nothing, Type::Nothing)
}

fn usage(&self) -> &str {
fn description(&self) -> &str {
"Prometheus plugin"
}

Expand Down
4 changes: 2 additions & 2 deletions src/prometheus/query_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ impl SimplePluginCommand for QueryCommand {

fn signature(&self) -> Signature {
Signature::build(self.name())
.usage(self.usage())
.description(self.description())
.named(
"at",
SyntaxShape::DateTime,
Expand All @@ -38,7 +38,7 @@ impl SimplePluginCommand for QueryCommand {
.input_output_type(Type::String, Type::Any)
}

fn usage(&self) -> &str {
fn description(&self) -> &str {
"Run an instant query"
}

Expand Down
4 changes: 2 additions & 2 deletions src/prometheus/query_range_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ impl SimplePluginCommand for QueryRangeCommand {

fn signature(&self) -> Signature {
Signature::build(self.name())
.usage(self.usage())
.description(self.description())
.named(
"start",
SyntaxShape::DateTime,
Expand Down Expand Up @@ -50,7 +50,7 @@ impl SimplePluginCommand for QueryRangeCommand {
.input_output_type(Type::String, Type::Any)
}

fn usage(&self) -> &str {
fn description(&self) -> &str {
"Run a range query"
}

Expand Down
Loading

0 comments on commit b4b16c9

Please sign in to comment.