[nostalgia/tools/pack] Cleanup
This commit is contained in:
parent
33d40b1839
commit
35a08a4ce8
@ -7,13 +7,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
||||||
#include <ox/clargs/clargs.hpp>
|
#include <ox/clargs/clargs.hpp>
|
||||||
#include <ox/fs/fs.hpp>
|
#include <ox/fs/fs.hpp>
|
||||||
#include <ox/std/trace.hpp>
|
|
||||||
|
|
||||||
#include "pack/pack.hpp"
|
#include "pack/pack.hpp"
|
||||||
|
|
||||||
static ox::Error writeFileBuff(const ox::String &path, ox::Vector<char> &buff) noexcept {
|
static ox::Error writeFileBuff(const ox::String &path, const ox::Vector<char> &buff) noexcept {
|
||||||
try {
|
try {
|
||||||
std::ofstream f(path.c_str(), std::ios::binary);
|
std::ofstream f(path.c_str(), std::ios::binary);
|
||||||
f.write(buff.data(), static_cast<intptr_t>(buff.size()));
|
f.write(buff.data(), static_cast<intptr_t>(buff.size()));
|
||||||
@ -24,8 +24,9 @@ static ox::Error writeFileBuff(const ox::String &path, ox::Vector<char> &buff) n
|
|||||||
}
|
}
|
||||||
|
|
||||||
static ox::Error run(const ox::ClArgs &args) noexcept {
|
static ox::Error run(const ox::ClArgs &args) noexcept {
|
||||||
auto argSrc = args.getString("src", "");
|
ox::trace::init();
|
||||||
auto argDst = args.getString("dst", "");
|
const auto argSrc = args.getString("src", "");
|
||||||
|
const auto argDst = args.getString("dst", "");
|
||||||
if (argSrc == "") {
|
if (argSrc == "") {
|
||||||
oxErr("\033[31;1;1merror:\033[0m must specify a source directory\n");
|
oxErr("\033[31;1;1merror:\033[0m must specify a source directory\n");
|
||||||
return OxError(1, "must specify a source directory");
|
return OxError(1, "must specify a source directory");
|
||||||
@ -50,7 +51,6 @@ static ox::Error run(const ox::ClArgs &args) noexcept {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, const char **args) {
|
int main(int argc, const char **args) {
|
||||||
ox::trace::init();
|
|
||||||
auto err = run(ox::ClArgs(argc, args));
|
auto err = run(ox::ClArgs(argc, args));
|
||||||
oxAssert(err, "pack failed");
|
oxAssert(err, "pack failed");
|
||||||
return static_cast<int>(err);
|
return static_cast<int>(err);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user