Added documentation directly in the script rather than a manpage
This commit is contained in:
parent
7f46f9c9e8
commit
a7ce2c272e
2 changed files with 39 additions and 38 deletions
|
@ -1,36 +0,0 @@
|
|||
.TH peertube-cli 1 2021-11-07 KILL-9
|
||||
|
||||
.SH NAME
|
||||
peertube-cli \- A peertube CLI client.
|
||||
.SH SYPNOSIS
|
||||
.B peertube-cli
|
||||
[\-\-instance=INSTANCE] [\-\-resolution=[0|1|...|n]] [\-\-player=PLAYER] [URL]
|
||||
.SH DESCRIPTION
|
||||
peertube-cli is a peertube client. If no parameters are given, it will
|
||||
use the config file
|
||||
.B
|
||||
~/.ptclirc
|
||||
or anything in the
|
||||
.B
|
||||
PTCLIRC
|
||||
env
|
||||
.SH CONFIG
|
||||
The file
|
||||
.B
|
||||
~/.ptclirc
|
||||
is written in perl using perl's hashes. And it contains 3
|
||||
values, instance, resolution and player. peertube-cli will use the
|
||||
values set in this file if nothing is passed with getopt arguments.
|
||||
.SH CONSIDERATIONS
|
||||
|
||||
using peertube-cli might be harmful for PeerTube instances, as you're
|
||||
downloading the video
|
||||
.B from the server
|
||||
rather from peers, so you'd be consuming more server bandwith thus
|
||||
making it slowler.
|
||||
.SH LICENSE
|
||||
|
||||
peertube-cli is under the GPLv3 or any later.
|
||||
.SH BUGS
|
||||
|
||||
Of course.
|
39
peertube-cli
39
peertube-cli
|
@ -24,6 +24,8 @@ use Term::ANSIColor;
|
|||
use Getopt::Long;
|
||||
use Time::Seconds;
|
||||
use Scalar::Util qw(looks_like_number);
|
||||
use Pod::Usage;
|
||||
|
||||
use strict;
|
||||
|
||||
our %config;
|
||||
|
@ -56,7 +58,9 @@ GetOptions(
|
|||
"instance|i=s" => \$config{instance},
|
||||
"resolution|r=i" => \$config{default_resolution},
|
||||
"player|p=s" => \$config{player},
|
||||
"player-flags|f=s" => \$config{player_flags}
|
||||
"player-flags|f=s" => \$config{player_flags},
|
||||
"help|h" => sub {pod2usage(1); exit;},
|
||||
"man|m" => sub {pod2usage(-exitval => 0, -verbose=> 2); exit;},
|
||||
);
|
||||
# Main program
|
||||
while (1) {
|
||||
|
@ -213,4 +217,37 @@ sub help_prompt() {
|
|||
print "Press enter to continue\n";
|
||||
<STDIN>;
|
||||
}
|
||||
__END__
|
||||
|
||||
=head1 peertube-cli
|
||||
|
||||
peertube-cli - PeerTube Viewer
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
peertube-cli [--instance] [--player] [--resolution] [search query]
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
This program is a peertube client which allows you to browse any
|
||||
instance using PeerTube's API.
|
||||
|
||||
=head1 OPTIONS
|
||||
|
||||
=over 4
|
||||
|
||||
=item B<-instance>:
|
||||
peertube instance to use, because of bugs, it must not end with a "/"
|
||||
|
||||
=item B<-resolution>:
|
||||
by default 0 which is the highest resolution available.
|
||||
|
||||
=item B<-player>:
|
||||
which media player to use, by default is mpv.
|
||||
|
||||
=item B<-player-flags>:
|
||||
flags to append to the video player (-vo=x11 for example)
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
|
Loading…
Add table
Reference in a new issue