This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# CPU command methods
|
||||
module CMD
|
||||
|
||||
def cpu_stress
|
||||
puts('CPU stress test.')
|
||||
end
|
||||
|
||||
module_function :cpu_stress
|
||||
|
||||
end
|
||||
@@ -5,6 +5,8 @@
|
||||
require 'bundler/setup'
|
||||
require 'dry/cli'
|
||||
|
||||
require_relative 'cmd/cpu'
|
||||
|
||||
module PCHWBM
|
||||
module CLI
|
||||
# Commands module for dry-cli
|
||||
@@ -12,6 +14,20 @@ module PCHWBM
|
||||
|
||||
extend Dry::CLI::Registry
|
||||
|
||||
# CPU subcommand definition
|
||||
module CPU
|
||||
# CPU stress test command
|
||||
class Stress < Dry::CLI::Command
|
||||
|
||||
desc 'CPU tests.'
|
||||
|
||||
def call(*)
|
||||
CMD.cpu_stress()
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
# Version subcommand definition
|
||||
class Version < Dry::CLI::Command
|
||||
|
||||
@@ -25,6 +41,9 @@ module PCHWBM
|
||||
|
||||
# Register commands with the CLI
|
||||
register 'version', Version, aliases: ['v', '-v', '--version']
|
||||
register 'cpu' do |prefix|
|
||||
prefix.register('stress', CPU::Stress)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user