Command doesn't need to be a builtin, if we can rely on common shell 
programs... it could be a Unix command (or for some reason we like to 
make things into shell functions, not sure why), just like `env` basically.

something like

function command -d 'Runs an executable (not a function or builtin)'
   # handle --help (see footnote [*])
   env -- $argv
end

Of course, if it was a script, it would use `exec`: command:
#!fish (or some such path, or /usr/bin/env fish, or just /bin/sh)
# handle --help (see footnote [*])
exec env -- $argv


#[*]why does help-handling have so much duplicate code
#across fish functions??  It's already led to a bug from copying
#this code and not changing the xxx in __fish_print_help xxx ...
        if count $argv >/dev/null
                switch $argv[1]
                        case -h --h --he --hel --help
                                __fish_print_help command
                                return 0
                end
        end

-Isaac

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Fish-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to