Skip to content

Commit

Permalink
Se separa el codigo en mas clases para un mejor entendimiento
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorH028 committed Jul 6, 2024
1 parent 4b2d674 commit 3fbaeab
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
10 changes: 10 additions & 0 deletions .deb/i-haklab/home/.zsh/cache/history
Original file line number Diff line number Diff line change
Expand Up @@ -9233,3 +9233,13 @@ pkg install mingw-w64\
: 1720238804:0;trans -b :en "Mostrar mensaje y salir"
: 1720238900:0;nvim src/below_zero.cpp
: 1720239663:0;git add --all
: 1720239711:0;git commit -m "Se desgloso el codigo nueva mente para un mejor entendimiento"
: 1720239768:0;i-haklab
: 1720239787:0;i-haklab --about lop
: 1720239811:0;bash build_sh.sh
: 1720239870:0;i-haklab --about lop
: 1720239885:0;i-haklab --about
: 1720239912:0;nvim include/below_zero.h
: 1720239922:0;nvim include/command_line_argument_parser.h
: 1720240142:0;cat include/command_line_argument_parser.h
: 1720240496:0;git add --all
Binary file modified build/CMakeFiles/i-haklab.dir/main.cpp.o
Binary file not shown.
Binary file modified build/i-haklab
Binary file not shown.
Binary file modified build/src/CMakeFiles/below_zero.dir/below_zero.cpp.o
Binary file not shown.
Binary file modified build/src/libbelow_zero.so
Binary file not shown.
13 changes: 1 addition & 12 deletions include/command_line_argument_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ using namespace std;
class arguments {
constexpr static auto help_option = "help";
constexpr static auto about_option_name = "about";
constexpr static auto username_option = "username,u";
constexpr static auto verbose_option_name = "verbose";
constexpr static auto verbose_option = "verbose,v";
constexpr static auto files_option_name = "input-files";

boost::program_options::variables_map variables;
friend class command_line_argument_parser;
Expand All @@ -25,20 +21,13 @@ class arguments {

bool help() { return variables.count(help_option) > 0; }

bool verbose() { return variables.count(verbose_option_name) > 0; }


string about() {
return (variables.count(about_option_name) > 0)
? variables[about_option_name].as<string>()
: "";
}

const vector<string> filenames() {
return (variables.count(files_option_name) > 0)
? variables[files_option_name].as<vector<string>>()
: vector<string>();
}
};

class command_line_argument_parser {
Expand All @@ -57,7 +46,7 @@ class command_line_argument_parser {
boost::program_options::variables_map variables;

boost::program_options::positional_options_description p;
p.add(arguments::files_option_name, -1);
// p.add(arguments::files_option_name, -1);

boost::program_options::store(
boost::program_options::command_line_parser(argc, argv)
Expand Down

0 comments on commit 3fbaeab

Please sign in to comment.