Skip to content

Commit

Permalink
Merge pull request #133 from Jimskapt/FR-ch12-01
Browse files Browse the repository at this point in the history
Translating ch12-01 in French.
  • Loading branch information
Jimskapt authored Jul 1, 2021
2 parents cfb0cf2 + 04b7dca commit 7e03466
Show file tree
Hide file tree
Showing 26 changed files with 500 additions and 0 deletions.

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]
name = "minigrep"
version = "0.1.0"
authors = ["Your Name <[email protected]>"]
edition = "2018"

[dependencies]
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
$ cargo run
Compiling minigrep v0.1.0 (file:///projects/minigrep)
Finished dev [unoptimized + debuginfo] target(s) in 0.61s
Running `target/debug/minigrep`
["target/debug/minigrep"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
use std::env;

fn main() {
let args: Vec<String> = env::args().collect();
println!("{:?}", args);
}

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]
name = "minigrep"
version = "0.1.0"
authors = ["Your Name <[email protected]>"]
edition = "2018"

[dependencies]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$ cargo run test sample.txt
Compiling minigrep v0.1.0 (file:///projects/minigrep)
Finished dev [unoptimized + debuginfo] target(s) in 0.0s
Running `target/debug/minigrep test sample.txt`
Searching for test
In file sample.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
use std::env;

fn main() {
let args: Vec<String> = env::args().collect();

let query = &args[1];
let filename = &args[2];

println!("Searching for {}", query);
println!("In file {}", filename);
}

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]
name = "minigrep"
version = "0.1.0"
authors = ["Your Name <[email protected]>"]
edition = "2018"

[dependencies]
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
$ cargo run needle haystack
Compiling minigrep v0.1.0 (file:///projects/minigrep)
Finished dev [unoptimized + debuginfo] target(s) in 1.57s
Running `target/debug/minigrep needle haystack`
["target/debug/minigrep", "needle", "haystack"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
use std::env;

fn main() {
let args: Vec<String> = env::args().collect();
println!("{:?}", args);
}
6 changes: 6 additions & 0 deletions FRENCH/listings/ch12-an-io-project/listing-12-01/Cargo.lock

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

7 changes: 7 additions & 0 deletions FRENCH/listings/ch12-an-io-project/listing-12-01/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]
name = "minigrep"
version = "0.1.0"
authors = ["Your Name <[email protected]>"]
edition = "2018"

[dependencies]
5 changes: 5 additions & 0 deletions FRENCH/listings/ch12-an-io-project/listing-12-01/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
$ cargo run
Compiling minigrep v0.1.0 (file:///projects/minigrep)
Finished dev [unoptimized + debuginfo] target(s) in 0.61s
Running `target/debug/minigrep`
["target/debug/minigrep"]
6 changes: 6 additions & 0 deletions FRENCH/listings/ch12-an-io-project/listing-12-01/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
use std::env;

fn main() {
let args: Vec<String> = env::args().collect();
println!("{:?}", args);
}
6 changes: 6 additions & 0 deletions FRENCH/listings/ch12-an-io-project/listing-12-02/Cargo.lock

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

7 changes: 7 additions & 0 deletions FRENCH/listings/ch12-an-io-project/listing-12-02/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]
name = "minigrep"
version = "0.1.0"
authors = ["Your Name <[email protected]>"]
edition = "2018"

[dependencies]
6 changes: 6 additions & 0 deletions FRENCH/listings/ch12-an-io-project/listing-12-02/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$ cargo run test exemple.txt
Compiling minigrep v0.1.0 (file:///projects/minigrep)
Finished dev [unoptimized + debuginfo] target(s) in 0.0s
Running `target/debug/minigrep test exemple.txt`
On recherche : test
Dans le fichier : exemple.txt
11 changes: 11 additions & 0 deletions FRENCH/listings/ch12-an-io-project/listing-12-02/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
use std::env;

fn main() {
let args: Vec<String> = env::args().collect();

let recherche = &args[1];
let nom_fichier = &args[2];

println!("On recherche : {}", recherche);
println!("Dans le fichier : {}", nom_fichier);
}

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]
name = "minigrep"
version = "0.1.0"
authors = ["Your Name <[email protected]>"]
edition = "2018"

[dependencies]
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
$ cargo run aiguille botte_de_foin
Compiling minigrep v0.1.0 (file:///projects/minigrep)
Finished dev [unoptimized + debuginfo] target(s) in 1.57s
Running `target/debug/minigrep aiguille botte_de_foin`
["target/debug/minigrep", "aiguille", "botte_de_foin"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
use std::env;

fn main() {
let args: Vec<String> = env::args().collect();
println!("{:?}", args);
}
1 change: 1 addition & 0 deletions FRENCH/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,4 @@
- [L'organisation des tests](ch11-03-test-organization.md)

- [Un projet d'entrée/sortie : construire un programme en ligne de commande](ch12-00-an-io-project.md)
- [Récupérer les arguments de la ligne de commande](ch12-01-accepting-command-line-arguments.md)
Loading

0 comments on commit 7e03466

Please sign in to comment.