Skip to content

Commit

Permalink
ok
Browse files Browse the repository at this point in the history
  • Loading branch information
Mcdostone committed Feb 6, 2025
1 parent caa27a6 commit 4c3ddf5
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 4 deletions.
6 changes: 3 additions & 3 deletions crates/command/src/command/main_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ where
pub debug: bool,
#[clap(short = 'c', short_alias='e', alias="environment", long, value_parser = parse_cluster::<T>, required_unless_present_any=&["version", "help"])]
/// The cluster to use
cluster: Option<T>,
cluster: T,
/// Topics to consume
#[clap(
short,
Expand Down Expand Up @@ -169,8 +169,8 @@ where
Ok(config)
}

pub fn cluster(&self) -> T {
self.cluster.as_ref().unwrap().clone()
pub(crate) fn cluster(&self) -> T {
self.cluster.clone()
}

fn themes(file: &Path) -> Result<HashMap<String, Theme>, Error> {
Expand Down
52 changes: 51 additions & 1 deletion docs/try-it.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,53 @@
set -eo pipefail


# Return the rust target name
function target_name {
# Detect architecture
ARCH=$(uname -m)
case "$ARCH" in
x86_64) ARCH="x86_64" ;;
i686) ARCH="i686" ;;
armv7l) ARCH="armv7" ;;
aarch64) ARCH="aarch64" ;;
arm64) ARCH="aarch64" ;;
*) ARCH="unknown" ;;
esac
# Detect OS
OS=$(uname -s)
case "$OS" in
Linux)
OS="linux"
LIBC=$(ldd --version 2>/dev/null | head -n 1)
ENV="gnu"
;;
Darwin)
OS="apple-darwin"
ENV=""
;;
CYGWIN*|MINGW*|MSYS*)
OS="windows"
ENV="msvc"
;;
*)
OS="unknown"
ENV="unknown"
;;
esac


TARGET="${ARCH}-${OS}-${ENV}"
if [[ -z "$ENV" ]]; then
TARGET="${ARCH}-${OS}"
fi


echo "$TARGET"
}


target_name

# When jbang is not installed,
# it uses the kafka-console-producer to produce records
function fallback_produce {
Expand Down Expand Up @@ -125,4 +172,7 @@ else
echo " cargo run --manifest-path \"${repo}/Cargo.toml\" -- -c localhost"
echo " or"
echo " cargo run --manifest-path \"${repo}/Cargo.toml\" -- -c localhost --headless --topics ${topic} 'from begin'"
fi
fi

# I want to compute the target name based on user machine

0 comments on commit 4c3ddf5

Please sign in to comment.