On Sat, May 09, 2015 at 11:11:07PM +0200, Beni Cherniavsky-Paskin wrote: > Generally yes, but in this case it surfaced a nasty problem: `man` knows > about fish commands because it's a function (`type man`); > when you prepend it with /usr/bin/env, it executes /usr/bin/man which fails > with the cryptic `No manual entry for for` :-( > > This is a serious orthogonality fail. Similar things happen whenever > functions are used. > A lot of things fish uses functions for could better be written as scripts. > (would require fish to prepend a dir with its scripts to PATH). > Why don't we do it? Is it just an optimization? > > In the particular case of `man`, I'm not sure why we need a wrapper to > temporarily set MANPATH — why not simply set MANPATH when fish launches?
Excellent questions. I think I might have an answer. The way that fish currently does the fish-related manpages avoids a kind of name collision. Manpages for fish functions are not treated like "first class" man pages because they are specific to fish. For instance, if you have fish as your default shell and you happen to run bash, you wouldn't want "man for" to show the man page for fish's for. I don't know the motivation or thoughts of the fish developers, but this seems like a plausible explanation to me. The man system is not designed for man pages to show up conditionally, so the fish man function is a way to make this happen. It is a bit like trying to put a square peg in a round hole, so it's going to have some rough edges, but it does its job. There are other ways to handle the situation. For example, git organizes its man pages by prepending them all with "git-", e.g "man git-pull". ------------------------------------------------------------------------------ One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y _______________________________________________ Fish-users mailing list Fish-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fish-users