marimlem / minishell

0 stars 0 forks source link

bug: exit blabla #48

Closed marimlem closed 2 months ago

marimlem commented 4 months ago
minishell:$ exit blabla
exit minishell
exit: blabla: numeric argument required
minishell:$ 
marimlem commented 4 months ago
bash$ exit abc
exit
bash: exit: abc: numeric argument required

=> EXITS

bash$ exit abc 1
exit
bash: exit: abc: numeric argument required

=> EXITS

bash$ exit 1 2 3
exit
bash: exit: too many arguments

=> DOESN'T EXIT

iQH4O commented 4 months ago

fixed exit bug, exits with ec = 2 when numeric argument is required and does not exit when too many arguments, also added check for "-" for exit input, will push later with other changes on "piscine-week-fix-hao"

marimlem commented 3 months ago

exit 1 2 NOT OK

minishell:$ exit 1 2
exit minishell
exit: too many arguments

exit abc OK

exit a b OK

iQH4O commented 3 months ago

fixed exit