tldr-node-client icon indicating copy to clipboard operation
tldr-node-client copied to clipboard

CL auto completion for bash not working

Open j-tesla opened this issue 4 years ago • 4 comments

Expected behaviour

Command-line auto-completion to work.

Actual behaviour

According to README.md , I made a soft link (ln -s bin/completion/bash/tldr ~/.tldr-completion.bash ). But the file bin/completion/bash/tldr does not exist.

Log, debug output

bash: /home/j-tesla/.tldr-completion.bash: No such file or directory

Environment

  • Operating system - Pop OS! 20.04
  • NodeJS version - v14.17.0

j-tesla avatar May 25 '21 06:05 j-tesla

cc @marchersimon

bl-ue avatar Jun 21 '21 17:06 bl-ue

Hey @j-tesla, I don't know why this path is in the README, but my completion files are under /usr/lib/node_modules/tldr/bin/completion/bash/. (Using Manjaro, probably doesn't matter tough)

Basically, you created an invalid symlink and now bash is complaining.

marchersimon avatar Jun 21 '21 18:06 marchersimon

Oh, I wonder if the symlink ~/.tldr-completion.bash is just pointing to the relative path bin/completion/bash/tldr, so it will only work if <you current working directory>/bin/completion/bash/tldr exists.

@j-tesla Try re-running your ln command except use the full absolute path as the first argument, e.g. /usr/lib/node_modules/tldr/bin/completion/bash/tldr

bl-ue avatar Jun 21 '21 18:06 bl-ue

@bl-ue it's not <you current working directory>/bin/completion/bash/tldr, but <location of the symlink>/bin/completion/bash/tldr. But it's still bad practice to not specify the full path in such a case. (See https://github.com/tldr-pages/tldr/pull/6087).

Also, I'm wondering which system this is indented for. I've never seen a bin folder inside the home directory on Linux.

marchersimon avatar Jun 21 '21 19:06 marchersimon