Skip to content

Commit 28592b4

Browse files
authored
Merge pull request #3 from typester/version
feat: add --version command
2 parents e667c47 + 0999556 commit 28592b4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/main.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ struct Cli {
162162
/// inline query or @file for subscription mode; defaults to stdin when omitted
163163
#[argh(positional)]
164164
query: Option<String>,
165+
166+
/// show version information
167+
#[argh(switch)]
168+
version: bool,
165169
}
166170

167171
#[tokio::main(flavor = "multi_thread", worker_threads = 2)]
@@ -180,8 +184,14 @@ async fn main() -> Result<()> {
180184
listen,
181185
endpoint,
182186
query,
187+
version,
183188
} = argh::from_env();
184189

190+
if version {
191+
println!("riverql {}", env!("CARGO_PKG_VERSION"));
192+
return Ok(());
193+
}
194+
185195
if server {
186196
if endpoint.is_some() || query.is_some() {
187197
bail!("--server does not take endpoint or query arguments");

0 commit comments

Comments
 (0)