Changeset 317
- Timestamp:
- Jul 19, 2018, 9:08:30 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ddt/ddt
r316 r317 2143 2143 2144 2144 sub cmd_show_domainset { 2145 2146 my $computer_db = ipamdb_load($COMPUTER_YAML); 2145 local @ARGV = @_; 2146 2147 my ($no_header); 2148 2149 GetOptions( 2150 'no-header|H' => \$no_header, 2151 ); 2152 2153 my $computer_db = ipamdb_load($COMPUTER_YAML); 2154 2155 my $tb_computer = Text::Table->new( 2156 {align => 'left', align_title => 'left', title => 'DomainSet'}, 2157 {is_sep => 1, body => ' '}, 2158 {align => 'left', align_title => 'left', title => 'DNS-Extension:'}, 2159 {is_sep => 1, body => ' '}, 2160 {align => 'left', align_title => 'left', title => 'Date'}, 2161 {align => 'left', align_title => 'left', title => 'Comment'}, 2162 ); 2147 2163 2148 2164 LOOP_ON_DOMAIN: … … 2154 2170 next if $domainset_current eq 'version'; 2155 2171 2156 print "$domainset_current\n"; 2157 } 2172 $tb_computer->add($domainset_current) and next LOOP_ON_DOMAIN if not exists $computer_db->{'dset'}{$domainset_current}; 2173 2174 my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime $computer_db->{'dset'}{$domainset_current}{'modify_time'}; 2175 $year += 1900; 2176 $mon++; 2177 my $date = sprintf '%04i-%02i-%02i', $year, $mon, $mday; 2178 2179 my $comment = $computer_db->{'dset'}{$domainset_current}{'comment'}; 2180 $comment =~ s/^\d\d\d\d-\d\d-\d\d\s//; 2181 2182 $tb_computer->add($domainset_current, 2183 $computer_db->{'dset'}{$domainset_current}{'dns_extension'}, 2184 $date, 2185 $comment, 2186 ); 2187 } 2188 2189 print $tb_computer->title(), 2190 $tb_computer->rule('-') if not $no_header; 2191 print $tb_computer->body(); 2158 2192 } 2159 2193 … … 3098 3132 ddt remove-tag [--tag|-t tag] 3099 3133 ddt search-mac [--mac|-m mac] 3100 ddt show-domainset 3134 ddt show-domainset [--no-header|-H] 3101 3135 ddt show 3102 3136 ddt show-pool [--no-header|-H] … … 3192 3226 ddt remove-tag [--tag|-t tag] 3193 3227 ddt search-mac [--mac|-m mac] 3194 ddt show-domainset 3228 ddt show-domainset [--no-header|-H] 3195 3229 ddt show 3196 3230 ddt show-pool [--no-header|-H] … … 3341 3375 =head2 show-domainset 3342 3376 3343 ddt show-domainset 3377 ddt show-domainset [--no-header|-H] 3344 3378 3345 3379 =head2 show
Note: See TracChangeset
for help on using the changeset viewer.