chaos-lang / chaos

The Chaos Programming Language
https://chaos-lang.org
GNU General Public License v3.0
281 stars 17 forks source link

Incorrect "Program file does not exists on the given path" error message #90

Closed mertyildiran closed 3 years ago

mertyildiran commented 3 years ago

Describe the bug "Program file does not exists on the given path" error message is wrong in cases where more command line arguments/options are supplied.

To Reproduce

$ chaos -c tests/funtion.kaos -k -e "-fsanitize=address -fno-omit-frame-pointer -g -ggdb"
  Chaos Error:                                                                                              
    Module: -fsanitize=address -fno-omit-frame-pointer -g -ggdb                                             
    Line: 0                                                                                                 
    Program file does not exists on the given path: -fsanitize=address -fno-omit-frame-pointer -g -ggdb 
$ chaos -c tests/funtion.kaos -k
  Chaos Error:                                             
    Module: -k                                             
    Line: 0                                                
    Program file does not exists on the given path: -k

Expected behavior

$ chaos -c tests/funtion.kaos -k -e "-fsanitize=address -fno-omit-frame-pointer -g -ggdb"
  Chaos Error:                                                                                              
    Module: N/A                                             
    Line: 0                                                                                                 
    Program file does not exists on the given path: tests/funtion.kaos 
$ chaos -c tests/funtion.kaos -k
  Chaos Error:                                             
    Module: N/A                                             
    Line: 0                                                
    Program file does not exists on the given path: tests/funtion.kaos
mertyildiran commented 3 years ago

Fixed with https://github.com/chaos-lang/chaos/commit/cb0d20cfd43a14e8a0eab08851f692c22d953df6