Only attempt to show receipts if there are any.

Previously "Receipts:" was still shown.
develop
tastytea 2018-09-14 23:59:20 +02:00
parent 4a9c513b55
commit 08ff4d628b
No known key found for this signature in database
GPG Key ID: CFC39497F1B26E07
2 changed files with 7 additions and 4 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required (VERSION 3.6) cmake_minimum_required (VERSION 3.6)
project (whyblocked project (whyblocked
VERSION 0.6.1 VERSION 0.6.2
LANGUAGES CXX LANGUAGES CXX
) )

View File

@ -151,6 +151,8 @@ const bool whyblocked_text::start()
} }
cout << std::get<1>(result) << '\n'; cout << std::get<1>(result) << '\n';
if (!std::get<2>(result).empty())
{
cout << "Receipts:\n"; cout << "Receipts:\n";
for (const string &url : std::get<2>(result)) for (const string &url : std::get<2>(result))
{ {
@ -158,6 +160,7 @@ const bool whyblocked_text::start()
} }
} }
} }
}
break; break;
} }
case 'h': case 'h':