jcommander icon indicating copy to clipboard operation
jcommander copied to clipboard

Interactive mode

Open david-truong opened this issue 5 years ago • 1 comments

We use jcommander in a number of our projects. We recently decided there were times we would like to have an interactive mode where we would prompt a user for the required params instead of throwing an error. Would there be interest in this feature to be provided directly by jcommander?

david-truong avatar Sep 03 '19 19:09 david-truong

For users of shells with good command line editing (like bash, even Windows comes with a somewhat usable command line editor) I think this feature is not really needed. By pressing up-arrow and editing the command line you will get the correct one in the command history, not so if completing missing entries in an interactive mode. Also, the interactive mode editing of missing parameters will likely not have the editing facilities of bash/GNU readline (unless you link in Gnu readline, which has severe disadvantages: Only possible in GPL programs, and the inclusion of a JNI library).

Another disadvantage of the suggestion is that it means writing code that is hard to test, and very seldomly exercised, at least by the maintainer. Such code tend to break when the program develops.

bengtmartensson avatar Oct 03 '19 08:10 bengtmartensson