mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-07 22:54:11 -05:00
Add crew version <name> command to get versions of packages. (#13027)
* Add crew version <name> command to get versions of packages. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * bump version Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Add to Readme. Signed-off-by: Satadru Pramanik <satadru@gmail.com> --------- Signed-off-by: Satadru Pramanik <satadru@gmail.com>
This commit is contained in:
committed by
GitHub
parent
3394408370
commit
befb8fe6b7
14
bin/crew
14
bin/crew
@@ -46,7 +46,7 @@ begin
|
||||
rescue Docopt::Exit => e
|
||||
if ARGV[0]
|
||||
case ARGV[0]
|
||||
when '-V', '--version', 'version'
|
||||
when '-V', '--version'
|
||||
puts CREW_VERSION
|
||||
exit 0
|
||||
when '-L', '--license', 'license'
|
||||
@@ -2046,6 +2046,18 @@ def upstream_command(args)
|
||||
end
|
||||
end
|
||||
|
||||
def version_command(args)
|
||||
args = { '<name>' => args.split } if args.is_a? String
|
||||
if args['<name>'].empty?
|
||||
puts CREW_VERSION
|
||||
else
|
||||
args['<name>'].each do |name|
|
||||
search name
|
||||
puts @pkg.version
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def whatprovides_command(args)
|
||||
args['<pattern>'].each do |regex|
|
||||
Command.whatprovides(regex)
|
||||
|
||||
Reference in New Issue
Block a user