Bash++
Bash++ compiler internal documentation
Classes | Functions | Variables
parse_arguments.h File Reference
#include <iostream>
#include <string>
#include <cstring>
#include <vector>
#include <optional>
#include <filesystem>
#include <memory>
#include <getopt.h>
#include <unistd.h>
#include <algorithm>
#include "../version.h"
#include "../updated_year.h"
Include dependency graph for parse_arguments.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Option
 
struct  Arguments
 

Functions

constexpr size_t option_label_length (const Option &opt)
 
constexpr size_t max_option_label_length (const Option *options)
 
std::string generate_help_string ()
 
std::pair< std::vector< char * >, std::vector< char * > > separate_compiler_and_program_options (Arguments *args, int argc, char *argv[])
 
Arguments parse_arguments (int argc, char *argv[])
 

Variables

constexpr const char * program_name = "Bash++"
 
constexpr const char * copyright
 
constexpr Option options []
 

Function Documentation

◆ generate_help_string()

std::string generate_help_string ( )

◆ max_option_label_length()

constexpr size_t max_option_label_length ( const Option options)
constexpr

◆ option_label_length()

constexpr size_t option_label_length ( const Option opt)
constexpr

◆ parse_arguments()

Arguments parse_arguments ( int  argc,
char *  argv[] 
)

◆ separate_compiler_and_program_options()

std::pair< std::vector< char * >, std::vector< char * > > separate_compiler_and_program_options ( Arguments args,
int  argc,
char *  argv[] 
)

Variable Documentation

◆ copyright

constexpr const char* copyright
constexpr
Initial value:
= "Copyright (C) 2024-"
" Andrew S. Rightenburg\n\n"
"This program is free software; you can redistribute it and/or modify\n"
"it under the terms of the GNU General Public License as published by\n"
"the Free Software Foundation; either version 3 of the License, or\n"
"(at your option) any later version.\n\n"
"This program is distributed in the hope that it will be useful,\n"
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
"GNU General Public License for more details.\n\n"
"You should have received a copy of the GNU General Public License\n"
"along with this program. If not, see http://www.gnu.org/licenses/.\n"
#define bpp_compiler_updated_year
Definition updated_year.h:1

◆ options

constexpr Option options[]
constexpr
Initial value:
= {
{'o', "output", "Specify output file (default: run on exit)", true},
{'b', "target-bash", "Target Bash version (default: 5.2)", true},
{'s', "no-warnings", "Suppress warnings", false},
{'I', "include", "Add directory to include path", true},
{'p', "parse-tree", "Display parse tree (do not compile program)", false},
{'t', "tokens", "Display tokens (do not compile program)", false},
{'v', "version", "Display version information", false},
{'h', "help", "Display this help message", false},
{0, nullptr, nullptr, false}
}

◆ program_name

constexpr const char* program_name = "Bash++"
constexpr

Copyright (C) 2025 Andrew S. Rightenburg Bash++: Bash with classes