1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2026-01-16 02:01:05 +00:00
uutils-coreutils/src
Roy Ivy III 31655fc004 env: add support for new '--file' option (includes testing)
.# Discussion

This commit adds support for a '-f'/'--file' option which reads "KEY=VALUE" lines from
a config (or ini) style text file and sets the corresponding environment key. This is
modeled after the same option in the `dotenv` and `godotenv` commands. Notably, this
commit does *not* add automatic loading of ".env" configuration files.

The environment variables set by reading the configuration file are set prior to any
unset (eg, `-u BAR`) or set (eg, `FOO=bar`) actions. Files are loaded in order with
later files overwriting any overlapping environment variables, then, unset actions (in
command line order) are executed, then, finally, set actions (in command line order)
are executed.

[1] [`dotenv`](https://github.com/bkeepers/dotenv)
[2] [`godotenv`](https://github.com/joho/godotenv)
2019-04-29 09:50:22 -05:00
..
arch Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
base32 base32, base64, uucore: merge base32/base64 code 2019-02-21 05:10:12 -08:00
base64 base32, base64, uucore: merge base32/base64 code 2019-02-21 05:10:12 -08:00
basename Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
cat tests: untrimmed stdout assertion (fix #1235) 2019-02-08 07:54:48 +11:00
chgrp Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
chmod Fix a few clippy warnings 2018-09-03 19:08:23 +02:00
chown chown: change first file with --reference 2019-04-23 16:30:17 -05:00
chroot Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
cksum Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
comm Fix a few clippy warnings 2018-09-03 19:08:23 +02:00
cp Merge pull request #1304 from rivy/fix.cp 2019-04-03 15:51:18 -07:00
cut Fix a few clippy warnings 2018-09-03 19:08:23 +02:00
date Fix a few clippy warnings 2018-09-03 19:08:23 +02:00
dircolors Fix a few clippy warnings 2018-09-03 19:08:23 +02:00
dirname Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
du Merge pull request #1312 from E5ten/patch-3 2019-02-07 00:08:46 -08:00
echo echo: write using locked stdout 2019-04-05 22:23:01 -07:00
env env: add support for new '--file' option (includes testing) 2019-04-29 09:50:22 -05:00
expand Remove utf8 feature 2018-09-04 14:49:27 +02:00
expr expr: fix ~ update onig/onig_sys dependency (fix windows compilation bugs) 2019-03-13 01:33:50 -05:00
factor factor: Don’t wrap stdin in BufReader & use lock() 2018-10-24 15:21:05 +02:00
false Handle SIGPIPE correctly and autogenerate main() for each util 2017-12-08 15:05:07 -08:00
fmt Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
fold Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
groups Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
hashsum Merge pull request #1281 from rivy/alt/win-cli-globbing 2019-02-06 23:21:53 -08:00
head Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
hostid hostid: remove old enum 2018-09-18 19:48:53 -05:00
hostname Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
id uucore: make features opt-in rather than opt-out 2018-03-12 20:21:38 -07:00
install Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
join tests: untrimmed stdout assertion (fix #1235) 2019-02-08 07:54:48 +11:00
kill Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
link Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
ln Don’t wrap stdin in a BufReader when prompting 2018-10-24 15:08:51 +02:00
logname Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
ls Merge pull request #1290 from ArniDagur/ls-formatting 2019-02-07 00:12:43 -08:00
mkdir Merge pull request #1281 from rivy/alt/win-cli-globbing 2019-02-06 23:21:53 -08:00
mkfifo Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
mknod Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
mktemp Update to Rand 0.5 (#1288) 2018-10-14 13:33:44 +04:00
more Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
mv Merge pull request #1305 from rivy/fix.mv 2019-04-03 15:50:32 -07:00
nice Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
nl Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
nohup Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
nproc Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
numfmt numfmt: support neither or both of --to and --from 2018-09-25 01:42:11 +12:00
od Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
paste Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
pathchk Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
pinky Merge pull request #1281 from rivy/alt/win-cli-globbing 2019-02-06 23:21:53 -08:00
printenv Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
printf Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
ptx Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
pwd Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
readlink Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
realpath Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
relpath Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
rm rm: fix dir-type symlink removal on windows 2019-02-07 08:30:51 -06:00
rmdir Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
seq Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
shred Update to Rand 0.5 (#1288) 2018-10-14 13:33:44 +04:00
shuf Update to Rand 0.5 (#1288) 2018-10-14 13:33:44 +04:00
sleep Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
sort Fix comparison of empty string to numeric f64 sort 2018-09-30 09:14:18 -05:00
split Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
stat Bump getopts from 0.2.17 to 0.2.18 2018-07-06 07:17:46 +00:00
stdbuf Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
sum Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
sync Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
tac Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
tail Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
tee refactor: use shorthand fields 2018-11-07 13:26:03 -05:00
test Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
timeout Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
touch touch: fix ~ use set_symlink_file_times() + remove unused code 2019-04-07 09:14:46 -05:00
tr Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
true Format everything using rustfmt 2018-03-12 01:20:58 -07:00
truncate Merge pull request #1281 from rivy/alt/win-cli-globbing 2019-02-06 23:21:53 -08:00
tsort Fix #1321 tsort handle self-loops 2019-02-14 07:45:11 +11:00
tty Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
uname Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
unexpand Remove utf8 feature 2018-09-04 14:49:27 +02:00
uniq Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
unlink Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
uptime Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
users Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
uucore base32, base64, uucore: merge base32/base64 code 2019-02-21 05:10:12 -08:00
uutils Merge pull request #1281 from rivy/alt/win-cli-globbing 2019-02-06 23:21:53 -08:00
wc Merge pull request #1281 from rivy/alt/win-cli-globbing 2019-02-06 23:21:53 -08:00
who Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
whoami Fix more clippy warnings and remove redundant 'static 2018-09-04 14:33:36 +02:00
yes Fix a few clippy warnings 2018-09-03 19:08:23 +02:00