Replies: 3 comments 4 replies
-
I am not sure. There are too many variables in play here, most of which are outside the scope of what bashly and completely were designed to do. I think you should simplify. Why not remove the private completions command and simply do something like this: name: cli
help: Sample application
commands:
- name: run
flags:
- long: --file
short: -f
required: true
arg: file
completions:
- $(fzf --query "$cur")
help: |-
Example file to run. Also, you can use completely itself to easily test different commands. See this completely.yaml as an example: ---
cli:
- run
cli run:
- "--file"
- "-f"
cli run*--file: &1
- $(fzf --query "$cur")
cli run*-f: *1 then you can test commands with $ completely test "cli run -f " # note the trailing space
$ completely test "cli run -f src" Note that these commands run directly on the completely.yaml file, without the need to regenerate anything. |
Beta Was this translation helpful? Give feedback.
-
Many thanks @DannyBen for your help ! I've tried your suggestion testing with completely directly, so I have: playground run*--file: &1
- $(find /Users/vsaboulin/Documents/github/kafka-docker-playground -name \*.sh | fzf --query "$cur") If I run the test with space I get correct results:
But if I run with a string, I get empty results, even though I'm able to see my files with fzf and select result file I want:
Running with debug, I see that cur is correctly set:
Maybe it's not supported to use argument |
Beta Was this translation helpful? Give feedback.
-
If I simplify even more: playground run*--file: &1
- $(find /Users/vsaboulin/Documents/github/kafka-docker-playground -name azure-blob-storage-source-proxy-backup-and-restore.sh) where it works:
but as soon as I test with some argument (which is not used), it returns nothing:
|
Beta Was this translation helpful? Give feedback.
-
Hello !
I've followed recommendations from #181 where I have setup a private command:
Script
get_examples_list_with_fzf_command.sh
:where function is doing:
Which I call like this:
My private command works fine, i.e when I call it, it find the right file using
find
andfzf
and using the argument as queryplayground get-examples-list-with-fzf "test jdbc"
Now If I run it with my real command:
It will show the fzf selection 3 times and in the end it does not select the file I want, see:
Any idea why ?
In my completion bash, it generates:
Beta Was this translation helpful? Give feedback.
All reactions