1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//! VX Shim - Cross-platform executable shim for vx tool manager
//!
//! This crate provides a lightweight, cross-platform executable that acts as a proxy
//! to other executables, similar to scoop-better-shimexe but written in Rust for
//! better cross-platform support and modern features.
//!
//! ## Features
//!
//! - **Cross-Platform**: Works on Windows, macOS, and Linux
//! - **Fast Execution**: Minimal overhead with efficient process management
//! - **Signal Handling**: Proper Ctrl+C and signal forwarding to child processes
//! - **Process Management**: Automatic cleanup of child processes
//! - **Flexible Configuration**: Support for both TOML and legacy Scoop formats
//! - **Environment Variables**: Support for custom environment variables
//! - **Working Directory**: Configurable working directory for target executables
//!
//! ## Usage
//!
//! ### As a Library
//!
//! ```rust,no_run
//! use vx_shim::{ShimConfig, Executor};
//!
//! # fn main() -> anyhow::Result<()> {
//! // Load configuration
//! let config = ShimConfig::parse(r#"
//! path = "/bin/echo"
//! args = "hello"
//! "#)?;
//!
//! // Execute with arguments
//! let executor = Executor::new(config);
//! let exit_code = executor.execute(&["world".to_string()])?;
//! # Ok(())
//! # }
//! ```
//!
//! ### Shim Management
//!
//! ```rust
//! use vx_shim::ShimManager;
//! use tempfile::TempDir;
//!
//! # fn main() -> anyhow::Result<()> {
//! let temp_dir = TempDir::new()?;
//! let manager = ShimManager::new(temp_dir.path());
//!
//! // Create a shim
//! let shim_path = manager.create_shim("git", "/usr/bin/git", Some("status"))?;
//!
//! // List shims
//! let shims = manager.list_shims()?;
//!
//! // Remove shim
//! manager.remove_shim("git")?;
//! # Ok(())
//! # }
//! ```
// Re-export main types for convenience
pub use ShimConfig;
pub use Executor;
pub use ShimManager;