ctubbsii commented on issue #983: Stop using system.exit for fluo commands
URL: https://github.com/apache/fluo/issues/983#issuecomment-353674935
 
 
   So, without fully understanding all the code which this could impact (so, I 
could be totally off base with these suggestions), I have a few thoughts.
   
   I think there are a few goals:
   
   1. Make the code friendly to execute by a container/wrapping UI without 
calling `System.exit()`
   2. Have a convenient way to catch exceptions (maybe just certain expected 
ones), print a standard error message and exit with a non-zero exit code.
   
   The easiest way to do this is to have some sort of `exec() throws 
FluoCommandException` method which `main()` trivially wraps to handle 
exceptions. We could add a `--debug` option to control whether `main()` shows 
the stack trace or suppresses them. `main()` should consistently call 
`System.exit()` whether or not it is zero or non-zero.
   
   As for logging, I'm not sure it makes sense to do any logging from a CLI. 
CLI which is intended to be run by users should use the console.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to