libopenfpga/libopenfpgashell/src/command_echo.cpp
/*********************************************************************
 * Print all the options that have been parsed to an object of CommandContext
 * This function is mainly used to validate what options have been enabled
 * for users' confirmation
 ********************************************************************/
Print all the options that have been parsed to an object of CommandContext
This function is mainly used to validate what options have been enabled
for users' confirmation
Print all the options that have been parsed to an object of CommandContext This function is mainly used to validate what options have been enabled for users ' confirmation
void print_command_context(const Command& cmd, 
                           const CommandContext& cmd_context) {
  VTR_LOG("\nConfirm selected options when call command '%s':\n",
          cmd.name().c_str());
  for (const CommandOptionId& opt : cmd.options()) {
    VTR_LOG("--%s",
            cmd.option_name(opt).c_str());
    if (false == cmd.option_short_name(opt).empty()) {
      VTR_LOG(", -%s",
              cmd.option_short_name(opt).c_str());
    }
    if (false == cmd.option_require_value(opt)) {
      VTR_LOG(": %s\n",
              cmd_context.option_enable(cmd, opt) ? "on" : "off");
    } else {
      VTR_ASSERT_SAFE (true == cmd.option_require_value(opt));
      std::string opt_value;
      if (false == cmd_context.option_enable(cmd, opt)) {
        opt_value = std::string("off");
      } else {
        opt_value = cmd_context.option_value(cmd, opt);
      }
      VTR_LOG(": %s\n",
              opt_value.c_str());
    }
  } 
}
void print_command_context ( const Command & cmd , const CommandContext & cmd_context ) { VTR_LOG ( " \n \n " , cmd . name ( ) . c_str ( ) ) ; for ( const CommandOptionId & opt : cmd . options ( ) ) { VTR_LOG ( " " , cmd . option_name ( opt ) . c_str ( ) ) ; if ( false == cmd . option_short_name ( opt ) . empty ( ) ) { VTR_LOG ( " " , cmd . option_short_name ( opt ) . c_str ( ) ) ; } if ( false == cmd . option_require_value ( opt ) ) { VTR_LOG ( " \n " , cmd_context . option_enable ( cmd , opt ) ? " " : " " ) ; } else { VTR_ASSERT_SAFE ( true == cmd . option_require_value ( opt ) ) ; std :: string opt_value ; if ( false == cmd_context . option_enable ( cmd , opt ) ) { opt_value = std :: string ( " " ) ; } else { opt_value = cmd_context . option_value ( cmd , opt ) ; } VTR_LOG ( " \n " , opt_value . c_str ( ) ) ; } } }
Print all the options that have been parsed to an object of CommandContext
 This function is mainly used to validate what options have been enabled
 for users' confirmation
Print all the options that have been parsed to an object of CommandContext This function is mainly used to validate what options have been enabled for users ' confirmation
/* If the option is disabled, we output an off */