Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: argc parallel missing argc hooks and array declarations #340

Merged
merged 1 commit into from
Jun 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/bin/argc/main.rs
Original file line number Diff line number Diff line change
@@ -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::{
Expand Down Expand Up @@ -317,7 +313,12 @@ fn run_compgen(runtime: NativeRuntime, mut args: Vec<String>) -> 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::<Vec<String>>()
.join(";");
Expand Down