chmln / sd

Intuitive find & replace CLI (sed alternative)
MIT License
5.72k stars 136 forks source link

v1.0.0 package structure doesn't work for `MANPATH` #284

Open coolaj86 opened 9 months ago

coolaj86 commented 9 months ago

MANPATH is built automatically from PATH and it requires that the man file be in ../share/man relative to ./bin/sd.

So the package structure should look something like this to be POSIX compatible:

./sd-<triplet>/
./
├── CHANGELOG.md
├── LICENSE
├── README.md
├── bin/
│   └── sd*
├── completions/
│   ├── _sd
│   ├── _sd.ps1
│   ├── sd.bash
│   ├── sd.elv
│   └── sd.fish
└── share/
    └── man/
        └── man1/
            └── sd.1

Then just by moving the package to ~/.local/opt/sd and adding ~/.local/opt/sd/bin to PATH, the man page will Just Work™ as expected on any POSIX system.

Fish completions are actually generated automatically on-the-fly from the man page so long as it's well-formed and in the MANPATH (though pregenerating them may be better).

As for the others, I don't think Bash completions follow the POSIX standards. Probably not PS1 either. I'm not familiar with elv.