From 30dfc142bd6abb9e78a4f43a5033799a36ae6e09 Mon Sep 17 00:00:00 2001 From: Stephan Barth Date: Thu, 24 Oct 2024 02:09:50 +0200 Subject: [PATCH] build(utils/develop-status.pl): Introduced command line options. --- utils/develop-status.pl | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/utils/develop-status.pl b/utils/develop-status.pl index 5c6868761..f67456a9e 100755 --- a/utils/develop-status.pl +++ b/utils/develop-status.pl @@ -10,6 +10,35 @@ if($ENV{PWD}=~m#/utils$#) { chdir(".."); } +my %listOutside=( + running=>1, + _default=>0, # everything for which no key exists +); + +for my $arg(@ARGV) { + if('-a' eq $arg) { + %listOutside=(_default=>1); + next + } + if('-h' eq $arg) { + usage() + } + usage("Invalid argument: '$arg'"); +} + +sub usage { + my $msg = shift; + print "$msg\n\n" if $msg; + print "$0 [args] + + -h display this help text + + -a show all containers with fitting names even when without containerfile +"; + exit 1 if $msg; + exit 0 +} + print "== Development status ==\n"; # Find out container status @@ -66,7 +95,8 @@ for my $k(sort { $cont{$a}{name} cmp $cont{$b}{name} } grep { !$cont{$_}{used} } keys %cont) { my $c = $cont{$k}; - print "Fradrive container outside develop file: ($c->{state}) $c->{name} $c->{id}\n" + my $show = $listOutside{$c->{state}} // $listOutside{_default}; + print "Fradrive container outside develop file: ($c->{state}) $c->{name} $c->{id}\n" if $show } exit 0;