Bug 142210 - [batch][options] separate options from arguments more clearly
Summary: [batch][options] separate options from arguments more clearly
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-17 09:32 EDT by Maxime Daniel CLA
Modified: 2006-05-17 09:36 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maxime Daniel CLA 2006-05-17 09:32:27 EDT
3.2 RC2
using the batch compiler with the following arguments:

X.java -5.

yields the following error message:
directory does not exist: -5.

whereas the following arguments:
X.java -5.0

yield a normal compilation using the 5.0 compliance option.

The usage recommandation is <options> <source files | directories>, which would suggest that both command lines should yield the same result (-5. or -5.0 should not be recognized as options). If on the contrary we want to be more flexible and allow options to follow sources, then the first command line should yield a more explicit message, aka 'unsupported option: 5.'. In the latter case, specifying directory names starting with '-' can be a pain. A classical solution is to consider that anything that follows a ' -- ' key is not an option.

Note: authorizing the mangling of options and arguments is most often a sign that the considered command is capable of applying different options sets to each argument. For example:
command -o1 file1 -o2 file2
would specify options o1 for file1, and o1 and o2 for file2. Since the batch compiler does not have this capability, we may want to enforce a strong and clear rule, namely the one given by the current usage message.
Comment 1 Olivier Thomann CLA 2006-05-17 09:36:47 EDT
Right now by default, any unrecognized options is considered to be a directory or a file name.