From eb5ef0152322218379c493905de5b51a3e4d62da Mon Sep 17 00:00:00 2001 From: sigoden Date: Tue, 11 Jun 2024 07:53:00 +0800 Subject: [PATCH] fix: argc parallel missing argc hooks and array declarations (#340) --- src/bin/argc/main.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/bin/argc/main.rs b/src/bin/argc/main.rs index 3bcbc83..9c9ab76 100644 --- a/src/bin/argc/main.rs +++ b/src/bin/argc/main.rs @@ -1,11 +1,7 @@ mod parallel; use anyhow::{anyhow, bail, Context, Result}; -use argc::{ - compgen_kind, - utils::{escape_shell_words, is_true_value}, - CompKind, NativeRuntime, Runtime, Shell, COMPGEN_KIND_SYMBOL, -}; +use argc::{compgen_kind, utils::*, CompKind, NativeRuntime, Runtime, Shell, COMPGEN_KIND_SYMBOL}; use base64::{engine::general_purpose, Engine as _}; use path_absolutize::Absolutize; use std::{ @@ -317,7 +313,12 @@ fn run_compgen(runtime: NativeRuntime, mut args: Vec) -> Option<()> { fn export_argc_variables(code: &str) -> String { let mut value = code .split('\n') - .filter(|line| line.starts_with(argc::utils::VARIABLE_PREFIX)) + .filter(|line| { + line.starts_with(VARIABLE_PREFIX) + || line.starts_with("declare ") + || *line == BEFORE_HOOK + || *line == AFTER_HOOK + }) .map(|v| v.to_string()) .collect::>() .join(";");