HAJWTMACMFFXFLSIVEX5L7IDFEMQXUG33U4KJCPGIH4XLLNUT62QC
# created 2024095(+/-3)
# author: @jakimfett
# inspiration: functions.sh
# @todo pull in nano settings from functions.sh
. ~/run/mixins.src
DEBUG=1
function logThis {
if [ "${DEBUG}" -eq 1 ]; then
echo -e "${@}"
fi
}
function lt {
logThis "${@}"
}
lt "@function:logThis/lt selftest" &&\
lt "@function:logThis/lt success" && lt "---"
function mkrepo {
if [ ! -z "${@}" ]; then
# case statement?
lt "got from user:\n\t'${@}'"
if [ "${@:0:1}" == "-" ]; then
lt "got past command character"
# @todo check for improper format
# hardcoding dry run with a magic variable?
# that's a choice.
# destructive by default refactoring should be hard.
if [ "${@:2:5}" == "run" ]; then
lt "running whatever's next"
fi
fi
fi
# @todo exit trapping
}
lt "@function:mkrepo loaded"
function selfTest {
# todo shellcheck
lt "not yet implemented"
}
lt "@function:selfTest loaded"
# originally, the functions were all aliases.
#
# then, delusions of creating terminal-based object-orientedness struck.
# #
# generally, this entire stack of functionality has gone through refinement of:
# oneliner-->alias
# alias-->function
# function-->class
#
# where "class" can mean sourcefile (.src) or scriptfile (.sh)
#
# #
#
# some of this is just QoL stuff that hasn't become it's own thing
#
# #
#
# make nano more usable
alias nano="nano --nowrap --backup --positionlog --autoindent --linenumbers --softwrap --tabsize 3"
# easy ssh key stuffs
alias ssh-makey='ssh-keygen -a 256 -t ed25519'
alias ssh-mykey='cat ~/.ssh/id_ed25519.pub'
alias ssh-showkey='cat ~/.ssh/id_ed25519.pub && echo -e "^-- personal pubkey\n\nserver key(s) --v"; ssh-keygen -lf <(ssh-keyscan localhost 2>/dev/null)'