Bash Complete for bench command

I added following line to ~/.bashrc to enable bench command auto complete on pressing tab in bash:

eval "$(_BENCH_COMPLETE=source bench)"

more: Bash Complete — Click Documentation (5.x)

When I type “bench” in bash and press tab twice the relevant commands, arguments and options are shown.

For now all bench commands are working wonderfully, frappe commands are not shown.

1 Like

@pdvyas should be able to point you in the right direction. This is a good candidate for a pull request!

I just added it to my ~/.bashrc not even /etc/bash.bashrc

How to make it part of bench installation?

According to my understanding following file is required

_BENCH_COMPLETE=source bench > bench-complete.sh

where to keep this file?

and following to be added in /etc/bash.bashrc? or ~/.bashrc

. path/to/bench-complete.sh

how to add to bashrc during installation?

HI Revant,

You can add _BENCH_COMPLETE=source bench root and frappe’s .bashrc. Although, there is more work required to complete site names and frappe commands as they are not standard arguments and hacked into bench.