mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-25 22:27:41 +00:00
--version
This commit is contained in:
parent
d7f50b1e41
commit
42d479d071
21
fzf
21
fzf
@ -7,10 +7,11 @@
|
||||
# / __/ / /_/ __/
|
||||
# /_/ /___/_/ Fuzzy finder for your shell
|
||||
#
|
||||
# URL: https://github.com/junegunn/fzf
|
||||
# Author: Junegunn Choi
|
||||
# License: MIT
|
||||
# Last update: December 20, 2013
|
||||
# Version: 0.6.1 (December 28, 2013)
|
||||
#
|
||||
# Author: Junegunn Choi
|
||||
# URL: https://github.com/junegunn/fzf
|
||||
# License: MIT
|
||||
#
|
||||
# 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