Ignore --tor flag if it is disabled

This commit is contained in:
qorg11 2020-08-21 03:51:41 +02:00
parent a2c8f92c50
commit 9d3844bed5
No known key found for this signature in database
GPG key ID: 343FC20A4ACA62B9

View file

@ -16,8 +16,6 @@
# You should have received a copy of the GNU General Public License
# along with lainsafe. If not, see <https://www.gnu.org/licenses/>.
use Getopt::Long;
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
@ -72,7 +70,7 @@ sub help
print "USAGE: lainsafecli [--tor] [--server] FILE\n\n";
print "if --server not given, $DEFAULT_SERVER is used.\n";
print "--tor is available\n" if $tor_enabled;
print "--tor is unavailable\n" unless $tor_enabled;
print "--tor is unavailable, flag is ignored\n" unless $tor_enabled;
exit;
}
@ -91,7 +89,8 @@ GetOptions ("server=s" => \$DEFAULT_SERVER,
);
&help if $help || not defined $ARGV[0];
&enable_tor if $tor;
&enable_tor if $tor and $tor_enabled;
# check if file is given