I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Unverified Commit 1b8373f0 authored by xalloc xzal's avatar xalloc xzal
Browse files

--file not needed anymore, cleaned up code in lainsafecli and upload.cgi

parent 3a541515
No related branches found
No related tags found
No related merge requests found
......@@ -15,8 +15,6 @@
# along with lainsafe. If not, see <https://www.gnu.org/licenses/>.
use CGI;
use Digest::MD5 qw(md5_hex);
my $q = CGI->new;
print $q->header();
......
......@@ -20,8 +20,6 @@
use Getopt::Long;
use LWP::UserAgent;
use Data::Dumper;
use Try::Tiny;
use strict;
use warnings;
......@@ -66,7 +64,7 @@ EOF
sub help
{
print "lainsafecli, a command line interface for lainsafe.\n";
print "USAGE: lainsafecli [--server] --file=FILE\n\n";
print "USAGE: lainsafecli [--server] FILE\n\n";
print "if --server not given, $DEFAULT_SERVER is used.\n";
exit;
......@@ -75,15 +73,23 @@ sub help
## PROGRAM
my $ua = LWP::UserAgent->new;
GetOptions ("server=s" => \$DEFAULT_SERVER,
"file=s" => \$file,
"help" => \$help);
"help|" => \$help);
&help if ($help);
if($help || not defined $ARGV[0])
{
&help;
}
# check if file is given
$file = $ARGV[@ARGV-1];
die "File does not exist\n" if !-e $file;
die "Give a file\n" unless defined $file;
my $url_to_upload = $DEFAULT_SERVER . "/upload.cgi";
my $req;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment