| 126 | } |
| 127 | |
| 128 | int |
| 129 | main(int argc, char** argv) |
| 130 | { |
| 131 | if(argc != 2) |
| 132 | { |
| 133 | std::cerr << |
| 134 | "Usage: pretty <filename>" |
| 135 | << std::endl; |
| 136 | return EXIT_FAILURE; |
| 137 | } |
| 138 | |
| 139 | try |
| 140 | { |
| 141 | // Parse the file as JSON |
| 142 | auto const jv = parse_file( argv[1] ); |
| 143 | |
| 144 | // Now pretty-print the value |
| 145 | pretty_print(std::cout, jv); |
| 146 | } |
| 147 | catch(std::exception const& e) |
| 148 | { |
| 149 | std::cerr << |
| 150 | "Caught exception: " |
| 151 | << e.what() << std::endl; |
| 152 | return EXIT_FAILURE; |
| 153 | } |
| 154 | |
| 155 | return EXIT_SUCCESS; |
| 156 | } |
| 157 | |
| 158 | // end::example_pretty[] |
nothing calls this directly
no test coverage detected