Skip to content

Commit a89202a

Browse files
committed
Improves code formatting and compiler compatibility
1 parent bc7482d commit a89202a

File tree

5 files changed

+27
-14
lines changed

5 files changed

+27
-14
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
- Support for variadic positional arguments, allowing multiple values for a single positional argument.
1313

1414
### Changed
15-
- Change `ARGUS_RELEASE` into `ARGUS_DEBUG`
15+
- Changed help output DEFAULT_MAX_LINE_WIDTH from 80 to 100.
16+
- Changed `ARGUS_RELEASE` into `ARGUS_DEBUG`
1617

1718
### Fixed
19+
- Disabled pedantic option on library compilation.
1820
- Defining `argus_init()` as a `static inline` function.
1921

22+
### Removed
23+
- Group description option.
24+
25+
2026
## [0.1.0] - 2025-07-02
2127

2228
### Added

includes/argus/internal/display.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
/*
1616
* Default configuration constants for display formatting
1717
*/
18-
#define DEFAULT_DESCRIPTION_COLUMN 32 // Column where descriptions start
19-
#define DEFAULT_MAX_LINE_WIDTH 80 // Maximum width of a line
20-
#define DEFAULT_OPTION_INDENT 2 // Indentation for options
18+
#define DEFAULT_DESCRIPTION_COLUMN 32 // Column where descriptions start
19+
#define DEFAULT_MAX_LINE_WIDTH 100 // Maximum width of a line
20+
#define DEFAULT_OPTION_INDENT 2 // Indentation for options
2121

2222
/*
2323
* Default Smart Hint configuration

includes/argus/options.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ ARGUS_API char *format_choices_validator(validator_data_t data);
6767
* Optional option fields macros
6868
*/
6969
#ifdef ARGUS_DEBUG
70-
# define ARGUS_DEBUG_INFO .line = __LINE__, .file = __FILE__
70+
# define ARGUS_DEBUG_INFO .line = __LINE__, .file = __FILE__
7171
#else
72-
# define ARGUS_DEBUG_INFO .line = 0, .file = NULL
72+
# define ARGUS_DEBUG_INFO .line = 0, .file = NULL
7373
#endif /* ARGUS_DEBUG */
7474
#define DEFINE_NAME(lname, sname) ((lname) ? (lname) : CHAR_TO_STRING(sname))
7575
#define DEFAULT(val) .value = (argus_value_t){ .raw = (uintptr_t)(val) }, \
@@ -149,7 +149,7 @@ ARGUS_API char *format_choices_validator(validator_data_t data);
149149
(argus_option_t) { \
150150
.type = TYPE_OPTION, .name = DEFINE_NAME(_long, _short), \
151151
.sname = _short, .lname = _long, .value_type = _value_type, \
152-
.free_handler = default_free, ARGUS_DEBUG_INFO, ##__VA_ARGS__ \
152+
.free_handler = default_free, ARGUS_DEBUG_INFO, ##__VA_ARGS__ \
153153
}
154154

155155
#define POSITIONAL_BASE(_name, _value_type, ...) \

meson.build

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,18 @@ argus_lib = both_libraries(
5656
install: true,
5757
vs_module_defs: 'argus.def',
5858
)
59+
dep_compile_args = []
60+
if cc.get_id() == 'gcc'
61+
dep_compile_args = ['-Wno-pedantic']
62+
elif cc.get_id() == 'clang'
63+
dep_compile_args = ['-Wno-gnu-zero-variadic-macro-arguments']
64+
endif
5965

6066
argus_dep = declare_dependency(
6167
link_with: argus_lib,
6268
include_directories: inc_dirs,
6369
dependencies: regex ? [pcre2_dep] : [],
70+
compile_args: dep_compile_args,
6471
)
6572

6673
install_headers('includes/argus.h')

source/display/help/help_organizer.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ group_info_t *find_or_create_group(help_data_t *data, const char *name)
5656
if (!group)
5757
return NULL;
5858

59-
group->name = name;
60-
group->options = NULL;
61-
group->next = NULL;
59+
group->name = name;
60+
group->options = NULL;
61+
group->next = NULL;
6262

6363
if (data->groups == NULL)
6464
data->groups = group;
@@ -74,16 +74,16 @@ group_info_t *find_or_create_group(help_data_t *data, const char *name)
7474

7575
void organize_options(const argus_option_t *options, help_data_t *data)
7676
{
77-
const char *current_group = NULL;
78-
group_info_t *group = NULL;
77+
const char *current_group = NULL;
78+
group_info_t *group = NULL;
7979

8080
for (int i = 0; options[i].type != TYPE_NONE; ++i) {
8181
const argus_option_t *option = &options[i];
8282

8383
switch (option->type) {
8484
case TYPE_GROUP:
85-
current_group = option->name;
86-
group = NULL;
85+
current_group = option->name;
86+
group = NULL;
8787
break;
8888

8989
case TYPE_OPTION:

0 commit comments

Comments
 (0)