The project is in a healthy, maintained state
Extension for tty-prompt that allow interactive CLI file system element selection
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.14.1
~> 13.0
~> 3.0

Runtime

~> 0.23.1
 Project Readme

TTY::Prompt::Files

TTY-Prompt-files is extension for tty-prompt gem that allow interactive selection elements from file system and get absolute path.

Note!

Be careful to use library before first major version. It does not support backward compatibility.

Usage

require 'tty-prompt-files'

prompt = TTY::Prompt.new

prompt.select_element_from_file_system

After element is selected, output will be a element full path.

select_element_from_file_system has 5 parameters:

prompt.select_element_from_file_system(text: "", pattern: "*", path: ".", multi_select: false, **options)

text is text user will see along with elements. By default: "".
pattern is determining for what file will be output based on matching the pattern. If you want to display hidden files, use "{.[^\.]*,*}" pattern. By default: "*".
path is determining path of the directory, can be relative or absolute. By default: ".".
multi_select refers to original API. By default: false. **options you can add any params from original API. No default value.\

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/tty-prompt-files. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the TTY::Prompt::Files project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.