-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
Translating ch12-01 in French.
- Loading branch information
There are no files selected for viewing
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); | ||
} |
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 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 |
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); | ||
} |