clk-project / clk

A very opinionated framework to ease the creation of command line interfaces
https://clk-project.org/
MIT License
22 stars 6 forks source link

clk has issues loading external commands from within one of the external commands directory #10

Closed ycouble closed 4 years ago

ycouble commented 4 years ago
~
09:28 ycouble@CosmYCO $ clk customcommands 
pythonpaths /home/ycouble/clk_python_commands
externalpaths /home/ycouble/clk_commands
~
09:28 ycouble@CosmYCO $ clk cosmo vpn_start@sh --help
Usage: clk cosmo vpn_start@sh [OPTIONS] [ARGS]...

  Connect to Cosmo VPN for user ycouble

  The current parameters set for this command are: --help

Arguments:
  ARGS  Remaining arguments

Options:
  --help-all  Show the full help message, automatic options included.
  --help      Show this message and exit.

But from within the clk_commands directory:

~/clk_commands
09:29 ycouble@CosmYCO $ clk cosmo vpn_start@sh --help
warning: When loading command cosmo.vpn_start.sh: [Errno 2] No such file or directory: 'cosmo.vpn_start.sh': 'cosmo.vpn_start.sh'
error: Found the command cosmo.vpn_start@sh in the resolver external but could not load it.
error: cosmo.vpn_start@sh could not be loaded. Re run with clk --develop to see the stacktrace or clk --debug-on-command-load-error to debug the load error 

With the --debug-on-command-load-error flag:

~/clk_commands
09:29 ycouble@CosmYCO $ clk --debug-on-command-load-error cosmo vpn_start@sh --help
warning: When loading command cosmo.vpn_start.sh: [Errno 2] No such file or directory: 'cosmo.vpn_start.sh': 'cosmo.vpn_start.sh'
> /usr/lib/python3.7/subprocess.py(1522)_execute_child()
   1521                             err_msg += ': ' + repr(err_filename)
-> 1522                     raise child_exception_type(errno_num, err_msg, err_filename)
   1523                 raise child_exception_type(err_msg)

ipdb> 
ycouble commented 4 years ago

sooooo fast ! :+1:

Konubinix commented 4 years ago

Thanks for the report, it is fixed in the version 0.12.2