0

Add an option for silent operation

This commit is contained in:
Sergey Alirzaev
2019-08-15 00:01:45 +03:00
parent e12231261f
commit 95173d9e07

View File

@@ -192,6 +192,7 @@ my ($opt, $usage) = Getopt::Long::Descriptive::describe_options
['and only via mobile API for now (be sure to specify Authorization header value)'],
[],
['link|l', 'do not fetch, only print links to the tracks'],
['silent|s', 'do not print informational messages'],
['debug', 'print debug info during work'],
['help', 'print usage'],
[],
@@ -1033,6 +1034,11 @@ sub info
{
my ($type, $msg) = @_;
if($opt{silent} && $type ne ERROR)
{
return;
}
if($type eq DEBUG)
{
return if !$opt{debug};