From 89bf57f33a9f0f5a96fc50e272c83d926fa35c4a Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Mon, 17 Aug 2026 19:21:52 +0800 Subject: refactor!: replace build.rs with compile-time macro build steps BREAKING CHANGE: Replace the `build`/`builds` feature system with compile-time macro-driven generation. `gen_program!()` now automatically invokes `build_comp!()` and `build_pathf!()` when the `comp`/`pathf` features are enabled, eliminating the need for `build.rs` and `[build-dependencies]` blocks. This removes the `build` feature, the `mingling::build` module, and all related build-time API functions. Completion scripts are now written to `{target_directory}/mingling/` instead of `target/release/`. The `mingling_cli` uses `build_comp!("mling")` for its custom binary name. --- mingling_core/tmpls/comps/bash.sh | 67 --------------------------------------- 1 file changed, 67 deletions(-) delete mode 100644 mingling_core/tmpls/comps/bash.sh (limited to 'mingling_core/tmpls/comps/bash.sh') diff --git a/mingling_core/tmpls/comps/bash.sh b/mingling_core/tmpls/comps/bash.sh deleted file mode 100644 index edec28d..0000000 --- a/mingling_core/tmpls/comps/bash.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env bash -_<<>>_bash_completion() { - local line="${COMP_LINE:0:COMP_POINT}" - local cur="${line##* }" - local prev="" - local word_index=1 - - local before="${line:0:$(( ${#line} - ${#cur} ))}" - local -a before_words - if [[ -n "$before" ]]; then - read -ra before_words <<< "$before" - word_index=$(( ${#before_words[@]} + 1 )) - if [[ $word_index -gt 1 ]]; then - prev="${before_words[${#before_words[@]}-1]}" - fi - fi - - local args=() - args+=(-f "${COMP_LINE//-/^}") - args+=(-C "$COMP_POINT") - args+=(-w "${cur//-/^}") - args+=(-p "${prev//-/^}") - args+=(-c "${COMP_WORDS[0]//-/^}") - args+=(-i "$word_index") - args+=(-F "bash") - - for word in "${COMP_WORDS[@]}"; do - args+=(-a "${word//-/^}") - done - - local suggestions - if suggestions=$(<<>> __comp "${args[@]}" 2>/dev/null); then - if [ $? -eq 0 ]; then - if [ "$suggestions" = "_file_" ]; then - compopt -o default - COMPREPLY=() - return - fi - - if [ -n "$suggestions" ]; then - local -a all_suggestions filtered - mapfile -t all_suggestions < <(printf '%s\n' "$suggestions") - - for suggestion in "${all_suggestions[@]}"; do - [ -z "$cur" ] || [[ "$suggestion" == "$cur"* ]] && filtered+=("$suggestion") - done - - if [ ${#filtered[@]} -gt 0 ]; then - COMPREPLY=("${filtered[@]}") - if [[ "$cur" == *:* && "$COMP_WORDBREAKS" == *:* ]]; then - local colon_prefix="${cur%"${cur##*:}"}" - local -a ltrimmed=() - for suggestion in "${COMPREPLY[@]}"; do - ltrimmed+=("${suggestion#"$colon_prefix"}") - done - COMPREPLY=("${ltrimmed[@]}") - fi - fi - return - fi - fi - fi - - COMPREPLY=() -} - -complete -F _<<>>_bash_completion <<>> -- cgit