fish-shell/share
Fabian Boehm 4612343d6e
Merge pull request #8958 from faho/builtin-path
This adds a path builtin to deal with paths.

It offers the following subcommands:

    filter to go through a list of paths and only print the ones that pass some filter - exist, are a directory, have read permission, ...
    is as a shortcut for filter -q to only return true if one of the paths passed the filter
    basename, dirname and extension to print certain parts of the path
    change-extension to change the extension to a different one (as a string operation)
    normalize and resolve to canonicalize the paths in various flavors
    sort to sort paths, also only using the basename or dirname as a key

The definition of "extension" here was carefully considered and should line up with how extensions are actually used - ~/.bashrc doesn't have an extension, but ~/.conf.d does (".d").

These subcommands all compose well - they can read from arguments or stdin (like string), they can use null-delimited input or output (input is autodetected - if a NULL happens in the first PATH_MAX bytes it switches automatically).

It is both a failglob exception (so like set if a glob passed to it fails it just doesn't get any arguments for it instead of triggering an error), and passes output to command substitution buffers explicitly split (like string split0) so newlines are easy to handle.
2022-05-29 20:15:03 +02:00
..
completions Update completions 2022-05-29 17:48:40 +02:00
functions edit_command_buffer: ignore user remappings for vim 2022-05-26 13:15:15 +02:00
groff workaround broken groff man page config 2016-10-19 13:43:04 -07:00
tools create_manpage_completions.py: Do not overstrip commands with dots 2022-05-29 17:00:32 +02:00
__fish_build_paths.fish.in Rename "snippets" to "conf" internally, and document them as snippets 2016-04-06 09:33:09 +08:00
config.fish Search $__fish_user_data_dir for vendor additions 2022-05-12 20:29:05 +02:00
lynx.lss Install custom LSS script to /usr/local/share/fish on make install 2017-09-26 14:31:11 -05:00