FROM debian:buster-slim AS builder
RUN apt-get update && apt-get install -y cmake gcc g++ git libreadline-dev make
-RUN git clone https://codeberg.org/armaan/gen-shell.git /app
+RUN git clone --recursive https://codeberg.org/armaan/gen-shell.git /app
WORKDIR /app
RUN cmake --configure .
RUN cmake --build .
RUN apt-get update && apt-get install -y cpp libreadline7 libncurses6
WORKDIR /app
COPY --from=builder /app/src/gen-shell .
-ENTRYPOINT ./gen-shell $CMD
+ENTRYPOINT ./gen-shell -c $CMD
A simple way to turn any command into a shell with arrow key/history support. This is a fork of [taskshell](https://github.com/GothenburgBitFactory/taskshell) with a highly reduce codebase.
## Usage
-Just put the command that you want to repeat after `gen-shell`, eg; `gen-shell ls`, or even something much more complex like `gen-shell "cd /home/armaa/Clone/words && /home/armaa/Clone/words/bin/words` This command was actually the inspiration for gen-shell.
+Just put the command that you want to repeat after the c flag, eg; `gen-shell -c ls`, or even something much more complex like `gen-shell -c "cd /home/armaa/Clone/words && /home/armaa/Clone/words/bin/words` This command was actually the inspiration for gen-shell.
## Installation
### Binaries
- g++ (sometimes packaged as gcc-c++ or gcc-g++)
- cpp (11 or higher)
- libreadline development files (7 or 8 is fine, 5 is untested)
+
+On a Debian or Ubuntu based distribution, you can install these dependencies with this command:
+```bash
+sudo apt update && sudo apt install cmake make gcc g++ cpp libreadline-dev
+```
+
```bash
-git clone https://codeberg.org/armaan/gen-shell
+git clone --recursive https://codeberg.org/armaan/gen-shell
cd gen-shell
cmake .
make
```bash
docker run -it -e CMD=<command-to-run> armaanb/gen-shell:latest
```
-Or to build the docker container locally
+Or to build the docker container locally, which ensures that you are using the latest version, or lets you make changes to the source code before building:
```bash
-git clone https://codeberg.org/armaan/gen-shell
+git clone --recursive https:/codeberg.org/armaan/gen-shell
cd gen-shell
-docker build -t armaanb/gen-shell:latest .
+docker build --no-cache -t armaanb/gen-shell:latest .
docker run -it -e CMD=<command-to-run> armaanb/gen-shell
```
## License
cmake_minimum_required (VERSION 2.8)
include_directories (${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/src
- ${CMAKE_SOURCE_DIR}/src/libshared/src
${GEN-SHELL_INCLUDE_DIRS})
set (gen-shell_SRCS prompt.cpp