mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
27 lines
530 B
C++
27 lines
530 B
C++
/// \file CommandLine.cpp
|
|
|
|
//
|
|
// This file is distributed under the MIT License. See LICENSE.md for details.
|
|
//
|
|
|
|
#include <fstream>
|
|
#include <iostream>
|
|
|
|
#include "revng/Support/CommandLine.h"
|
|
|
|
namespace cl = llvm::cl;
|
|
|
|
cl::OptionCategory MainCategory("Options", "");
|
|
std::string InputPath;
|
|
|
|
std::ostream &pathToStream(const std::string &Path, std::ofstream &File) {
|
|
if (Path[0] == '-' && Path[1] == '\0') {
|
|
return std::cout;
|
|
} else {
|
|
if (File.is_open())
|
|
File.close();
|
|
File.open(Path);
|
|
return File;
|
|
}
|
|
}
|