[rfc][icedtea-web] Add Tab Completion for icedtea-web

Jiri Vanek jvanek at redhat.com
Mon Apr 20 15:59:33 UTC 2015

On 04/20/2015 05:50 PM, Lukasz Dracz wrote:
> Hello,
>> After isntalling bash-completion (is it expected?) this really worked for me.
>> INteresting:)
>> Two major:
>>    1) I would include only -hyphen lead params. Its less verbosity , and much
>>    closer to what user expects. The duplication... it did not looked nicely.
> Yeah I agree, made it hyphens only.
>>    2) do you mind to include comment to this file, which will say "place this
>>    file to /etc/bash_completion.d/ or similar and isntall bash-completion or
>>    similar to make thsi file useful"
> Added a comment on the top of the file
>> This would be nice to fix inchangeset after generation changeset. To allow
>> (during configure) seupable isntall destination, which by default will be
>> $PREFIX/etc/bash_completion.d/ But generation of this file first...
>> Are you going to use some kind of icedteaweb-completion.in or spew everything
>> from main method? It actually seems to be good candidate for *.in file.
> Hmm, not sure at the moment. The nice thing as I understand it with the main method is I can code
> it to grab the latest options when run, so if a new option is added in
> OptionsDefinitions there should be no need to update the tab completion file generation.
> I'm not too familiar with *.in files. I know it is used as an input file.
> What would you recommend ?

My idea was simple.

the main method in OptionsDefinitions.java will only print content of opts.

the in file wil be your file, renmaed to .in  with small changes inside:

+    prev="${COMP_WORDS[COMP_CWORD-1]}"
+    # Icedtea-web settings Options
+    opts="@javawsopts@"
+    COMPREPLY=($(compgen -W "${opts}" -- ${cur}))

So the generation target will looklike:

javawsopts=`.../java -cp ... OptionsDefinitions javaws`
policyeopts=`.../java -cp ... OptionsDefinitions policyeditor`
settingsopts=`.../java -cp ... OptionsDefinitions itweb-settings`
cat icedteaweb-completion.in | sed s/@javawsopts@/$javawsopts/ | policy | settings > icedteaweb-completion

Donmt copypaste it:)  the names are terrible ;)

>> one major:
>> " local thermostat_install_dir" ?? :)))
>>    - anyway this, how yo hav it now, workd fine both for selfinstalle ditw,
>>    and same for installed itw. So"m not sure what it is for.
> Good catch :), this line is not needed at all, I was editing the tab-completion file I used
> for thermostat and I seemed to have missed this line.

ok for head.tahnx!
>> Thanx!
>> After all three issues fixed, ok to head. Or rather turn one more round :)
>> J.
> Thank you,
> Lukasz Dracz

More information about the distro-pkg-dev mailing list