Just define a ":" builtin

It's *less code* to define this as a builtin, and it's not going
anywhere. Plus it makes fish just a little more usable without share/config.fish.
This commit is contained in:
Fabian Homborg 2020-03-27 23:42:44 +01:00
parent 3df05af809
commit be0de5e2de
2 changed files with 1 additions and 9 deletions

View file

@ -106,15 +106,6 @@ else if not contains -- $__fish_data_dir/completions $fish_complete_path
set -a fish_complete_path $__fish_data_dir/completions
end
# This cannot be in an autoload-file because `:.fish` is an invalid filename on windows.
function : -d "no-op function"
# for compatibility with sh, bash, and others.
# Often used to insert a comment into a chain of commands without having
# it eat up the remainder of the line, handy in Makefiles.
# This command always succeeds
true
end
# Add a handler for when fish_user_path changes, so we can apply the same changes to PATH
function __fish_reconstruct_path -d "Update PATH when fish_user_paths changes" --on-variable fish_user_paths
set -l local_path $PATH

View file

@ -342,6 +342,7 @@ int builtin_false(parser_t &parser, io_streams_t &streams, wchar_t **argv) {
// Functions that are bound to builtin_generic are handled directly by the parser.
// NOTE: These must be kept in sorted order!
static const builtin_data_t builtin_datas[] = {
{L":", &builtin_true, N_(L"Return a successful result")},
{L"[", &builtin_test, N_(L"Test a condition")},
{L"and", &builtin_generic, N_(L"Execute command if previous command succeeded")},
{L"argparse", &builtin_argparse, N_(L"Parse options in fish script")},