[core] fixed a few bugs

This commit is contained in:
tangxifan 2023-01-11 16:39:25 -08:00
parent 9bbb09ef0f
commit c00c43cbd4
2 changed files with 9 additions and 10 deletions

View File

@ -18,11 +18,11 @@ namespace openfpga {
* - Add associated options
* - Add command dependency
*******************************************************************/
static ShellCommandId add_openfpga_exec_external_command(
static ShellCommandId add_openfpga_ext_exec_command(
openfpga::Shell<OpenfpgaContext>& shell,
const ShellCommandClassId& cmd_class_id,
const std::vector<ShellCommandId>& dependent_cmds) {
Command shell_cmd("exec_external");
Command shell_cmd("ext_exec");
/* Add an option '--command_stream' */
CommandOptionId opt_cmdstream = shell_cmd.add_option(
@ -112,8 +112,8 @@ void add_basic_commands(openfpga::Shell<OpenfpgaContext>& shell) {
std::vector<ShellCommandId>());
/* Add 'exec_external command which can run system call */
add_openfpga_exec_external_command(shell, basic_cmd_class,
std::vector<ShellCommandId>());
add_openfpga_ext_exec_command(shell, basic_cmd_class,
std::vector<ShellCommandId>());
/* Note:
* help MUST be the last to add because the linking to execute function will

View File

@ -4,18 +4,17 @@
* - version
* - help
*******************************************************************/
#include "basic_command.h"
#include "command_exit_codes.h"
#include "openfpga_title.h"
#include "openfpga_basic.h"
/* begin namespace openfpga */
namespace openfpga {
static int source_existing_command(openfpga::Shell<OpenfpgaContext>* shell,
OpenfpgaContext& openfpga_ctx,
const Command& cmd,
const CommandContext& cmd_context) {
int source_existing_command(openfpga::Shell<OpenfpgaContext>* shell,
OpenfpgaContext& openfpga_ctx,
const Command& cmd,
const CommandContext& cmd_context) {
CommandOptionId opt_file = cmd.option("from_file");
CommandOptionId opt_batch_mode = cmd.option("batch_mode");
CommandOptionId opt_ss = cmd.option("command_stream");