Update CREW_COMMANDS constant and replace hardcoded Available commmands (#9604)

This commit is contained in:
Ed Reel
2024-04-05 02:56:58 -05:00
committed by GitHub
parent 6c67b9fe98
commit c141f4631d
3 changed files with 4 additions and 4 deletions

View File

@@ -166,7 +166,7 @@ class Command
else
puts <<~EOT
Usage: crew help <command>
Available commands: build, check, const, deps, download, files, help, install, license, list, postinstall, prop, reinstall, remove, search, sysinfo, test, update, upgrade, upload, version, whatprovides
Available commands: #{CREW_COMMANDS}
EOT
end
end

View File

@@ -1,7 +1,7 @@
# lib/const.rb
# Defines common constants used in different parts of crew
CREW_VERSION = '1.46.4'
CREW_VERSION = '1.46.5'
# kernel architecture
KERN_ARCH = `uname -m`.chomp
@@ -370,4 +370,4 @@ CREW_DOCOPT = <<~DOCOPT
DOCOPT
# All available crew commands.
CREW_COMMANDS = CREW_DOCOPT.scan(/crew ([^\s]+)/).flatten.join(',').gsub('.', '').split(',').sort
CREW_COMMANDS = CREW_DOCOPT.scan(/crew ([^\s]+)/).flatten.sort.join(', ').gsub('.', '')

View File

@@ -6,7 +6,7 @@ class HelpCommandTest < Minitest::Test
def test_no_arguments
expected_output = <<~EOT
Usage: crew help <command>
Available commands: build, check, const, deps, download, files, help, install, license, list, postinstall, prop, reinstall, remove, search, sysinfo, test, update, upgrade, upload, version, whatprovides
Available commands: #{CREW_COMMANDS}
EOT
assert_output expected_output, nil do
Command.help(nil)