Added module for CPU methods
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
1d7b9c8f0f
commit
267436f6e9
12
src/cmd/cpu.rb
Normal file
12
src/cmd/cpu.rb
Normal file
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user