Skip to content

Commit

Permalink
Initial CLI push
Browse files Browse the repository at this point in the history
  • Loading branch information
hoffmabc committed Apr 8, 2023
1 parent 2ec63ab commit 05ac8dd
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
11 changes: 11 additions & 0 deletions openbazaar-cli/Cargo.toml
@@ -0,0 +1,11 @@
[package]
name = "openbazaar-cli"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
openbazaar-lib = { path = "../openbazaar-lib" }
anyhow = "1.0.70"
structopt = "0.3.26"
21 changes: 21 additions & 0 deletions openbazaar-cli/src/main.rs
@@ -0,0 +1,21 @@
use openbazaar_lib::Client;
use std::path::PathBuf;
use structopt::StructOpt;

#[derive(Debug, StructOpt)]
struct Opt {
#[structopt(long, default_value = "http://127.0.0.1:8010")]
server: String,
#[structopt(parse(from_os_str))]
db_path: PathBuf,
}

fn main() -> anyhow::Result<()> {
let opt = Opt::from_args();
let mut client = Client::new(opt.db_path).unwrap();

println!("Connecting to server: {}", opt.server);
client.connect(opt.server)?;

Ok(())
}

0 comments on commit 05ac8dd

Please sign in to comment.