diff --git a/README.md b/README.md index 383aee7..4275c00 100644 --- a/README.md +++ b/README.md @@ -42,12 +42,12 @@ Please follow the instruction for your shell: > Add the following output to your configuration file: > ```shell -> pay-respects nushell [--alias ] +> pay-respects nushell --alias [] > ``` > Or save it as a file: > ```shell -> pay-respects nushell [--alias ] | save -f ~/.pay-respects.nu +> pay-respects nushell --alias [] | save -f ~/.pay-respects.nu > ``` > and source from your config file: > ```shell diff --git a/core/src/args.rs b/core/src/args.rs index d1b1859..229cb7a 100644 --- a/core/src/args.rs +++ b/core/src/args.rs @@ -75,7 +75,7 @@ pay-respects fish --alias | source "#, manual = "Nushell / PowerShell".bold(), manual_examples = r#" -pay-respects nushell +pay-respects nushell --alias pay-respects pwsh --alias "# ) diff --git a/modules.md b/modules.md index a707a6f..ad2455e 100644 --- a/modules.md +++ b/modules.md @@ -48,27 +48,25 @@ If exposing modules in `PATH` annoys you, you can set the `_PR_LIB` environment Example in a [FHS 3.0 compliant system](https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s06.html): ```shell -export _PR_LIB="/usr/lib:$HOME/.local/lib" +export _PR_LIB="/usr/lib:$HOME/.local/share" ``` This is not the default as there is no general way to know its value and depends on distribution (`/usr/lib`, `/usr/libexec`, `/data/data/com.termux/files/usr/libexec`, etc.). System programs usually have a hard-coded path looking for `lib`. If you are a package maintainer for a distribution, setting this value when compiling, so it fits into your distribution standard. If you installed the module with `cargo install`, the binary will be placed in `bin` subdirectory under Cargo's home which should be in the `PATH` anyway. Cargo has no option to place in subdirectories with other names. -The following snippet is what I have included into Arch Linux package's with workflows binaries, adding a `_PR_LIB` declaration along with initialization. The script is `/usr/bin/pay-respects` and the actual executable is located somewhere else. +The following snippet is what I have included into Arch Linux's package with workflows binaries, adding a `_PR_LIB` declaration along with initialization. The script is `/usr/bin/pay-respects` and the actual executable is located somewhere else. ```sh -``#!/bin/sh -if [ "$#" -gt 1 ]; then - if [ -z "$_PR_LIB" ]; then - SHELL=$(basename $SHELL) - LIB="/usr/lib/pay-respects" - if [ "$SHELL" = "nu" ]; then - echo "env:_PR_LIB=$LIB" - elif [[ "$SHELL" = "pwsh" ]]; then - echo "\$env:_PR_LIB=\"$LIB\"" - else - echo "export _PR_LIB=$LIB" - fi +#!/bin/sh +if [ "$#" -gt 1 ] && [ -z "$_PR_LIB" ]; then + SHELL=$(basename $SHELL) + LIB="/usr/lib/pay-respects" + if [ "$SHELL" = "nu" ]; then + echo "env:_PR_LIB=$LIB" + elif [[ "$SHELL" = "pwsh" ]]; then + echo "\$env:_PR_LIB=\"$LIB\"" + else + echo "export _PR_LIB=$LIB" fi fi /opt/pay-respects/bin/pay-respects "$@" -` +```