Skip to content

Commit a7e287a

Browse files
committed
fix: simple setup
1 parent 519a09d commit a7e287a

6 files changed

Lines changed: 172 additions & 6 deletions

File tree

Cargo.lock

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

Cargo.toml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
[package]
2-
name = "cli"
3-
version = "0.1.0"
2+
name = "rust-basel-cli"
3+
version = "0.0.1"
44
edition = "2024"
5+
authors = ["rust-basel"]
6+
description = "The cli to explore meetups and interact"
7+
license = "MIT"
8+
repository = "https://github.com/rust-basel/cli"
9+
keywords = ["cli"]
10+
categories = ["command-line-utilities"]
11+
12+
[[bin]]
13+
name = "basel"
14+
path = "src/main.rs"
515

616
[dependencies]
17+
argh = "0.1.13"

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
# cli
1+
# cli
2+
3+
Welcome to the rust cli
4+
5+
6+
### Crates used:
7+
8+
- https://github.com/google/argh

public_files/meetups.toml

Whitespace-only changes.

src/main.rs

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
mod meetups;
2+
3+
use argh::FromArgs;
4+
5+
#[derive(FromArgs, PartialEq, Debug)]
6+
/// The Rust-Basel cli.
7+
struct Basel {
8+
#[argh(subcommand)]
9+
nested: Commands,
10+
}
11+
12+
#[derive(FromArgs, PartialEq, Debug)]
13+
#[argh(subcommand)]
14+
enum Commands {
15+
One(JobCommand),
16+
Two(MeetupCommand),
17+
}
18+
19+
#[derive(FromArgs, PartialEq, Debug)]
20+
/// First subcommand.
21+
#[argh(subcommand, name = "job")]
22+
struct JobCommand {}
23+
24+
#[derive(FromArgs, PartialEq, Debug)]
25+
/// Second subcommand.
26+
#[argh(subcommand, name = "meetup")]
27+
struct MeetupCommand {}
28+
129
fn main() {
2-
println!("Hello, world!");
30+
let up: Basel = argh::from_env();
331
}

src/meetups/mod.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
pub struct Meetup {
2+
pub id: u32,
3+
pub title: String,
4+
pub date: String,
5+
pub location: String,
6+
pub description: String,
7+
pub sponsors: Vec<Sponsor>,
8+
}
9+
10+
pub struct Sponsor {
11+
pub name: String,
12+
pub website: Option<String>,
13+
pub content: Option<String>,
14+
}

0 commit comments

Comments
 (0)