logo

ap-client

CLI-based client / toolbox for ActivityPub Client-to-Servergit clone https://hacktivis.me/git/ap-client.git
commit: f6fbb8c8f5b6f4259cb50b415054525de36df6fd
parent 0ad48f344d524a4a2623ed197cbe44212e3bfd83
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Thu, 30 Mar 2023 08:29:04 +0200

script/ap-backup: Add documentation

Diffstat:

Mscript/ap-backup52+++++++++++++++++++++++++++++++++++++++++-----------
1 file changed, 41 insertions(+), 11 deletions(-)

diff --git a/script/ap-backup b/script/ap-backup @@ -1,16 +1,55 @@ #!/usr/bin/env perl # AP-Client: CLI-based client / toolbox for ActivityPub -# Copyright © 2020-2021 AP-Client Authors <https://hacktivis.me/git/ap-client/> +# Copyright © 2020-2023 AP-Client Authors <https://hacktivis.me/git/ap-client/> # SPDX-License-Identifier: BSD-3-Clause use strict; use utf8; no warnings; # Wide Character… use Getopt::Std; +$Getopt::Std::STANDARD_HELP_VERSION = 1; use LWP::UserAgent; use MIME::Base64; use JSON; +=head1 NAME + +ap-backup - Backup an ActivityPub account + +=head1 SYNOPSIS + +B<ap-backup.pl> <-u user:password|-o OAuth-Bearer-Token> <url> + +=head1 DESCRIPTION + +ap-backup is used to backup an ActivityPub account, authentication is required. + +=over 4 + +=item B<-u> + +HTTP Basic Auth + +=item B<-o> + +OAuth2 Bearer Token + +=item B<url> + +ActivityPub user URL or outbox URL + +=back + +Activities are saved in the current working directory via their id, it's recommended to launch in a dedicated directory. + +Known to work against Pleroma. + +=head1 LICENSE + +BSD-3-Clause + +=cut + my %options = (); my $auth; my $ua = LWP::UserAgent->new; @@ -102,16 +141,7 @@ sub apc2s_backup { getopts("u:o:", \%options); if ($#ARGV != 0) { - print - "usage: ap-backup.pl <-u user:password|-o OAuth-Bearer-Token> <url>\n"; - print - "This tool is used to backup an account, authentication is required.\n"; - print " -u HTTP Basic Auth\n"; - print " -o OAuth2 Bearer Token\n"; - print " url ActivityPub user URL or outbox URL\n"; - print "Known to work against Pleroma.\n"; - print -"Activities are saved in the current working directory via their id, it's recommended to launch in a dedicated directory.\n"; + print "usage: ap-backup.pl <-u user:password|-o OAuth-Bearer-Token> <url>\n"; exit 1; }