Skip to content
Snippets Groups Projects
Commit e2a41015 authored by Recolic K's avatar Recolic K
Browse files

fix farking windows issue

parent 7564f4d0
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,21 @@ ...@@ -5,6 +5,21 @@
#include <algorithm> #include <algorithm>
#include <string> #include <string>
#ifdef _WIN32
#include <fcntl.h>
#include <io.h>
#ifdef __BORLANDC__
#define _setmode setmode
#endif
inline void fix_fucking_windows_crlf_bug() {
_setmode(_fileno(stdout), _O_BINARY);
}
#else
#define fix_fucking_windows_crlf_bug()
#endif
using nlohmann::json; using nlohmann::json;
using std::string; using std::string;
using std::vector; using std::vector;
...@@ -74,9 +89,10 @@ void naive_json_access_path(json &input, rlib::string json_path) { ...@@ -74,9 +89,10 @@ void naive_json_access_path(json &input, rlib::string json_path) {
} }
int main(int argc, char **argv) { int main(int argc, char **argv) {
fix_fucking_windows_crlf_bug();
rlib::opt_parser args(argc, argv); rlib::opt_parser args(argc, argv);
if(args.getBoolArg("-h", "--help")) { if(args.getBoolArg("-h", "--help")) {
rlib::println("json2table version 1.0.6-2, maintainer Recolic Keghart <root@recolic.net>"); rlib::println("json2table version 1.0.6-3, maintainer Recolic Keghart <root@recolic.net>");
rlib::println("Usage: cat xxx.json | json2table"); rlib::println("Usage: cat xxx.json | json2table");
rlib::println("Usage: curl https://myapi/getJson | json2table /path/to/subobject"); rlib::println("Usage: curl https://myapi/getJson | json2table /path/to/subobject");
rlib::println("Set --programming / -p to make the output easier for program to process. "); rlib::println("Set --programming / -p to make the output easier for program to process. ");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment