Skip to content

Latest commit

 

History

History
36 lines (22 loc) · 666 Bytes

README.md

File metadata and controls

36 lines (22 loc) · 666 Bytes

cppsh

cppsh is a shell script that "interprets" single C++ files.

Usage

$ cppsh source.cpp

You can also initialize your .cpp file with the following line:

#!/usr/bin/env cppsh

And then execute the file directly:

$ chmod +x file.cpp
$ ./file.cpp

If the source file does not exist, it is created with a hello world stump.

$ cppsh doesNotExist.cpp

Flags

You can add compile/linker flags with special comments:

   // cppsh::CPPFLAGS -DLOG=1
   // cppsh::CXXFLAGS -march=native
   // cppsh::LDFLAGS -flto
   // cppsh::LIBS -lcurl
   // cppsh::VERBOSE 1

Example

The file test.cpp shows all commandline arguments.