Opened 16 years ago
Closed 13 years ago
#4753 closed enhancement (fixed)
bash completion file for lyx
Reported by: | Owned by: | lasgouttes | |
---|---|---|---|
Priority: | low | Milestone: | 2.0.0 |
Component: | general | Version: | 1.5.4 |
Severity: | minor | Keywords: | |
Cc: | rgheck@…, ps@…, cengique@… |
Description (last modified by )
Hi,
Cengiz Gunay contributed a bash completion file for lyx. We'll include it in the
next Debian package but it's something of general interest for Linux/Unix users
so that it would make sense to place it somewhere in the LyX tarball.
Sven
Attachments (3)
Change History (33)
by , 16 years ago
Attachment: | bash_completion added |
---|
comment:2 by , 16 years ago
From a packagers point of view I'd prefer to see it in the upstream tarball in
some kind of contrib folder. Actually LyX has currently no contrib folder for
such stuff and I've to admit that the use for the bash completion is only
limited to a relatively small part of the LyX userbase.
comment:3 by , 16 years ago
Cc: | added |
---|
it can be put into development/tools. i would be in favour of this but the
permission of the authors is needed (or rewrite needed).
comment:4 by , 16 years ago
Beside that fact that it's more or less a shell script I considered it to be a
configuration file. Looking around in the other completion files I can find some
of them state a licence some of them don't oh and some are a bit more complex. ;)
I'll write a mail to try to make it absolutely clear that it's free and
distributable.
comment:5 by , 16 years ago
Ok got a response from Julien who wrote the original file for inkscape:
Sven Hoexter wrote:
Hi Sven,
'do whatever you wan't to do with it'
:)
regards,
Julien.
So you can distribute it along with LyX.
comment:6 by , 15 years ago
Cc: | added |
---|
Can we go ahead and add this somewhere?
And by the way, what am I, the lowly user, to do with this file?
comment:7 by , 15 years ago
there are two authors and we didn't get response from the second one.
imho writing our own script would demand less energy then all this licensing
stuff :)
comment:8 by , 15 years ago
Well it's at least derived from something within Debian, though that doesn't
give it an explizit license, I don't think there will be any problems. Beside
that I fail to see the creational high of those nowdays common helper scripts
for the bash completion but IANAL.
Richard: You maybe find an /etc/bash_completion.d/ directory on your system. If
yes simply copy the file there, restart your shell and you should be done.
If you don't have such a directory or cannot write to it simply source the file
from your .bashrc. Oh and you need some 3.x version of bash IIRC.
comment:9 by , 15 years ago
Priority: | high → low |
---|
follow-up: 11 comment:10 by , 14 years ago
Description: | modified (diff) |
---|---|
Milestone: | → 2.0.0 |
lets put it into 2.0 then.
i know nothing about completion stuff. is there some standard location for installing purposes or putting it into tarball is enough?
comment:11 by , 14 years ago
Cc: | added |
---|
Hello, responding to your call Sanda, yes, I am still around.
Replying to sanda:
lets put it into 2.0 then.
i know nothing about completion stuff. is there some standard location for installing purposes or putting it into tarball is enough?
As Sven mentioned in his last post above, the right place for it is under /etc/bash_completion.d/. It would be a good start to include it in the tarball, but modifying "make install" to put it in the right place would be even better. The Debian package maintainer may be some help here, too.
Having seen all the fuss about licensing for the first time, I really think it's not necessary for such a simple script. It basically follows the bash manual.
follow-ups: 14 20 comment:12 by , 14 years ago
As Sven mentioned in his last post above, the right place for it is under /etc/bash_completion.d/
i see. here (gentoo) the completion files at /usr/share/bash-completion so apparently every distro has its own ways. i'll put it into tarball only.
Having seen all the fuss about licensing for the first time, I really think it's not necessary
yes, anyway your nod here was better ;)
follow-up: 25 comment:13 by , 14 years ago
Keywords: | fixedintrunk added |
---|
r34001. from alpha2 it will be in scripts/ dir.
i dont use completion myself, but it may be possible to improve the script that it knows
possible exports (in 2.0 it would be pdf,pdf1,..,pdf4, ps, xhtml) and dbg levels is also fixed set.
comment:14 by , 14 years ago
Replying to sanda:
As Sven mentioned in his last post above, the right place for it is under /etc/bash_completion.d/
i see. here (gentoo) the completion files at /usr/share/bash-completion so apparently every distro has its own ways. i'll put it into tarball only.
Fedora seems to use the files and setup from Debian while RHEL 5 doesn't even ship with the basic bash-completion package.
Someone from the BSD world around? Oh wait they usually won't use bash. ;)
Anyway I'm perfectly fine with having it in the tarball. :)
Thanks Pavel
comment:15 by , 14 years ago
from release-notes to 2.0:
There is a new option
"--batch" that causes LyX to run the given commands without opening a GUI
window. Thus, something like:
lyx --batch -x "buffer-print printer default dvips" myfile.lyx
comment:18 by , 14 years ago
So something like this should do the magic for the completion.
Index: bash_completion
===================================================================
--- bash_completion (Revision 34004)
+++ bash_completion (Arbeitskopie)
@@ -13,7 +13,7 @@
if "$cur" == -* ; then
COMPREPLY=( $( compgen -W '-help -userdir -sysdir \
-geometry -dbg -x --execute -e --export \
- -i --import -version' -- $cur ) )
+ -i --import -version --batch' -- $cur ) )
else
_filedir '@(lyx)'
fi
BTW: Am I the only who thinks that the options are inconsistent?
Looks like lyx traditionally had some prefixed the unix way with only one dash and later on added longopts with double dashes and a one dash short. Now batch has a double dash without a short -b.
comment:19 by , 14 years ago
Am I the only who thinks that the options are inconsistent?
i was pondering about the same thing.
comment:20 by , 14 years ago
Replying to sanda:
yes, anyway your nod here was better ;)
I'm sorry guys. Going back, I saw Sven's email from '08. I must have been confused for the request for permission, since I was the one sent the file to you for inclusion. Sorry for not answering on time.
comment:21 by , 14 years ago
Looks like lyx traditionally had some prefixed the unix way
two ways:
either start using two dashes or change it for "-batch".
i prefer the second one because of not breaking already existing usage.
comment:23 by , 14 years ago
comment:24 by , 14 years ago
:) thanks, fixed now.
btw Sven you might know how to properly fix #2820?
by , 14 years ago
Attachment: | export-options.patch added |
---|
Patch for completing file names for --export and -e options.
comment:25 by , 14 years ago
Replying to sanda:
i dont use completion myself, but it may be possible to improve the script that it knows
possible exports (in 2.0 it would be pdf,pdf1,..,pdf4, ps, xhtml) and dbg levels is also fixed set.
I attached a patch for export possibilities. I wasn't sure what you came up with the --batch vs. -batch, so it is not included in the patch. also forgot to add the debug levels, but you could easily follow what I did to add that, too.
follow-up: 27 comment:26 by , 14 years ago
I attached a patch for export possibilities.
the patch is in, thanks.
(btw i had flash of this unusual name - haven't you been by chance in last year at cns meeting in berlin?)
comment:27 by , 14 years ago
Replying to sanda:
(btw i had flash of this unusual name - haven't you been by chance in last year at cns meeting in berlin?)
:) Small world! Yes, I was the Computational Neuroscience meeting. What's your full name? Send me an email if you will, so we don't go off topic cluttering the ticket.
by , 14 years ago
Attachment: | debug-options.patch added |
---|
Patch to r34001 for adding comma-separated options to -dbg and added missing option -batch
comment:28 by , 14 years ago
Please test my new patch for the -dbg options!
I also added the -batch option because it's not the only inconsistent option: -help and -userdir also fall in the same category. So IMO, until they are changed, it would be fine to keep -batch as well.
I removed the reference to the inkscape completion file because I now heavily modified the code and added a lot of new stuff. I added a "copyleft" statement assuming that will prevent the licensing problems. Please advise if that's not the case.
Cheers.
comment:30 by , 13 years ago
Keywords: | fixedintrunk removed |
---|---|
Resolution: | → fixed |
Status: | new → closed |
2.0.0 is ready.
bash completion file for lyx