#!/usr/bin/perl
#
# ring-show -- show the list of ring IDs
#
# Written by Bill MacAllister <bill@ca-zephyr.org>
# Copyright (c) 2024 Bill MacAllister <bill@ca-zephyr.org>

use Getopt::Long;
use Pod::Usage;
use Rings::Common;
use strict;

my $opt_help;

##############################################################################
# Main routine
##############################################################################

GetOptions('help' => \$opt_help);

if ($opt_help) {
    pod2usage(-verbose => 0);
}

my %ring_id_list = get_id_list();
if (scalar(keys %ring_id_list) == 0) {
    print("No rings have been configured in /etc/rings\n");
} else {
    for my $id (sort keys %ring_id_list) {
        print("$id\n");
    }
}

exit;

__END__

=head1 NAME

ring-show - Show valid ring IDs

=head1 SYNOPSIS

     ring-show [--help]

=head1 DESCRIPTION

Display a list of valid ring IDs.
=head1 AUTHOR

Bill MacAllister <bill@ca-zephyr.org>

=head1 COPYRIGHT

Copyright 2024 CZ Software

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

=cut
