Skip to content

Commit

Permalink
Add sub-action miga lair running
Browse files Browse the repository at this point in the history
  • Loading branch information
lmrodriguezr committed Sep 28, 2024
1 parent cb7bd02 commit 8198090
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions lib/miga/cli/action/lair.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def parse_cli
run: 'Start the application and stay on top',
status: 'Show status (PID) of application instances',
list: 'List all daemons and their status',
running: 'List running daemons only',
terminate: 'Terminate all daemons in the lair and exit'
}.each { |k, v| opt.separator sprintf(' %*s%s', -33, k, v) }
opt.separator ''
Expand Down Expand Up @@ -93,12 +94,17 @@ def perform
case cli.operation.to_sym
when :terminate
lair.terminate_daemons
when :list
when :list, :running
o = []
lair.each_daemon do |d|
o << [d.daemon_name, d.class, d.daemon_home, d.active?, d.last_alive]
end
cli.table(%w[name class path active last_alive], o)
if cli.operation.to_sym == :running
o.select! { |i| i[3] }.map! { |i| i[0..-3] }
cli.table(%w[name class path], o)
else
cli.table(%w[name class path active last_alive], o)
end
else
lair.daemon(cli.operation, cli[:daemon_opts])
end
Expand Down
2 changes: 1 addition & 1 deletion lib/miga/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module MiGA
# - String indicating release status:
# - rc* release candidate, not released as gem
# - [0-9]+ stable release, released as gem
VERSION = [1.3, 21, 1].freeze
VERSION = [1.3, 21, 2].freeze

##
# Nickname for the current major.minor version.
Expand Down

0 comments on commit 8198090

Please sign in to comment.