Closed xshang93 closed 2 years ago
Thanks @xshang93. I've now integrated it in the CMakeLists.txt, see branch xshang93-main
.
make install
works on Linux, but could you confirm that it does on Mac?
First, run
sudo make install
which will copy the file to /usr/local/etc/bash_completion.d/
and rename it neper
.
Then, open a new terminal, and type neper <tab>
.
Does it autocomplete?
Does it autocomplete?
There seems to something wrong with the CMakeLists.txt. Specifically,
elseif (compare MATCHES CMAKE_SYSTEM_NAME "Darwin" OR APPLE)
gives:
CMake Error at CMakeLists.txt:213 (elseif):
given arguments:
"compare" "MATCHES" "CMAKE_SYSTEM_NAME" "Darwin" "OR" "APPLE"
Unknown arguments specified
Seems like the way you use compare
is not working? I changed it to
elseif (CMAKE_SYSTEM_NAME MATCHES APPLE OR CMAKE_SYSTEM_NAME MATCHES "Darwin")
and it works fine. After installation it autocompletes without a problem.
Thanks. Can you check that the simpler elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin")
works?
Thanks. Can you check that the simpler
elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin")
works?
Yes this simple line works.
@xshang93, I've merged this morning. Thanks again!
I'm just noticing two things:
the first -<tab>
does not behave as the next ones. Specifically,
neper -T -<tab>
completes to neper -T -loadtess
neper -M -<tab>
completes to neper -T -load
neper -V -<tab>
does not completeneper -S -<tab>
does not completeI'm guessing that it is considering that the first option should define an input data (hence the -load
options), but, as Neper accepts options to be provided in any order, this should not be... Instead, it should show all possible options.
when <tab>
is hit at the end of a valid option, then nothing happens, which is also the case when <tab>
is hit at the end of an invalid option (compare the valid neper -T -n<tab>
and the invalid neper -T -nn<tab>
). I find it confusing. In contrast, gcc -ansi<tab>
completes to gcc -ansi
(a space is added), which "validates" the option.
Would it be possible for you to change this?
PS. Version 4.3.0 is scheduled to be released on Wednesday morning (my time). If you can change this before, then great, otherwise, please inform me of your possibilities or we will fix it later.
@xshang93, I've merged this morning. Thanks again!
I'm just noticing two things:
the first
-<tab>
does not behave as the next ones. Specifically,
neper -T -<tab>
completes toneper -T -loadtess
neper -M -<tab>
completes toneper -T -load
neper -V -<tab>
does not completeneper -S -<tab>
does not completeI'm guessing that it is considering that the first option should define an input data (hence the
-load
options), but, as Neper accepts options to be provided in any order, this should not be... Instead, it should show all possible options.
Yes, you're right on this. This was done intentionally because of the reason you mention. I think a better approach would be, when the previous word is a command, i.e., -*, it shows the files/directories and the -load options. I will look into this.
- when
<tab>
is hit at the end of a valid option, then nothing happens, which is also the case when<tab>
is hit at the end of an invalid option (compare the validneper -T -n<tab>
and the invalidneper -T -nn<tab>
). I find it confusing. In contrast,gcc -ansi<tab>
completes togcc -ansi
(a space is added), which "validates" the option.Would it be possible for you to change this?
This happens because I disabled the "add a space" option in bash-completion for neper. The reason is that, neper takes ',' as separators for multiple file names. If a space is added to the end, completion will not work when there is a comma separator.
PS. Version 4.3.0 is scheduled to be released on Wednesday morning (my time). If you can change this before, then great, otherwise, please inform me of your possibilities or we will fix it later.
I'm glad to hear the new release is arriving! I might be unfortunately too busy for the week, but I will try my best to work on a fix for the first issue - hopefully.
Hey @rquey , sorry I didn't have time to work on this recently, thought I'd let you know so you don't need to wait on this. I'll try work on it later this week.
Thanks for letting me know, and no problem.
Hey Romain,
Sorry for the delay, but I have now finished cleaning my repo, and fixed some minor issues with the completion code. The new pull request should now work.
Best, Xiao