#!/usr/bin/env perl
use warnings;
use strict;

use App::ZFSCurses::UI;
use Getopt::Long;
use Pod::Usage;

=head1 NAME

zfscurses - frontend to run L<App::ZFSCurses::UI>.

=cut

=head1 SYNOPSIS

zfscurses [-hm]

    -m|--man        display man page
    -h|--help       also display man page

zfscurses is a frontend to run L<App::ZFSCurses::UI>.

L<App::ZFSCurses::UI> is a curses UI to query and modify a ZFS dataset properties.

=cut

my $opts = {};
my @args = ( 'help|h', 'man|m' );

GetOptions( $opts, @args );

if ($opts->{man} or $opts->{help}) {
    pod2usage(verbose => 2, exitval => -1);
};

App::ZFSCurses::UI->new->draw_and_run();

=head1 KEYSTROKES

Use the following keystrokes to navigate around the UI.

=over 5

=item Up/Down

Move the cursor up or down.

=item Enter/Space

Validate/confirm selection.

=item Tab

Move focus around.

=item Ctrl+q

Quit the UI.

=item F1

When browsing a dataset properties, F1 will show a help message about the
selected property. You must first select a property using Enter/Space.

=back

=cut

=head1 MOUSE

Mouse support is enabled. You can click on any UI component (textbox, list) as
well as buttons.

=head1 SEE ALSO

L<App::ZFSCurses> to understand the guts of the application.

L<App::ZFSCurses::UI> for the UI components.

=head1 AUTHOR

Patrice Clement <monsieurp at cpan.org>

=head1 LICENSE AND COPYRIGHT

This software is copyright (c) 2020 by Patrice Clement.

This is free software, licensed under the (three-clause) clause BSD License.

See the LICENSE file.

=cut
