diff options
Diffstat (limited to 'builtin.h')
-rw-r--r-- | builtin.h | 30 |
1 files changed, 23 insertions, 7 deletions
@@ -164,19 +164,35 @@ void builtin_pop_io(parser_t &parser); wcstring builtin_get_desc(const wcstring &b); -/** - Slightly kludgy function used with 'complete -C' in order to make - the commandline builtin operate on the string to complete instead - of operating on whatever is to be completed. -*/ -const wchar_t *builtin_complete_get_temporary_buffer(); + +/** Support for setting and removing transient command lines. + This is used by 'complete -C' in order to make + the commandline builtin operate on the string to complete instead + of operating on whatever is to be completed. It's also used by + completion wrappers, to allow a command to appear as the command + being wrapped for the purposes of completion. + + Instantiating an instance of builtin_commandline_scoped_transient_t + pushes the command as the new transient commandline. The destructor removes it. + It will assert if construction/destruction does not happen in a stack-like (LIFO) order. +*/ +class builtin_commandline_scoped_transient_t +{ + size_t token; + public: + builtin_commandline_scoped_transient_t(const wcstring &cmd); + ~builtin_commandline_scoped_transient_t(); +}; /** Run the __fish_print_help function to obtain the help information for the specified command. */ - wcstring builtin_help_get(parser_t &parser, const wchar_t *cmd); +/** Defines a function, like builtin_function. Returns 0 on success. args should NOT contain 'function' as the first argument. */ +int define_function(parser_t &parser, const wcstring_list_t &args, const wcstring &contents, int definition_line_offset, wcstring *out_err); + + #endif |