shlex
Split a string into shell words, like Python's shlex.
2.0.1
750M downloads/mo
#102 most downloaded on crates.io
comex/rust-shlex
What this package is like to depend on
Last release 3 months ago
17 May 2026
Release timing varies
gaps range from 5 months to 5.6 years
Nearly every release is documented
notes for 9 of 9 stable releases
Nothing withdrawn
no release was ever pulled
11 years old
9 releases · first in 2015
2 releases in the last 12 months
see the full history below
Release timeline
9 releases · Jun 2015 to May 2026Releases
latest 9-
2.0.117 May 2026 -
2.0.016 May 2026Release notes
Open source →- Breaking: Items that were marked as deprecated in 1.x have been removed:
join,quote,bytes::join, andbytes::quote. - Breaking: The
DerefMutimpl forShlexhas been removed since it was unsound. NewunsafeAPIs have been added in its place:Shlex::from_bytes,Shlex::as_bytes_mut.
- Breaking: Items that were marked as deprecated in 1.x have been removed:
-
1.3.022 Jan 2024Release notes
Open source →Ref: GHSA-r7qv-8r2h-pg27
-
Deprecate quote APIs in favor of
try_equivalents that complain
about nul bytes. -
Also add a builder API, which allows re-enabling nul bytes without
using the deprecated interface, and in the future can allow other
things (as discussed in quoting_warning). -
Add documentation about various security risks that remain,
particularly with interactive shells. -
Add fuzzers that actually verify round-trippability of the quote APIs
against various shells, Pythonshlex, and Cwordexp.-
These are separate crates (as opposed to just being different files
underfuzz/fuzz_targets) because they have different dependencies
and build steps, and I don't want to agglomerate them all together.
I've put them in the same workspace at least. -
Also, check in Cargo.lock for the fuzzers, since they are binaries.
-
-
Add explicit MSRV of 1.46.0.
This crate didn't previously have an explicit MSRV, but
cargo msrv
tells me that shlex 1.2.0 works down to Rust 1.36.0.Since this is a security fix, ideally the MSRV wouldn't be bumped at
all, but that's not really feasible since the new API uses
#[non_exhaustive], which was unstable in Rust 1.36.0. In case anyone
is stuck on old Rust versions, I separately released a shlex 1.2.1 that
only has the fix for{/}/\xa0, without the API changes.However, even for the full release I'd still like to keep the MSRV
reasonably old. I picked 1.46.0 because it's the first version that
wouldn't require completely redoing theconst fnbitmask. -
Add more authors to Cargo.toml based on Git commits.
Release notes
Open source →- Full fix for the high-severity security vulnerability RUSTSEC-2024-0006 a.k.a. GHSA-r7qv-8r2h-pg27:
- Deprecates quote APIs in favor of
try_equivalents that complain about nul bytes. - Also adds a builder API, which allows re-enabling nul bytes without using the deprecated interface, and in the future can allow other things (as discussed in quoting_warning).
- Adds documentation about various security risks that remain, particularly with interactive shells.
- Deprecates quote APIs in favor of
- Adds explicit MSRV of 1.46.0.
-
-
1.2.122 Jan 2024Release notes
Open source →- Partial fix for the high-severity security vulnerability RUSTSEC-2024-0006 a.k.a. GHSA-r7qv-8r2h-pg27 without bumping MSRV:
- The bytes
{and\xa0are now escaped by quoting functions.
- The bytes
- Partial fix for the high-severity security vulnerability RUSTSEC-2024-0006 a.k.a. GHSA-r7qv-8r2h-pg27 without bumping MSRV:
-
1.2.005 Sep 2023 -
1.1.027 Aug 2021Release notes
Open source →- Adds the
stdfeature (enabled by default). - Disabling the
stdfeature makes the crate work in#![no_std]mode, assuming presence of thealloccrate.
- Adds the
-
1.0.003 Feb 2021Release notes
Open source →- Adds the
joinconvenience function. - Breaking: Fixes parsing of
'\\n'to match the behavior of bash/Zsh/Pythonshlex. The result was previously\n, now it is\\n.
- Adds the
-
0.1.123 Jun 2015 -
0.1.022 Jun 2015