From 10a13c64cc5ee3ff16caa77a7b809702cff38595 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Mon, 14 Feb 2022 20:04:35 -0500 Subject: Implement --all/-A * Apply filters to all environment variables --- README.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 838a1bc..4591e22 100644 --- a/README.md +++ b/README.md @@ -18,14 +18,15 @@ $ make install # Usage ```shell -usage: cleanpath [-hVelrsE] [pattern ...] +usage: cleanpath [-hVDAelrsEv] [pattern ...] --help -h Displays this help message --version -V Displays the program's version - --default -D Displays default operating system PATH + --default -D Displays default operating system PATH --list Format output as a list + --all -A Apply to all environment variables --exact -e Filter when pattern is an exact match (default) --loose -l Filter when any part of the pattern matches - --regex -r Filter matches with (Extended) Regular Expressions + --regex -r Filter matches with (Extended) Regular Expressions --sep [str] -s Use custom path separator (default: ':') --env [str] -E Use custom environment variable (default: PATH) ``` @@ -74,3 +75,11 @@ a:b/e:f PATH=$(cleanpath -r '^/opt/local/.*' '^/opt/sw/.*') export PATH ``` + +## Using cleanpath to filter your entire runtime environment + +```shell +#!/usr/bin/env bash +# Remove MacPorts and Fink from ALL environment variables +eval $(cleanpath -A -r '^/opt/local/.*' '^/opt/sw/.*') +``` \ No newline at end of file -- cgit