`is_file` option not working for `ask`
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start with the minimal reproduction in file_test.rb and trace the CLI::UI.ask entry point when is_file is true. Reproduce the missing tab completion for files in the current directory and paths beginning with /; done means both cases complete as expected.
Written by the indexing model from the issue text.
Description
Hello. As far as I can tell, the is_file option for ask is not working, perhaps just on my local environment, but I'm not sure how to debug further.
I've created a minimal test, and confirmed that I can't tab complete either files in CWD or even starting with /
file_test.rb:
require "rubygems"
require "cli/ui"
file = CLI::UI.ask("A file question", is_file: true)
puts "File exists? #{File.exist?(file)}"
Some system/version information (I've [redacted] a few bits):
% gem list cli-ui
*** LOCAL GEMS ***
cli-ui (2.2.3)
% ruby -v
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin23]
% asdf info
OS:
Darwin [machine-name] 23.1.0 Darwin Kernel Version 23.1.0: Mon Oct 9 21:28:45 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T6020 arm64
SHELL:
zsh 5.9 (x86_64-apple-darwin23.0)
BASH VERSION:
3.2.57(1)-release
ASDF VERSION:
v0.14.0
ASDF INTERNAL VARIABLES:
ASDF_DEFAULT_TOOL_VERSIONS_FILENAME=.tool-versions
ASDF_DATA_DIR=[~]/.asdf
ASDF_DIR=/opt/homebrew/opt/asdf/libexec
ASDF_CONFIG_FILE=[~]/.asdfrc
ASDF INSTALLED PLUGINS:
nodejs https://github.com/asdf-vm/asdf-nodejs.git master c5b7c40
ruby https://github.com/asdf-vm/asdf-ruby.git master 37e32d1
yarn https://github.com/twuni/asdf-yarn.git main 376c540
I don't know which readline asdf uses but this is the one I have installed from homebrew:
% brew info readline
==> readline: stable 8.2.10 (bottled) [keg-only]
Library for command-line editing
https://tiswww.case.edu/php/chet/readline/rltop.html
Installed
/opt/homebrew/Cellar/readline/8.2.10 (51 files, 1.7MB)
Poured from bottle using the formulae.brew.sh API on 2024-06-13 at 09:09:30
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/r/readline.rb
- Dominant language
- Ruby
- Stars
- 1.1k
- Forks
- 57
- Avg merge
- 2h 55m
- Merged PRs (30d)
- 2
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Shopify/cli-ui
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Similar issues
-
user-reported
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Kong/developer.konghq.com#7316 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
TheOdinProject/curriculum#31408 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
notch8/utk_knapsack#148 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Homebrew/homebrew-cask#288729 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100