Skip to content

Commit

Permalink
Merge pull request #12 from wiseaidev/chapter-8
Browse files Browse the repository at this point in the history
add chapter 8
  • Loading branch information
wiseaidev authored Dec 10, 2023
2 parents 9f830fe + 4d6a599 commit e3e4128
Show file tree
Hide file tree
Showing 36 changed files with 4,630 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.ipynb_checkpoints/
.ipynb_checkpoints/
**/target/**
223 changes: 223 additions & 0 deletions chapter-8/1-find-replace/Cargo.lock

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

9 changes: 9 additions & 0 deletions chapter-8/1-find-replace/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[package]
name = "find-replace"
version = "0.1.0"
edition = "2021"

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

[dependencies]
clap = { version = "4.4.11", features = ["derive"] }
21 changes: 21 additions & 0 deletions chapter-8/1-find-replace/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
use clap::Parser;

#[derive(Parser, Debug)]
#[command(
author = "Mahmoud Harmouch",
version = "1.0",
about = "A command-line find and replace utility",
name = "find-replace"
)]
struct Args {
/// Sets the input file to process
#[arg(short = 'i', long = "input")]
input: String,
}

fn main() {
// Access and use the `input` argument here
let args = Args::parse();

println!("Parsed Input file name: {}!", args.input);
}
Loading

0 comments on commit e3e4128

Please sign in to comment.