colcon / colcon-cd

A shell function for colcon to change the current working directory
http://colcon.readthedocs.io
Apache License 2.0
4 stars 4 forks source link

cd verb is unknown to colcon?! #21

Closed rhaschke closed 11 months ago

rhaschke commented 1 year ago

The cd verb is unknown to colcon:

$ colcon cd my_package
              ...
colcon: error: argument verb_name: invalid choice: 'cd' (choose from 'alias', 'build', 'clean', 'extension-points', 'extensions', 'graph', 'info', 'list', 'metadata', 'mixin', 'test', 'test-result', 'version-check', 'clr')
Briancbn commented 11 months ago

Hi @rhaschke, colcon_cd is a shell function, instead of a script.

You can follow the guide to setup based on your current environment https://colcon.readthedocs.io/en/released/user/installation.html#quick-directory-changes

If you installed using Debian binary, it will be like the following

source /usr/share/colcon_cd/function/colcon_cd.sh

The usage is like this

colcon_cd <package-name>
rhaschke commented 11 months ago

I have sourced colcon_cd.sh, but nevertheless, I do get the error mentioned above. I can directly call the shell function: colcon_cd my_package but using cd as a verb doesn't work.

Briancbn commented 11 months ago

cd verb is not the intended usage. https://github.com/colcon/colcon-cd/pull/1#issuecomment-538463246 explains why it might not be feasible at this point.

rhaschke commented 11 months ago

I see. I think this subtlety should be better documented here.