From c141f4631d59351aa92b5c2c05ea7696a516e525 Mon Sep 17 00:00:00 2001 From: Ed Reel Date: Fri, 5 Apr 2024 02:56:58 -0500 Subject: [PATCH] Update CREW_COMMANDS constant and replace hardcoded Available commmands (#9604) --- commands/help.rb | 2 +- lib/const.rb | 4 ++-- tests/commands/help.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/commands/help.rb b/commands/help.rb index fa9ab42b4..dc5d62b55 100644 --- a/commands/help.rb +++ b/commands/help.rb @@ -166,7 +166,7 @@ class Command else puts <<~EOT Usage: crew help - 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 diff --git a/lib/const.rb b/lib/const.rb index 5c572a5c9..85f80d31c 100644 --- a/lib/const.rb +++ b/lib/const.rb @@ -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('.', '') diff --git a/tests/commands/help.rb b/tests/commands/help.rb index db5b19e04..b70e33987 100644 --- a/tests/commands/help.rb +++ b/tests/commands/help.rb @@ -6,7 +6,7 @@ class HelpCommandTest < Minitest::Test def test_no_arguments expected_output = <<~EOT Usage: crew help - 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)