Bug 32053 - getopt-compliant command line options (at least on Unix)
getopt-compliant command line options (at least on Unix)
Status: RESOLVED FIXED
Product: platform
Classification: Unclassified
Component: -- Other --
3.x
All All
: P2 (vote)
: 3.x
Assigned To: Jaroslav Tulach
issues@platform
TCR
: API_REVIEW_FAST, ARCH
: 32079 (view as bug list)
Depends on: 24183 39022
Blocks: 31065 36663
  Show dependency treegraph
 
Reported: 2003-03-17 15:55 UTC by Jesse Glick
Modified: 2008-12-22 19:54 UTC (History)
7 users (show)

See Also:
Issue Type: TASK
:


Attachments
Implementation (17.07 KB, patch)
2003-12-15 15:29 UTC, Jaroslav Tulach
Details | Diff
Full output and output when JDK cannot be found (1.56 KB, text/plain)
2003-12-18 08:00 UTC, Jaroslav Tulach
Details
Implementation II. (18.06 KB, patch)
2003-12-18 08:06 UTC, Jaroslav Tulach
Details | Diff
Proposed changes in runide.cpp - not tested, I do not have a way to compile (2.02 KB, patch)
2004-01-05 17:08 UTC, Jaroslav Tulach
Details | Diff
Impl III. which comes with public static String org.netbeans.Main.usage() which should be used from runide.exe to get the java part of --help description (44.93 KB, patch)
2004-01-07 13:11 UTC, Jaroslav Tulach
Details | Diff
The previous patch contained some garbage (CloneableEditorSupport), this one removes it. Sorry. (21.83 KB, patch)
2004-01-07 13:16 UTC, Jaroslav Tulach
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2003-03-17 15:55:57 UTC
E.g. "-branding" etc. should be "--branding" etc.
Comment 1 Jesse Glick 2003-03-18 12:55:24 UTC
*** Issue 32079 has been marked as a duplicate of this issue. ***
Comment 2 Jaroslav Tulach 2003-03-18 13:49:21 UTC
Issue 32079 maybe duplicated but in such case we have to make this one
block issue 31065.
Comment 3 Jaroslav Tulach 2003-05-28 09:41:28 UTC
Some kind of proposal available at
http://openide.netbeans.org/proposals/arch/cli.html
Comment 4 Jesse Glick 2003-05-28 21:55:15 UTC
Let's not forget --version which is missing currently. Frankly I'm not
sure what it should return, given the existence of modules, but
something at least. Maybe just cat ${netbeans.home}/build_info if it
exists, else print to stderr a metaphysical discourse on the nature of
identity. :-)
Comment 5 Jaroslav Tulach 2003-11-19 14:55:17 UTC
Tim said that he can do it and also mentioned that he is able to do it
till december. So I am reassigning this to him and changing target
milestone.
Comment 6 _ tboudreau 2003-11-19 17:15:46 UTC
Funny, I don't remember volunteering for this... 
Comment 7 Jaroslav Tulach 2003-11-20 12:44:44 UTC
I such case, I am sorry for such misinterpretation. Please unsign
yourself from the bug then.
Comment 8 _ tboudreau 2003-11-20 22:23:22 UTC
I'll do it, it's not a problem.  When is it needed by?
Comment 9 Jesse Glick 2003-11-21 11:34:33 UTC
Last I recall, we don't need this until D, so there is no rush.
Comment 10 Jaroslav Tulach 2003-11-21 12:56:07 UTC
I had a lunch with Trung and Tim and we talked about this issue, about
Tim taking it over, as he has some free time soon and about trying to
fix this for promotion B. Based on this I have changed the owner and
target milestone of the issue.

But in the light of Tim's posts, I have a feeling that I am either
schizophrenic or I was talking to completely different Tim. Otherwise
I cannot explain why he does not remember this being discussed.

So once aqain. If I made wrong changes to the issue (Tim owner, target
milestone 4.0), please excuse me and correct it.
Comment 11 _ tboudreau 2003-11-21 13:59:53 UTC
No, Jarda, I clearly recall *you* volunteering me to do it.  I just
didn't recall liking the idea so much :-)
Comment 12 Jaroslav Tulach 2003-12-15 15:13:06 UTC
I propose to change the option to something like this by chaning the
runide.sh launcher (and possibly runide.exe as well) and especially
all java CLIHanders (in core and in utilities/openfile module). The
help would look like this:

Usage: ./netbeans/bin/runide.sh {options} arguments

General options:
  --help                help on more parameters (not interpreted by
launcher)
  --jdkhome <path>      path to JDK (could also be just JRE but some
modules may not work!)
  -J<jvm_options>       passes <jvm_option> to JVM
Classpath options (normally you should NOT use these):
  --cp:p <classpath>    prepends <classpath> to classpath
  --cp:a <classpath>    appends <classpath> to classpath
Command-line options:
  --ui <UI class name>  use given UI class as the IDE's Look & Feel
  --fontsize <size>     use given number as the base font size of the
                        IDE user interface, in points (11 default)
                        (but see
http://ui.netbeans.org/docs/ui/themes/themes.html)
  --locale <language[:country[:variant]]> use specified locale
  --userdir <path>      user settings directory (${userdir} by default)
Rarer options (definitely not supported!):
  --branding <token>    use specified branding (- for default)
  --nologging           do not create the log file
  --nosplash            do not show the splash screen
  --nogui               just start up internals, do not show GUI
Open File Module options:
  --open FILE           open FILE.
  --open FILE:LINE      open FILE at line LINE (starting from 1).
Comment 13 Jaroslav Tulach 2003-12-15 15:29:06 UTC
Created attachment 12582 [details]
Implementation
Comment 14 Jaroslav Tulach 2003-12-15 15:37:25 UTC
The implementation makes all options printed in help getopt complient
(either one letter option or begins with --), but it keeps the old
versions of options for backward compatibility. The implementation
changes processing of --help in runide.sh to continue and invoke the
java launcher, this it fixes issue 24183 because all option help from
all available modules is printed at once. It also allows to move the
final processing of --userdir argument into the java launcher, but
this is not necessary (e.g. runide.exe can remain unchanged).
Comment 15 Martin Brehovsky 2003-12-15 15:47:34 UTC
If user should not use -cp:a and -cp:p switches, why not changing them
to something like --Xcp:a and --Xcp:p, the same way how JDK uses
non-standard switches. It would clearly differentiate these 'advanced'
switches from the ordinary ones. The same could apply to -branding
(--Xbranding), -nosplash (--Xsplash)_, etc ...
Comment 16 _ tboudreau 2003-12-15 16:52:05 UTC
I'd suggest a small change:

General options:
  --help                help on more parameters (not interpreted by
launcher)
  --morehelp            help on advanced options

(put branding & other exotic options in --morehelp)

Also, why not --java == -J-D?
Comment 17 Jesse Glick 2003-12-15 17:57:02 UTC
+1 on --X prefix or similar for unsupported options, with --X itself
printing help for these options - consistency with JDK.
Comment 18 Jaroslav Tulach 2003-12-16 07:23:42 UTC
I am affraid java consistency will not be seen as advantage, so
following their examples -X might not be the good thing.

Re. --branding. I suggest to move it to stable. 
Re. --nologging, --nosplash, --nogui, I suggest to support them, but
not print inside --help, I will document in <api/> tags that they are
deprecated.
Re. --cp:x I prefer to remove the warning above or not printing the
help at all to using -X option

I propose to use "under development" stability for most options but --help
Comment 19 Jaroslav Tulach 2003-12-16 07:54:03 UTC
Re. --help, the description is incorrect, right now it prints all
options, there is no other improved help.
Comment 20 Jaroslav Tulach 2003-12-18 08:00:07 UTC
Created attachment 12623 [details]
Full output and output when JDK cannot be found
Comment 21 Jaroslav Tulach 2003-12-18 08:06:22 UTC
Created attachment 12624 [details]
Implementation II.
Comment 22 Jaroslav Tulach 2003-12-22 16:44:09 UTC
Implementation II will be commited at the begining of year 2004.
Thanks for reviews.
Comment 23 Jaroslav Tulach 2004-01-05 14:05:12 UTC
Patrick, this could also affect documentation. If I commit this week
is everything ok for you.
Comment 24 Jaroslav Tulach 2004-01-05 17:08:10 UTC
Created attachment 12698 [details]
Proposed changes in runide.cpp - not tested, I do not have a way to compile
Comment 25 Jaroslav Tulach 2004-01-07 13:11:50 UTC
Created attachment 12745 [details]
Impl III. which comes with public static String org.netbeans.Main.usage() which should be used from runide.exe to get the java part of --help description
Comment 26 Jaroslav Tulach 2004-01-07 13:16:06 UTC
Created attachment 12747 [details]
The previous patch contained some garbage (CloneableEditorSupport), this one removes it. Sorry.
Comment 27 _ ttran 2004-01-09 15:20:21 UTC
In half an hour I will commit Yarda's patch and the additional changes
in runide.cpp.   I did a few modifications to Yarda's patch.  --ui
changed to --laf.  --branding was removed from the help, it's not
intended for end users.  I also did some change in the help text
itself,  removed any mention of "IDE" there, added blank line b/w text
sections and hopefully also improved the English
Comment 28 _ ttran 2004-01-09 15:35:05 UTC
Mini spec from end user point of views

1) all well-known old options continue to work but should not be
documented anywhere

2) on windows only runide.exe prints the usage to the console, not
runidew.exe, this is consistent with java.exe/javaw.exe behaviour

3) if an unknown option is specified, a warning is printed into the
console, and ignored, the IDE continues

4) options which are supported and intended to be used by end users
are described by running the console launcher in the launcher with the
 --help switch.  They are

$ runide.sh --help
Usage: runide.sh {options} arguments

General options:
  --help                show this help 
  --jdkhome <path>      path to Java(TM) 2 SDK, Standard Edition
  -J<jvm_option>        pass <jvm_option> to JVM

  --cp:p <classpath>    prepend <classpath> to classpath
  --cp:a <classpath>    append <classpath> to classpath

Core options:
  --laf <LaF classname> use given LookAndFeel class instead of the default
  --fontsize <size>     set the base font size of the user interface,
in points
  --locale <language[:country[:variant]]> use specified locale instead
of the default
  --userdir <path>      explicitely set user settings directory


OpenFile module options:
  --open FILE           open FILE.
  --open FILE:LINE      open FILE at line LINE (starting from 1).
Comment 29 _ ttran 2004-01-09 15:47:06 UTC
I18N/L10N note: the usage text is not localizable because half of it
is printed by the launcher and we don't know how to internationalize
shell script.

Consider this is "by design" ;-(  At least not a regression
Comment 30 _ ttran 2004-01-10 00:00:51 UTC
committed the modified patch
Windows launchers runide.exe and runidew.exe were fixed too
Comment 31 _ ttran 2004-01-10 00:08:27 UTC
set target milestone to 3.6


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo