vsg-dev/vsgXchange

vsgconv - inconstent return value?

Closed this issue · 1 comments

This is certainly not the most pressing issue but I am confused about the tool's return value..

  • no arguments or the '--help' option make the program return 1 (this is arguably not an error state?)
  • if the compiled-in ReaderWriter 'eats' all arguments (so that none are left for vsgconv itself), it will return 0 (that's probably an error state?)
  • the '--version' argument will make the program return 1 (no error I guess)
  • the '--features' (with or without ReaderWriter argument) will return 0 (but that shouldn't be an error state I'd think? So why return 0?)
  • if no files could be loaded (but see issue #158) it will return 1 (this certainly doesn't sound like 'success'? So maybe return 0?)
  • at the end of the 'main' function the program returns 0 (I guess if the program reaches the end this counts as 'success'? But then maybe this should return 1?)

So ideally this would be made consistent and documented somewhere? IF there's actually a requirement to emit meaningful return codes (apologies if I missed any documentation regarding this)..

I have tightened up the return types and how and when help is reported: 129b1d6