shellexpand, a library for shell-like expansion in strings


NOTE: THIS CRATE NAME IS RETIRED. There will no further updates beyond 2.1.2. Please switch to shellexpand, which will continue to be developed.


shellexpand is a single dependency library which allows one to perform shell-like expansions in strings, that is, to expand variables like $A or ${B} into their values inside some context and to expand ~ in the beginning of a string into the home directory (again, inside some context).

This crate provides generic functions which accept arbitrary contexts as well as default, system-based functions which perform expansions using the system-wide context (represented by functions from std::env module and dirs crate).


Note: This package was a fork of Vladimir Matveev's library. This fork existed due to a hiatus in maintenance. Please use shellexpand instead now.


Alternatives to this crate:

Usage

Add a dependency in your Cargo.toml.

To avoid having to write use shellexpand_fork as shellexpand or similar, rename the package on import:

toml [dependencies] shellexpand = { version = "2.1", package = "shellexpand-fork" }

See the crate documentation (a link is present in the beginning of this readme) for more information and examples.

Changelog

Version 2.1.2

Minor changes:

Version 2.1.1

Version 2.1.0

Version 2.0.0

Version 1.1.1

Version 1.1.0

Version 1.0.0

Version 0.1.0

License

This program is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.