Skip to content
Snippets Groups Projects
Select Git revision
  • 48a1df052b6e12cc18e16583c0714da01ac904c9
  • main default protected
  • temp_pre_merge
3 results

_error.function.fish

Blame
  • user avatar
    Florian Meißner authored
    48a1df05
    History
    _error.function.fish 406 B
    # use syntax: 
    # . (dirname (status current-filename))/../helpers/_error.function.fish
    
    function _error --description 'Call with `_error <msg> <var1> <var2> … <var_n>` to abort the program' --no-scope-shadowing
      for i in $argv[2..]
        set out $out {$i}="$$i"
      end
    
      begin; set_color brred; echo -n $argv[1]; set_color red; echo ' ('(string join ', ' $out)')'; set_color normal; end 1>&2
      exit 1
    end