fx.cmdline: convert to new assembly build system

This commit is contained in:
2026-05-03 16:49:33 +01:00
parent 44fed67d43
commit f4469c9eb0
10 changed files with 591 additions and 279 deletions
+35 -17
View File
@@ -1,10 +1,10 @@
#ifndef _FX_COMMAND_H_
#define _FX_COMMAND_H_
#include <fx/bst.h>
#include <fx/cmd.h>
#include <fx/core/bst.h>
#include <fx/core/queue.h>
#include <fx/ds/string.h>
#include <fx/queue.h>
#include <fx/string.h>
#define F_RED "[bright_red]"
#define F_GREEN "[bright_green]"
@@ -105,23 +105,31 @@ struct fx_arglist {
};
FX_API struct fx_command *fx_command_get_subcommand_with_name(
struct fx_command *cmd, const char *name);
struct fx_command *cmd,
const char *name);
FX_API struct fx_command *fx_command_get_subcommand_with_long_name(
struct fx_command *cmd, const char *long_name);
struct fx_command *cmd,
const char *long_name);
FX_API struct fx_command *fx_command_get_subcommand_with_short_name(
struct fx_command *cmd, char short_name);
struct fx_command *cmd,
char short_name);
FX_API struct fx_command_option *fx_command_get_option_with_long_name(
struct fx_command *cmd, const char *long_name);
struct fx_command *cmd,
const char *long_name);
FX_API struct fx_command_option *fx_command_get_option_with_short_name(
struct fx_command *cmd, char short_name);
struct fx_command *cmd,
char short_name);
FX_API struct fx_command_option *fx_command_get_option_with_id(
struct fx_command *cmd, unsigned int id);
struct fx_command *cmd,
unsigned int id);
FX_API struct fx_command_arg *fx_command_get_arg_with_id(
struct fx_command *cmd, unsigned int id);
struct fx_command *cmd,
unsigned int id);
FX_API struct fx_command_arg *fx_command_option_get_arg_with_id(
struct fx_command_option *opt, unsigned int id);
struct fx_command_option *opt,
unsigned int id);
FX_API struct fx_command_option *fx_command_option_create(void);
FX_API void fx_command_option_destroy(struct fx_command_option *opt);
@@ -131,21 +139,31 @@ FX_API void fx_command_arg_destroy(struct fx_command_arg *arg);
FX_API struct fx_arglist *fx_arglist_create(void);
FX_API fx_status fx_arglist_parse(
struct fx_arglist *args, struct fx_command **cmd, int argc,
struct fx_arglist *args,
struct fx_command **cmd,
int argc,
const char **argv);
FX_API void fx_arglist_destroy(struct fx_arglist *args);
FX_API fx_string *z__fx_command_default_usage_string(
struct fx_command *cmd, struct fx_command_option *with_opt,
struct fx_command *cmd,
struct fx_command_option *with_opt,
const struct fx_arglist *args);
FX_API void z__fx_get_arg_usage_string(
struct fx_command_arg *arg, bool colour, fx_string *out);
FX_API void z__fx_get_arg_description(struct fx_command_arg *arg, fx_string *out);
struct fx_command_arg *arg,
bool colour,
fx_string *out);
FX_API void z__fx_get_arg_description(
struct fx_command_arg *arg,
fx_string *out);
FX_API void z__fx_get_option_usage_string(
struct fx_command_option *opt, enum cmd_string_flags flags, fx_string *out);
struct fx_command_option *opt,
enum cmd_string_flags flags,
fx_string *out);
FX_API void z__fx_get_option_description(
struct fx_command_option *opt, fx_string *out);
struct fx_command_option *opt,
fx_string *out);
#endif