andig / carddav2fb

Download CardDAV VCards and upload as phonebook to AVM FRITZ!Box
63 stars 19 forks source link

Quiet doesn't work #199

Open Wonko52 opened 4 years ago

Wonko52 commented 4 years ago

The command line option "-" or "--quiet" doesn't work. It displays the normal output.

# ./carddav2fb run -q
Downloading recent FRITZ!Box phonebook
Downloading vCard(s) from account xxx

Downloaded 489 vCard(s)
Downloaded 489 vCard(s) in total
Dissolving groups (e.g. iCloud)
Dissolved 0 group(s)
Filtering 489 vCard(s)
Filtered 0 vCard(s)
Contact without phone numbers will be skipped
...
andig commented 4 years ago

Just guessing here: the quiet option is probably Symfony standard. It doesn't have any effect since we're using error_log instead of Symfony output for printing to be able to separate dumped date from progress. Easiest thing would be to remove that option.

Wonko52 commented 4 years ago

I think a common use case is that the script is executed as a cron-job. In my case on a Raspberry. Cron sends the output of the process by mail. So I get a daily mail, even if everything was fine.

To prevent this, I start the script with >/dev/null 2>&1

But this also means that I do not get a mail in case of an error.

It would be helpful if there was a quiet option that only outputs when an error occurs.