diff options
author | Roger Gonzalez <rogergonzalez21@gmail.com> | 2019-12-29 14:58:33 -0300 |
---|---|---|
committer | Roger Gonzalez <rogergonzalez21@gmail.com> | 2019-12-29 14:58:33 -0300 |
commit | efb336a23b65a9a2d56889396b13c1757bdaf354 (patch) | |
tree | 234e40115f79a84c8a755df6fb932cc6797e36e1 /.config/fisher/github.com/matchai/spacefish/functions/__sf_section_exit_code.fish |
Initial commit
Diffstat (limited to '.config/fisher/github.com/matchai/spacefish/functions/__sf_section_exit_code.fish')
-rw-r--r-- | .config/fisher/github.com/matchai/spacefish/functions/__sf_section_exit_code.fish | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/.config/fisher/github.com/matchai/spacefish/functions/__sf_section_exit_code.fish b/.config/fisher/github.com/matchai/spacefish/functions/__sf_section_exit_code.fish new file mode 100644 index 00000000..7578d47f --- /dev/null +++ b/.config/fisher/github.com/matchai/spacefish/functions/__sf_section_exit_code.fish @@ -0,0 +1,26 @@ +# Exit-code +# + +function __sf_section_exit_code -d "Shows the exit code from the previous command." + # ------------------------------------------------------------------------------ + # Configuration + # ------------------------------------------------------------------------------ + + __sf_util_set_default SPACEFISH_EXIT_CODE_SHOW false + __sf_util_set_default SPACEFISH_EXIT_CODE_PREFIX "" + __sf_util_set_default SPACEFISH_EXIT_CODE_SUFFIX " " + __sf_util_set_default SPACEFISH_EXIT_CODE_SYMBOL ✘ + __sf_util_set_default SPACEFISH_EXIT_CODE_COLOR red + + # ------------------------------------------------------------------------------ + # Section + # ------------------------------------------------------------------------------ + + [ $SPACEFISH_EXIT_CODE_SHOW = false ]; or test $sf_exit_code -eq 0; and return + + __sf_lib_section \ + $SPACEFISH_EXIT_CODE_COLOR \ + $SPACEFISH_EXIT_CODE_PREFIX \ + "$SPACEFISH_EXIT_CODE_SYMBOL$sf_exit_code" \ + $SPACEFISH_EXIT_CODE_SUFFIX +end |