colcon / colcon-argcomplete

Completion for colcon command lines using argcomplete
http://colcon.readthedocs.io
Apache License 2.0
2 stars 3 forks source link

Enable argcomplete by default #41

Open ijnek opened 2 years ago

ijnek commented 2 years ago

I found that instructions about argcomplete were added to the ros2_documentation in https://github.com/ros2/ros2_documentation/pull/2059 last year, but as discussed in that PR, setting up argcomplete shouldn't be part of a beginner tutorial.

As embarassing as this sounds, it took me a long time until I realised argcomplete existed, and that I didn't have to type out the package selection options manually.

As argcomplete actually benefits everyone, is there a way to enable arg completion by default? What are the drawbacks that outweigh the advantages?

nuclearsandwich commented 2 years ago

is there a way to enable arg completion by default?

command completion support requires hooking into a user's shell and I am absolutely not about to make that something which colcon does "behind the scenes" without explicit consent from the user. Depending on the shell, it may be possible for apt packages to install completions in special directories where they would be picked up automatically but there is no such clean facility for a package from pypi and I don't believe that bash supports these.

I could see us introducing a verb like colcon argcomplete install which will idempotently update the content of the user's shell configuration to include setup for colcon's argcompletion but that will simplify setup not negate it.