Skip to content

Commit

Permalink
pathfinder: finish implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
XPhyro committed Aug 18, 2024
1 parent 2c496b6 commit 39a267d
Show file tree
Hide file tree
Showing 11 changed files with 679 additions and 381 deletions.
3 changes: 1 addition & 2 deletions src/cpp/project/pathfinder/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ else
include =
endif

CXXFLAGS_NOWARN = -O3 -DNDEBUG -std=c++23 -pedantic $(include)
CXXFLAGS = $(warnings) $(CXXFLAGS_NOWARN)
CXXFLAGS = $(warnings) -O3 -DNDEBUG -std=c++2c -pedantic -fpermissive $(include)
LDFLAGS = $(libs)

EXE = pathfinder
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "options.hpp"
#include "cli.hpp"

#include <iostream>

Expand All @@ -7,24 +7,22 @@
#include <lyra/lyra.hpp>

#include <xph/exec_info.hpp>
#include <xph/lexical_cast.hpp>

#include "command.hpp"
#include "cmd.hpp"

paf::Options::Options(int argc, char** argv)
paf::cli::cli(int argc, char** argv)
{
bool help = false;
auto cli = lyra::cli() |
lyra::help(help).description("Pathfinding interface for interactive shells.");

paf::Alias alias{ cli };
paf::Mark mark{ cli };
paf::Unmark unmark{ cli };
paf::ToggleMark toggle_markj{ cli };
paf::Jump jump{ cli };
paf::Open open{ cli };
paf::Print print{ cli };
paf::List list{ cli };
paf::alias _{ cli };
paf::mark _{ cli };
paf::unmark _{ cli };
paf::jump _{ cli };
paf::open _{ cli };
paf::print _{ cli };
paf::list _{ cli };

auto args = cli.parse({ argc, argv });

Expand All @@ -39,3 +37,8 @@ paf::Options::Options(int argc, char** argv)
std::exit(EXIT_SUCCESS);
}
}

[[noreturn]] void paf::cli::run(void)
{
std::exit(EXIT_SUCCESS);
}
13 changes: 13 additions & 0 deletions src/cpp/project/pathfinder/src/cli.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef HEADER_SCRIPTS_CXX_PAF_CLI_
#define HEADER_SCRIPTS_CXX_PAF_CLI_

namespace paf {
class cli {
public:
cli(void) = delete;
cli(int argc, char** argv);
[[noreturn]] void run(void);
};
} // namespace paf

#endif /* ifndef HEADER_SCRIPTS_CXX_PAF_CLI_ */
Loading

0 comments on commit 39a267d

Please sign in to comment.