include (CheckStructHasMember)
include (CheckCXXCompilerFlag)
-message ("-- Looking for SHA1 references")
-if (EXISTS ${CMAKE_SOURCE_DIR}/.git/index)
- set (HAVE_COMMIT true)
- execute_process (COMMAND git log -1 --pretty=format:%h
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
- OUTPUT_VARIABLE COMMIT)
- message ("-- Found SHA1 reference: ${COMMIT}")
-endif (EXISTS ${CMAKE_SOURCE_DIR}/.git/index)
-
-set (PACKAGE "${PROJECT_NAME}")
-set (PACKAGE_NAME "${PACKAGE}")
-set (PACKAGE_TARNAME "${PACKAGE}")
-
# include the readline library finder module
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules")
### From source
If you would like to avoid this, you can build from source. Doing so requires:
- - cmake
+ - cmake (2.8 or higher)
- make
- gcc
- g++ (sometimes packaged as gcc-c++ or gcc-g++)
- - cpp 11 or higher
- - libreadline development files (7 or 8 is fine)
-```
+ - cpp (11 or higher)
+ - libreadline development files (7 or 8 is fine, 5 is untested)
+```bash
git clone https://codeberg.org/armaan/gen-shell
cd gen-shell
cmake .
### Docker
You can also run gen-shell in docker. Simply use
+```bash
+docker run -it -e CMD=<command-to-run> armaanb/gen-shell:latest
```
-docker run -it -e CMD=<command to run> armaanb/gen-shell:latest
+Or to build the docker container locally
+```bash
+git clone https://codeberg.org/armaan/gen-shell
+cd gen-shell
+docker build -t armaanb/gen-shell:latest .
+docker run -it -e CMD=<command-to-run> armaanb/gen-shell
```
+## License
+Following suit from tasksh, gen-shell is MIT licensed by Armaan Bhojwani, 2020. Gen-shell is forked from tasksh, from which its codebase has been greatly reduced, although the majority of code remaining was written by the tasksh developers [(listed here)](https://github.com/GothenburgBitFactory/taskshell/blob/master/AUTHORS).
#define LANGUAGE_ENG_USA
/* git information */
-#define HAVE_COMMIT
+/* #undef HAVE_COMMIT */
/* cmake information */
#define HAVE_CMAKE
#include <cmake.h>
#include <iostream>
-#include <vector>
-#include <string>
-#include <cstring>
-#include <cstdio>
#include <stdlib.h>
-#include <unistd.h>
#ifdef HAVE_READLINE
#include <readline/readline.h>
#include <vector>
#include <string>
-static std::vector <std::string> contextColors = {
- "bold white on red",
- "bold white on blue",
- "bold white on green",
- "bold white on magenta",
- "black on cyan",
- "black on yellow",
- "black on white",
-};
-
static std::vector <std::string> contexts;
std::string composeContexts (bool pretty = false);
return 0;
}
-////////////////////////////////////////////////////////////////////////////////
-std::string composeContexts (bool pretty /* = false */)
-{
- std::string combined;
- for (unsigned int i = 0; i < contexts.size (); i++)
- if (pretty)
- combined += (combined != "" ? " " : "")
- + std::string ("\001")
- + "\002";
- else
- combined += (combined != "" ? " " : "") + contexts[i];
-
- if (combined != "")
- combined += ' ';
-
- return combined;
-}
-
////////////////////////////////////////////////////////////////////////////////
std::string promptCompose ()
{