From 39abaca4e03f0df1dc4c6ddda081b1774906c4cc Mon Sep 17 00:00:00 2001 From: Hatmos Date: Mon, 6 Jul 2026 01:14:24 +0200 Subject: [PATCH] capture des arguments depuis l'appel de fonction --- src/get.rs | 12 +++++++----- src/main.rs | 6 +++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/get.rs b/src/get.rs index 4cfec2c..120ffcb 100644 --- a/src/get.rs +++ b/src/get.rs @@ -1,8 +1,10 @@ // recupere les arguments passes entree de l'appel du programme use std::env; -pub fn arguments() -> Vec { - let mut pipicaca = Vec::new(); - pipicaca.push("popo"); - pipicaca -} \ No newline at end of file +pub fn arguments() -> Vec { + let mut args_to_process = Vec::new(); + for argument in env::args() { + args_to_process.push(argument); + } + args_to_process +} diff --git a/src/main.rs b/src/main.rs index 27f95db..a4acc16 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,11 +1,11 @@ // boucle principale +pub mod display; pub mod get; pub mod parse; -pub mod display; fn main() { - get::arguments(); - parse::arguments(); + let args_to_process = get::arguments(); + parse::arguments(args_to_process); display::result(); println!("Hello, world!"); }