From 95173d9e0711d3ae498112d2d1bbb911235fba78 Mon Sep 17 00:00:00 2001 From: Sergey Alirzaev Date: Thu, 15 Aug 2019 00:01:45 +0300 Subject: [PATCH] Add an option for silent operation --- src/ya.pl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ya.pl b/src/ya.pl index 7aa6cfb..8f5f428 100755 --- a/src/ya.pl +++ b/src/ya.pl @@ -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};