toolchain: xpcg: update libfx usage
This commit is contained in:
+12
-4
@@ -6,7 +6,7 @@
|
||||
#include "msg.h"
|
||||
#include "parse.h"
|
||||
|
||||
#include <fx/cmd.h>
|
||||
#include <fx/cmdline/cmd.h>
|
||||
#include <fx/io/file.h>
|
||||
#include <fx/io/path.h>
|
||||
|
||||
@@ -70,7 +70,12 @@ static int xpcg(
|
||||
const fx_array *args)
|
||||
{
|
||||
const char *path = NULL;
|
||||
fx_arglist_get_string(opt, FX_COMMAND_INVALID_ID, ARG_SRCPATH, 0, &path);
|
||||
fx_arglist_get_string(
|
||||
opt,
|
||||
FX_COMMAND_INVALID_ID,
|
||||
ARG_SRCPATH,
|
||||
0,
|
||||
&path);
|
||||
if (!path) {
|
||||
fx_arglist_report_missing_args(
|
||||
opt,
|
||||
@@ -81,8 +86,11 @@ static int xpcg(
|
||||
}
|
||||
|
||||
fx_file *file = NULL;
|
||||
fx_result result
|
||||
= fx_file_open(NULL, FX_RV_PATH(path), FX_FILE_READ_ONLY, &file);
|
||||
fx_result result = fx_file_open(
|
||||
NULL,
|
||||
FX_RV_PATH(path),
|
||||
FX_FILE_READ_ONLY,
|
||||
&file);
|
||||
if (fx_result_is_error(result)) {
|
||||
fx_throw(result);
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user