mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-29 08:13:54 +00:00
--version
This commit is contained in:
parent
d7f50b1e41
commit
42d479d071
17
fzf
17
fzf
@ -7,10 +7,11 @@
|
||||
# / __/ / /_/ __/
|
||||
# /_/ /___/_/ Fuzzy finder for your shell
|
||||
#
|
||||
# URL: https://github.com/junegunn/fzf
|
||||
# Version: 0.6.1 (December 28, 2013)
|
||||
#
|
||||
# Author: Junegunn Choi
|
||||
# URL: https://github.com/junegunn/fzf
|
||||
# License: MIT
|
||||
# Last update: December 20, 2013
|
||||
#
|
||||
# Copyright (c) 2013 Junegunn Choi
|
||||
#
|
||||
@ -76,6 +77,7 @@ class FZF
|
||||
argv = argv.dup
|
||||
while o = argv.shift
|
||||
case o
|
||||
when '--version' then version
|
||||
when '-h', '--help' then usage 0
|
||||
when '-m', '--multi' then @multi = true
|
||||
when '-x', '--extended' then @xmode = true
|
||||
@ -128,6 +130,17 @@ class FZF
|
||||
start_loop
|
||||
end
|
||||
|
||||
def version
|
||||
File.open(__FILE__, 'r') do |f|
|
||||
f.each_line do |line|
|
||||
if line =~ /Version: (.*)/
|
||||
$stdout.puts "fzf " << $1
|
||||
exit
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def usage x, message = nil
|
||||
$stderr.puts message if message
|
||||
$stderr.puts %[usage: fzf [options]
|
||||
|
Loading…
Reference in New Issue
Block a user