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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
//! # xx
//!
//! A collection of useful Rust macros and small utility functions to make common tasks easier.
//!
//! This library provides enhanced alternatives to standard library functions with better error
//! messages, additional convenience methods, and commonly needed functionality that's missing
//! from the standard library.
//!
//! ## Quick Start
//!
//! Add to your `Cargo.toml`:
//!
//! ```toml
//! [dependencies]
//! xx = "2.1"
//! ```
//!
//! ## Core Features
//!
//! - **Enhanced file operations** - File I/O with better error messages and automatic parent directory creation
//! - **Process execution** - Convenient process spawning with builder pattern
//! - **Git operations** - High-level git repository management
//! - **Error handling** - Improved error types with context
//!
//! ## Optional Features
//!
//! Enable additional functionality by adding features to your dependency:
//!
//! ```toml
//! [dependencies]
//! xx = { version = "2.1", features = ["archive", "glob", "hash"] }
//! ```
//!
//! Available features:
//! - `archive` - Archive extraction (tar.gz, tar.bz2, tar.xz, zip)
//! - `glob` - File globbing support
//! - `hash` - SHA256 hashing utilities
//! - `http` - HTTP client functionality
//! - `fslock` - File system locking
//!
//! ## Examples
//!
//! ### File Operations
//!
//! ```rust,no_run
//! use xx::file;
//!
//! # fn main() -> xx::XXResult<()> {
//! // Read file with enhanced error messages
//! let content = file::read_to_string("config.toml")?;
//!
//! // Write file, creating parent directories automatically
//! file::write("output/data.txt", "Hello, world!")?;
//!
//! // Create directory and all parents
//! file::mkdirp("path/to/deep/directory")?;
//! # Ok(())
//! # }
//! ```
//!
//! ### Process Execution
//!
//! ```rust,no_run
//! use xx::process;
//!
//! # fn main() -> xx::XXResult<()> {
//! // Run shell command
//! let output = process::sh("ls -la")?;
//!
//! // Build and run commands with builder pattern
//! let result = process::cmd("git", &["status"]).read()?;
//! # Ok(())
//! # }
//! ```
//!
//! ### Git Operations
//!
//! ```rust,no_run
//! use xx::git::{Git, CloneOptions};
//!
//! # fn main() -> xx::XXResult<()> {
//! // Clone a repository
//! let options = CloneOptions::default().branch("main");
//! let repo = xx::git::clone("https://github.com/user/repo", "/tmp/repo", &options)?;
//!
//! // Work with existing repository
//! let git = Git::new("/path/to/repo".into());
//! let branch = git.current_branch()?;
//! let sha = git.current_sha()?;
//! # Ok(())
//! # }
//! ```
extern crate log;
pub use ;
/// Cache management utilities (requires `cache` feature)
/// Context management utilities
/// Environment variable parsing utilities
/// Error types and result helpers
/// Enhanced file operations with better error handling
/// File system locking functionality (requires `fslock` feature)
/// Git repository operations
/// Platform detection utilities
/// Process execution utilities
/// Random generation utilities
/// String similarity and suggestion utilities
/// Archive extraction and creation utilities (requires one of the archive features)
/// Hashing utilities (requires `hash` feature)
/// HTTP client functionality (requires `http` feature)