New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
optparse-bash: Init at 2021-06-13 #121937
Conversation
dcbd977
to
984b883
Compare
|
Dependencies including sed, awk and printf are now added and patched into |
59854f3
to
866b3f1
Compare
a605d96
to
b1520cb
Compare
9698b48
to
b287ca6
Compare
installPhase = '' | ||
runHook preInstall | ||
mkdir -p $out/bin | ||
mv optparse.bash $out/bin/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
./results/optparse-bash/bin/optparse.bash
bash: ./results/optparse-bash/bin/optparse.bash: Permission denied
You can use 'install' command to set permission.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
optparse.bash
is meant to be sourced (as a "header file" of BASH functions) instead of being executed.
I put it inside $out/bin
so that users can source it like
source optparse.bash
instead of
source /nix/store/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-optparse-bash-0000-00-00/libexec/optparse.bash
Is there a cleaner approach of doing so?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you use it in a nix package then you can substitute the store path with ${optparse}/libexec/optparse.bash
.
b287ca6
to
7fc7a59
Compare
Motivation for this change
Optparse provides a wrapper of the POSIX
getopts
as a clean and easy-to-use command-line argument parser.Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)