match Session.cpp
[ghsmtp.git] / Magic-test.cpp
blobc841fbe9d02474717773f066790715230b02c6d1
1 #include "Magic.hpp"
3 #include <algorithm>
4 #include <cstring>
5 #include <iomanip>
6 #include <iostream>
8 int main(int argc, char* argv[])
10 size_t width = 0;
11 for (auto arg{1}; arg < argc; ++arg) {
12 auto const len = strlen(argv[arg]);
13 width = std::max(width, len);
16 Magic magic;
17 for (auto arg{1}; arg < argc; ++arg) {
18 std::cout << std::setw(width) << argv[arg] << ": " << magic.file(argv[arg])
19 << '\n';