Add an option for silent operation
This commit is contained in:
@@ -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)'],
|
['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'],
|
['link|l', 'do not fetch, only print links to the tracks'],
|
||||||
|
['silent|s', 'do not print informational messages'],
|
||||||
['debug', 'print debug info during work'],
|
['debug', 'print debug info during work'],
|
||||||
['help', 'print usage'],
|
['help', 'print usage'],
|
||||||
[],
|
[],
|
||||||
@@ -1033,6 +1034,11 @@ sub info
|
|||||||
{
|
{
|
||||||
my ($type, $msg) = @_;
|
my ($type, $msg) = @_;
|
||||||
|
|
||||||
|
if($opt{silent} && $type ne ERROR)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if($type eq DEBUG)
|
if($type eq DEBUG)
|
||||||
{
|
{
|
||||||
return if !$opt{debug};
|
return if !$opt{debug};
|
||||||
|
|||||||
Reference in New Issue
Block a user