Skip to content

A library for shell-like expansions of variables in strings

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

naufraghi/shellexpand

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shellexpand, a library for shell-like expansion in strings

Build Status crates.io

Documentation

shellexpand is a small dependency-less 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).

Usage

Just add a dependency in your Cargo.toml:

[dependencies]
shellexpand = "1.0"

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

Changelog

Version 1.0.0

  • Fixed typos and minor incompletenesses in the documentation
  • Changed home_dir argument type for tilde expansion functions to FnOnce instead FnMut
  • Changed LookupError::name field name to var_name

Version 0.1.0

  • Initial release.

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.

About

A library for shell-like expansions of variables in strings

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%