]> git.armaanb.net Git - gen-shell.git/commitdiff
further reduction
authorArmaan Bhojwani <3fb650a9-b47e-4604-a282-1dd91953b2ee@anonaddy.me>
Fri, 30 Oct 2020 15:47:46 +0000 (11:47 -0400)
committerArmaan Bhojwani <3fb650a9-b47e-4604-a282-1dd91953b2ee@anonaddy.me>
Fri, 30 Oct 2020 15:47:46 +0000 (11:47 -0400)
CMakeLists.txt
README.md
cmake.h
src/main.cpp
src/prompt.cpp

index 40a3ead3d04728423b0fb96c42e628c59e323f66..31151dedca7fea02e78518484fd45d184479b830 100644 (file)
@@ -9,19 +9,6 @@ include (CheckFunctionExists)
 include (CheckStructHasMember)
 include (CheckCXXCompilerFlag)
 
 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")
 
 # include the readline library finder module
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules")
 
index 11f0511d5116f94efe75cc693b2de2e335e1d6b2..c1f9fc8861fcfc53876e60f652d0f37b733b79c6 100644 (file)
--- a/README.md
+++ b/README.md
@@ -12,13 +12,13 @@ Binaries can be downloaded [from here](https://build.bhojwani.org/job/gen-shell/
 
 ### From source
 If you would like to avoid this, you can build from source. Doing so requires:
 
 ### 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++)
   - 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 .
 git clone https://codeberg.org/armaan/gen-shell
 cd gen-shell
 cmake .
@@ -30,6 +30,15 @@ Or if you don't have root access, you can subsitute the last line with
 
 ### Docker
 You can also run gen-shell in docker. Simply use
 
 ### 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).
diff --git a/cmake.h b/cmake.h
index bce1188e1a3b26489582f85bdcb1db3d35867460..ac1bb92398f35eb4dca12c81bf0591054fa955d7 100644 (file)
--- a/cmake.h
+++ b/cmake.h
@@ -19,7 +19,7 @@
 #define LANGUAGE_ENG_USA 
 
 /* git information */
 #define LANGUAGE_ENG_USA 
 
 /* git information */
-#define HAVE_COMMIT
+/* #undef HAVE_COMMIT */
 
 /* cmake information */
 #define HAVE_CMAKE
 
 /* cmake information */
 #define HAVE_CMAKE
index b334ce793f1c1a02a50077a2c3b05159f73a9b73..703f46ace9cfc527e844feb5023a160beacbfb9a 100644 (file)
 
 #include <cmake.h>
 #include <iostream>
 
 #include <cmake.h>
 #include <iostream>
-#include <vector>
-#include <string>
-#include <cstring>
-#include <cstdio>
 #include <stdlib.h>
 #include <stdlib.h>
-#include <unistd.h>
 
 #ifdef HAVE_READLINE
 #include <readline/readline.h>
 
 #ifdef HAVE_READLINE
 #include <readline/readline.h>
index 93654d4653855c4c58bbd6fe749f77023983abfb..5b2e0487ae0284f95d7beccfcabbd2504c7e35e7 100644 (file)
 #include <vector>
 #include <string>
 
 #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);
 static std::vector <std::string> contexts;
 
 std::string composeContexts (bool pretty = false);
@@ -65,24 +55,6 @@ int promptAdd (const std::string& context)
   return 0;
 }
 
   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 ()
 {
 ////////////////////////////////////////////////////////////////////////////////
 std::string promptCompose ()
 {