zsh-workers
 help / color / mirror / code / Atom feed
* completion for compilers (cc, gcc...) and -o
@ 2020-04-30  8:51 Vincent Lefevre
  2020-04-30 17:57 ` Bart Schaefer
  2020-04-30 18:14 ` Daniel Shahaf
  0 siblings, 2 replies; 15+ messages in thread
From: Vincent Lefevre @ 2020-04-30  8:51 UTC (permalink / raw)
  To: zsh-workers

The -o option is currently handled by

  '-o:output file:_files -g "^*.(c|h|cc|C|cxx)(-.)"'

I wonder whether .i files (preprocessed files, e.g. for bug reports)
should be excluded too. One can choose such files for output with
"gcc -E", but:
  * in this case, one generally chooses to use the shorter ">" (or a
    pipe) rather than "-o" (gcc -E file.c > file.i);
  * using such files as a source may be more common.

Moreover, if I have a C source "myprogram.c", I generally want the
output file (program name) to be "myprogram", or if I need several
versions (e.g. because I test several options), I choose this as a
prefix, e.g. for "myprogram1", "myprogram2", "myprogram-ok", etc.
Now, when "myprogram.c" exists, but not any of the program files,
and I try to complete with

  cc -o my[TAB]

I'd like the "myprogram" to be taken into account.

Currently it seems that if there are no matches without the excluded
pattern, the completion is done on all files, that is, one gets

  cc -o myprogram.c

This does not make any sense since a .c file should normally not be
an output file. IMHO, instead of that, one should get the filename
without the filename extension:

  cc -o myprogram

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2020-05-04 23:59 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-30  8:51 completion for compilers (cc, gcc...) and -o Vincent Lefevre
2020-04-30 17:57 ` Bart Schaefer
2020-04-30 18:14 ` Daniel Shahaf
2020-04-30 20:17   ` Vincent Lefevre
2020-04-30 20:32     ` Bart Schaefer
2020-04-30 20:54       ` Vincent Lefevre
2020-04-30 22:34         ` Daniel Shahaf
2020-04-30 22:36           ` Daniel Shahaf
2020-04-30 23:07             ` Bart Schaefer
2020-04-30 22:05     ` Daniel Shahaf
2020-05-01  1:11       ` Vincent Lefevre
2020-05-02  0:43         ` Daniel Shahaf
2020-05-02  1:26           ` Bart Schaefer
2020-05-03 23:17           ` Vincent Lefevre
2020-05-04 23:58             ` Daniel Shahaf

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).