Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SCRIPT RUBY]Passer une option sur la ligne commande(résolu)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index French
View previous topic :: View next topic  
Author Message
man in the hill
Veteran
Veteran


Joined: 15 Dec 2005
Posts: 1552
Location: Madinina

PostPosted: Tue Aug 29, 2006 3:05 pm    Post subject: [SCRIPT RUBY]Passer une option sur la ligne commande(résolu Reply with quote

Bonjour,



J'ai écri un script qui se trouve ici http://www.guidelinux.org/phpBB/viewtopic.php?t=719&start=15 **(en bas..)

Pour l'instant j'appelle le script et ensuite je rentre le nom avec ou sans extension du fichier et il va décompresser ou décompresser/compiler :
Code:
faya@crazy_gentoo ~ $
 ./rads

************************************************************
Entrez le nom du fichier  à décompresser ou à compilé, svp :
************************************************************



mais j'aimerais appeler le script avec comme argument le nom du fichier directement :
Code:
./rads   nom_fichier


donc j'ai commenté ds mon éditeur ces lignes ds mon script :
Code:
puts ""
            puts "************************************************************"
            puts "Entrez le nom du fichier  à décompresser ou à compilé, svp : "
            puts "************************************************************"
            puts ""
            nom_fichier  = gets::chomp


pour ajouter:
Code:
nom_fichier = ARGV[0]


Je récupère bien le nom du fichier passé en argument et elle est traité mais le problème est que la méthode gets.chomp que j'utilise pour récupérer des donnée sur l'entrée standard n'arrête plus le programme et je me retrouve à la fin du script (gets.chomp est court-circuité !) ...


Si qqu'un a une idée ...

merci,


@ +
_________________
Get Up and Go !


Last edited by man in the hill on Tue Aug 29, 2006 10:14 pm; edited 2 times in total
Back to top
View user's profile Send private message
man in the hill
Veteran
Veteran


Joined: 15 Dec 2005
Posts: 1552
Location: Madinina

PostPosted: Tue Aug 29, 2006 10:11 pm    Post subject: Reply with quote

Problème résolu !

Vous pouvez tester ce script ici (scroller vers le bas) :
http://www.guidelinux.org/phpBB/viewtopic.php?t=719&start=15


@ +
_________________
Get Up and Go !
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index French All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum