switch code indentation to hard tabs

also update code guidelines.
This commit is contained in:
Jaromil 2018-01-03 20:27:14 +01:00
parent 70abf31bab
commit 7951645db5
2 changed files with 1975 additions and 1983 deletions

View File

@ -4,11 +4,7 @@ Style guidelines
Indentation Indentation
----------- -----------
Code must be indented using four spaces. Code must be indented using hard tabs.
In vim, this can be accomplished using
set shiftwidth=4
set expandtab
Naming Naming
------ ------

10
tomb
View File

@ -176,7 +176,7 @@ TRAPSTOP() { _endgame STOP }
_cat() { local -a _arr; _cat() { local -a _arr;
# read file using mapfile, newline fix # read file using mapfile, newline fix
_arr=("${(f@)${mapfile[${1}]%$'\n'}}"); print "$_arr" _arr=("${(f@)${mapfile[${1}]%$'\n'}}"); print "$_arr"
} }
_is_found() { _is_found() {
# returns 0 if binary is found in path # returns 0 if binary is found in path
@ -1651,7 +1651,7 @@ forge_key() {
[[ -z "$destkey" ]] && { [[ -z "$destkey" ]] && {
_failure "A filename needs to be specified using -k to forge a new key." } _failure "A filename needs to be specified using -k to forge a new key." }
# _message "Commanded to forge key ::1 key::" $destkey # _message "Commanded to forge key ::1 key::" $destkey
_check_swap # Ensure the available memory is safe to use _check_swap # Ensure the available memory is safe to use
@ -2029,9 +2029,8 @@ mount_tomb() {
{ option_is_set -o } && { { option_is_set -o } && {
local oldmountopts=$MOUNTOPTS local oldmountopts=$MOUNTOPTS
MOUNTOPTS="$(option_value -o)" } MOUNTOPTS="$(option_value -o)" }
# TODO: safety check MOUNTOPTS # TODO: safety check MOUNTOPTS
# safe_mount_options && \ # safe_mount_options &&
_sudo mount -o $MOUNTOPTS /dev/mapper/${mapper} ${tombmount} _sudo mount -o $MOUNTOPTS /dev/mapper/${mapper} ${tombmount}
# Clean up if the mount failed # Clean up if the mount failed
[[ $? == 0 ]] || { [[ $? == 0 ]] || {
@ -3138,6 +3137,3 @@ EOF
main "$@" || exit $? # Prevent `source tomb source` from exiting main "$@" || exit $? # Prevent `source tomb source` from exiting
# }}} # }}}
# -*- tab-width: 4; indent-tabs-mode:nil; -*-
# vim: set shiftwidth=4 expandtab: