Skip to content

Commit 62d25c9

Browse files
committed
glcli: Rename package
In ordert to stick to the naming scheme that has established around greenlight crates which is `gl-<package>` we change the name of the crate to be published to crates.io. When using the binary, the newly introduced hyphen might be a bit cumbersome so we keep the name of the binary `glcli`. Signed-off-by: Peter Neuroth <[email protected]>
1 parent e895ada commit 62d25c9

File tree

4 files changed

+49
-30
lines changed

4 files changed

+49
-30
lines changed

Cargo.lock

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

libs/gl-cli/Cargo.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "glcli"
2+
name = "gl-cli"
33
version = "0.1.0"
44
edition = "2021"
55
authors = ["Peter Neuroth <[email protected]>"]
@@ -12,6 +12,11 @@ categories = ["command-line-utlis", "cryptography::cryptocurrencies"]
1212
license = "MIT"
1313
reademe = "README.md"
1414

15+
[[bin]]
16+
name = "glcli"
17+
test = true
18+
doc = true
19+
1520
[dependencies]
1621
clap = { version = "4.5", features = ["derive"] }
1722
dirs = "6.0"

libs/gl-cli/src/bin/glcli.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
use clap::Parser;
2+
use gl_cli::{run, Cli};
3+
4+
#[tokio::main]
5+
async fn main() {
6+
let cli = Cli::parse();
7+
8+
match run(cli).await {
9+
Ok(()) => (),
10+
Err(e) => {
11+
println!("{}", e);
12+
}
13+
}
14+
}
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ mod util;
1111

1212
#[derive(Parser, Debug)]
1313
#[command(author, version, about, long_about = None)]
14-
struct Cli {
14+
pub struct Cli {
1515
/// The directory containing the seed and the credentials
1616
#[arg(short, long, global = true, help_heading = "Global options")]
1717
data_dir: Option<String>,
@@ -25,7 +25,7 @@ struct Cli {
2525
}
2626

2727
#[derive(Subcommand, Debug)]
28-
enum Commands {
28+
pub enum Commands {
2929
/// Interact with the scheduler that is the brain of most operations
3030
#[command(subcommand)]
3131
Scheduler(scheduler::Command),
@@ -37,19 +37,19 @@ enum Commands {
3737
Node(node::Command),
3838
}
3939

40-
#[tokio::main]
41-
async fn main() {
42-
let cli = Cli::parse();
40+
//#[tokio::main]
41+
//async fn main() {
42+
// let cli = Cli::parse();
43+
//
44+
// match run(cli).await {
45+
// Ok(()) => (),
46+
// Err(e) => {
47+
// println!("{}", e);
48+
// }
49+
// }
50+
//}
4351

44-
match run(cli).await {
45-
Ok(()) => (),
46-
Err(e) => {
47-
println!("{}", e);
48-
}
49-
}
50-
}
51-
52-
async fn run(cli: Cli) -> Result<()> {
52+
pub async fn run(cli: Cli) -> Result<()> {
5353
if cli.verbose {
5454
if std::env::var("RUST_LOG").is_err() {
5555
std::env::set_var("RUST_LOG", "debug")

0 commit comments

Comments
 (0)