refactor(parser): improve code style and modernize macos parser

- Remove unnecessary whitespace in argparse.hpp
- Modernize macos_parser.hpp with if-initializer
- Clean up includes and add [[nodiscard]] attributes
- Add .idea files to gitignore
This commit is contained in:
2025-10-06 16:00:15 +04:00
parent cad569de25
commit f4563fd47b
6 changed files with 742 additions and 26 deletions

View File

@@ -11,9 +11,8 @@ namespace argument_parser {
class macos_parser : public base_parser {
public:
macos_parser() {
int argc = *_NSGetArgc();
char **argv = *_NSGetArgv();
if (argc > 0 && argv != nullptr && argv[0] != nullptr) {
const int argc = *_NSGetArgc();
if (char **argv = *_NSGetArgv(); argc > 0 && argv != nullptr && argv[0] != nullptr) {
program_name = argv[0];
for (int i = 1; i < argc; ++i) {
if (argv[i] != nullptr) parsed_arguments.emplace_back(argv[i]);