diff --git a/symlinks/bin/kafkadocker b/symlinks/bin/kafkadocker new file mode 100755 index 0000000..8741859 --- /dev/null +++ b/symlinks/bin/kafkadocker @@ -0,0 +1,44 @@ +#!/usr/bin/env bash + +# Runs commands for kafka CLI in docker +POSITIONAL=() +NETWORK=docker_default +HOST=kafka +PORT=9092 +SKIP_SERVER=0 +while [[ $# -gt 0 ]]; do + key="$1" + + case $key in + -n|--network) + NETWORK=$2 + shift # past argument + shift # past value + ;; + -h|--host) + HOST=$2 + shift # past argument + shift # past value + ;; + -p|--port) + PORT=$2 + shift # past argument + shift # past value + ;; + --no-server) + SKIP_SERVER=1 + shift # past argument + ;; + *) # unknown option + POSITIONAL+=("$1") # save it in an array for later + shift # past argument + ;; + esac +done + +if [ $SKIP_SERVER -eq 0 ]; then + POSITIONAL+=("--bootstrap-server $HOST:$PORT") +fi + +echo "docker run -it --rm --network $NETWORK bitnami/kafka:latest ${POSITIONAL[@]} " +docker run -it --rm --network $NETWORK bitnami/kafka:latest ${POSITIONAL[@]} diff --git a/symlinks/config/fish/completions/kafkadocker.fish b/symlinks/config/fish/completions/kafkadocker.fish new file mode 100644 index 0000000..c5b25a1 --- /dev/null +++ b/symlinks/config/fish/completions/kafkadocker.fish @@ -0,0 +1 @@ +complete -c kafkadocker -x -a 'connect-distributed.sh kafka-console-consumer.sh kafka-features.sh kafka-reassign-partitions.sh kafka-topics.sh zookeeper-server-stop.sh connect-mirror-maker.sh kafka-console-producer.sh kafka-get-offsets.sh kafka-replica-verification.sh kafka-transactions.sh zookeeper-shell.sh connect-standalone.sh kafka-consumer-groups.sh kafka-leader-election.sh kafka-run-class.sh kafka-verifiable-consumer.sh kafka-acls.sh kafka-consumer-perf-test.sh kafka-log-dirs.sh kafka-server-start.sh kafka-verifiable-producer.sh kafka-broker-api-versions.sh kafka-delegation-tokens.sh kafka-metadata-shell.sh kafka-server-stop.sh trogdor.sh kafka-cluster.sh kafka-delete-records.sh kafka-mirror-maker.sh kafka-storage.sh zookeeper-security-migration.sh kafka-configs.sh kafka-dump-log.sh kafka-producer-perf-test.sh kafka-streams-application-reset.sh zookeeper-server-start.sh'