Project

pick

0.0
No commit activity in last 3 years
No release in over 3 years
Pick is a command line tool to interactively select from multiple options. It accepts options from a file or stdin, and outputs the selected value or values to stdout. See also: ipt, percol, sentaku
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.14
>= 0
~> 10.0
~> 3.0

Runtime

 Project Readme

Pick

Pick is a command line tool for selecting from multiple options. It takes items on standard input or from a file, and interactively prompts you to choose one or more of them.

Installation

gem install pick

Examples

# select a file
ls | pick

# edit a file under the current directory tree
vim $(find . -type f | pick)

# edit multiple files under the current directory tree
vim $(find . -type f | pick -m)

# check out a branch interactively
git branch -a | pick | xargs git checkout

# delete a file, safe even when filenames contain newlines
find . -type f -print0 | pick -0 | xargs -0 rm -v

# delete many files
find . -type f -print0 | pick -0 -m | xargs -0 rm -v

# choose a color from colors.txt
pick colors.txt

Development

After checking out the repo, run bundle install to install dependencies. Then, run rake test to run the tests. You can use pry -r ./lib/pick to get an interactive shell.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/ab/pick/.

License

The gem is available as open source under the terms of the GPL v3.