tokiwa-software / fuzion

The Fuzion Language Implementation
https://fuzion-lang.dev
GNU General Public License v3.0
47 stars 11 forks source link

Repeated options should result in an error #4154

Closed fridis closed 2 days ago

fridis commented 1 week ago

Try this

 > ./build/bin/fz -verbose=10 -verbose=0 -e 'say "hi"' 
hi

Would be good if all options that do not make sense repeatedly would result in an error if they are provided repeatedly.

simonvonhackewitz commented 1 week ago

I think there is some benefit in allowing this and just keeping the last specified value. Of course it does not make sense to add this option multiple times when typing the command, but there are cases that could result in a command with this option being repeated, e.g.

michaellilltokiwa commented 4 days ago

@simonvonhackewitz IMHO especially the second example is a good illustration why repeated options that do not make sense should lead to emitting an error. From fz's perspective we see conflicting/ambiguous settings and I think it is arbitrary to just choose the last option given.