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:
Satadru Pramanik, DO, MPH, MEng
2025-10-03 15:13:00 -04:00
committed by GitHub
parent 3394408370
commit befb8fe6b7
3 changed files with 16 additions and 2 deletions

View File

@@ -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)