Skip to content

Commit

Permalink
Merge pull request #284 from SylvainCorlay/update-banner
Browse files Browse the repository at this point in the history
Update banner to include language version, update xeus
  • Loading branch information
SylvainCorlay committed Dec 11, 2019
2 parents b0d3935 + 03823cb commit 6be1df4
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ install:
- conda update -q conda
- conda info -a
# Install dependencies
- conda install cmake dirent xeus=0.23.2 cling=0.6.0 clangdev=5.0 llvmdev=5 nlohmann_json=3.6.1 cppzmq=4.3.0 xtl=0.6.5 pugixml cxxopts=2.1.1 -c conda-forge
- conda install cmake dirent xeus=0.23.3 cling=0.6.0 clangdev=5.0 llvmdev=5 nlohmann_json cppzmq=4.3.0 xtl=0.6.9 pugixml cxxopts=2.1.1 -c conda-forge
# Build and install xeus-cling
- mkdir build
- cd build
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ install:
- conda update -q conda
# Install host dependencies
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
conda install xeus=0.23.2 cling=0.6.0 clangdev=5.0 llvmdev=5 nlohmann_json=3.6.1 cppzmq=4.3.0 xtl=0.6.5 pugixml cxxopts=2.1.1 -c conda-forge;
conda install xeus=0.23.3 cling=0.6.0 clangdev=5.0 llvmdev=5 nlohmann_json cppzmq=4.3.0 xtl=0.6.9 pugixml cxxopts=2.1.1 -c conda-forge;
else
conda install xeus=0.23.2 cling=0.6.0 clangdev=5.0 libcxx llvmdev=5 nlohmann_json=3.6.1 cppzmq=4.3.0 xtl=0.6.5 pugixml cxxopts=2.1.1 -c conda-forge;
conda install xeus=0.23.2 cling=0.6.0 clangdev=5.0 libcxx llvmdev=5 nlohmann_json cppzmq=4.3.0 xtl=0.6.9 pugixml cxxopts=2.1.1 -c conda-forge;
fi
# Install build dependencies
- conda install cmake -c conda-forge
Expand Down
4 changes: 2 additions & 2 deletions notebooks/xcpp.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -798,14 +798,14 @@
"kernelspec": {
"display_name": "C++14",
"language": "C++14",
"name": "xeus-cling-cpp14"
"name": "xcpp14"
},
"language_info": {
"codemirror_mode": "text/x-c++src",
"file_extension": ".cpp",
"mimetype": "text/x-c++src",
"name": "c++",
"version": "-std=c++14"
"version": "14"
}
},
"nbformat": 4,
Expand Down
34 changes: 19 additions & 15 deletions src/xinterpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,21 +265,24 @@ namespace xcpp
result["implementation_version"] = XEUS_CLING_VERSION;

/* The jupyter-console banner for xeus-cling is the following:
__ _____ _ _ ___ ___ _ ___ _ _ ___
\ \/ / __| | | / __|___ / __| | |_ _| \| |/ __|
> <| _|| |_| \__ \___| (__| |__ | || .` | (_ |
/_/\_\___|\___/|___/ \___|____|___|_|\_|\___|
__ _____ _ _ ___
\ \/ / _ \ | | / __|
> < __/ |_| \__ \
/_/\_\___|\__,_|___/
Jupyter Kernel for the Cling C++ interpreter
xeus-cling: a Jupyter Kernel C++ - based on cling
*/

result["banner"] = " __ _____ _ _ ___ ___ _ ___ _ _ ___ \n"
" \\ \\/ / __| | | / __|___ / __| | |_ _| \\| |/ __|\n"
" > <| _|| |_| \\__ \\___| (__| |__ | || .` | (_ |\n"
" /_/\\_\\___|\\___/|___/ \\___|____|___|_|\\_|\\___|\n"
"\n"
" Jupyter Kernel for the Cling C++ interpreter ";

std::string banner = ""
" __ _____ _ _ ___\n"
" \\ \\/ / _ \\ | | / __|\n"
" > < __/ |_| \\__ \\\n"
" /_/\\_\\___|\\__,_|___/\n"
"\n"
" xeus-cling: a Jupyter Kernel C++ - based on cling\n"
" C++";
banner.append(m_version);
result["banner"] = banner;
result["language_info"]["name"] = "c++";
result["language_info"]["version"] = m_version;
result["language_info"]["mimetype"] = "text/x-c++src";
Expand Down Expand Up @@ -334,13 +337,14 @@ namespace xcpp

std::string interpreter::get_stdopt(int argc, const char* const* argv)
{
std::string res = "-std=c++11";
std::string res = "11";
for (int i = 0; i < argc; ++i)
{
std::string tmp(argv[i]);
if (tmp.find("-std=c++") != std::string::npos)
auto pos = tmp.find("-std=c++");
if (pos != std::string::npos)
{
res = tmp;
res = tmp.substr(pos + 8);
break;
}
}
Expand Down

0 comments on commit 6be1df4

Please sign in to comment.