capture des arguments depuis l'appel de fonction
This commit is contained in:
@@ -2,7 +2,9 @@
|
|||||||
use std::env;
|
use std::env;
|
||||||
|
|
||||||
pub fn arguments() -> Vec<String> {
|
pub fn arguments() -> Vec<String> {
|
||||||
let mut pipicaca = Vec::new();
|
let mut args_to_process = Vec::new();
|
||||||
pipicaca.push("popo");
|
for argument in env::args() {
|
||||||
pipicaca
|
args_to_process.push(argument);
|
||||||
|
}
|
||||||
|
args_to_process
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
// boucle principale
|
// boucle principale
|
||||||
|
pub mod display;
|
||||||
pub mod get;
|
pub mod get;
|
||||||
pub mod parse;
|
pub mod parse;
|
||||||
pub mod display;
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
get::arguments();
|
let args_to_process = get::arguments();
|
||||||
parse::arguments();
|
parse::arguments(args_to_process);
|
||||||
display::result();
|
display::result();
|
||||||
println!("Hello, world!");
|
println!("Hello, world!");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user