MCPcopy Create free account
hub / github.com/SpartanJ/eepp / replaceExecutableArgs

Function replaceExecutableArgs

src/tools/ecode/plugins/debugger/debuggerplugin.cpp:75–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73static constexpr auto KEY_DEBUG_SERVER = "debugServer";
74
75static void replaceExecutableArgs( std::string& arg ) {
76 LuaPattern ptrn( "%$%b()" );
77 PatternMatcher::Range match[4];
78 while ( ptrn.matches( arg, match ) ) {
79 auto cmd = arg.substr( match[0].start, match[0].end - match[0].start );
80 if ( cmd.size() > 3 ) {
81 auto rcmd = cmd.substr( 2, cmd.size() - 3 );
82 std::string out;
83 Process p;
84 if ( p.create( rcmd ) ) {
85 p.readAllStdOut( out );
86 String::trimInPlace( out, '\n' );
87 String::trimInPlace( out, '\t' );
88 String::replaceAll( arg, cmd, out );
89 }
90 }
91 };
92}
93
94static bool replaceEnvVars( std::string& arg, PluginContextProvider* ctx ) {
95 PatternMatcher::Range match[4];

Callers 1

runMethod · 0.85

Calls 5

substrMethod · 0.80
readAllStdOutMethod · 0.80
matchesMethod · 0.45
sizeMethod · 0.45
createMethod · 0.45

Tested by

no test coverage detected