Skip to content

Commit

Permalink
Modified json syntax file generation so default value of keyword and …
Browse files Browse the repository at this point in the history
…flag that tells if the keyword is reusable are both output to json file
  • Loading branch information
Gareth Aneurin Tribello committed Oct 3, 2024
1 parent d59f49c commit 2047882
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cltools/GenJson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ int GenJson::main(FILE* in, FILE*out,Communicator& pc) {
if( mydescrip.find("\\")!=std::string::npos ) error("found invalid backslash character documentation for keyword " + keys.getKeyword(j) + " in action " + action_names[i] );
std::string argtype = keys.getArgumentType( keys.getKeyword(j) );
if( argtype.length()>0 ) std::cout<<" \""<<keys.getKeyword(j)<<"\" : { \"type\": \""<<keys.getStyle(keys.getKeyword(j))<<"\", \"description\": \""<<mydescrip<<"\", \"multiple\": "<<keys.numbered( keys.getKeyword(j) )<<", \"argtype\": \""<<argtype<<"\"}";
else if( defa.length()>0 ) std::cout<<" \""<<keys.getKeyword(j)<<"\" : { \"type\": \""<<keys.getStyle(keys.getKeyword(j))<<"\", \"description\": \""<<mydescrip<<"\", \"default\": \""<<defa<<"\"}";
else if( defa.length()>0 ) std::cout<<" \""<<keys.getKeyword(j)<<"\" : { \"type\": \""<<keys.getStyle(keys.getKeyword(j))<<"\", \"description\": \""<<mydescrip<<"\", \"multiple\": "<<keys.numbered( keys.getKeyword(j) )<<", \"default\": \""<<defa<<"\"}";
else std::cout<<" \""<<keys.getKeyword(j)<<"\" : { \"type\": \""<<keys.getStyle(keys.getKeyword(j))<<"\", \"description\": \""<<mydescrip<<"\", \"multiple\": "<<keys.numbered( keys.getKeyword(j) )<<"}";
if( j==keys.size()-1 && !keys.exists("HAS_VALUES") ) std::cout<<std::endl; else std::cout<<","<<std::endl;
}
Expand Down

0 comments on commit 2047882

Please sign in to comment.