caveats
- shellcheck:
- arguments are accessed via
args, and in partial snippets shellcheck complains aboutused but not assigned- solution: in
bashly-settings.ymlusevar_aliases.args: ARGS
- solution: in
- arguments are accessed via
- partial snippets in
src/are going to be wrapped in a function:- creating functions results in a "function inside a function" situation in the final script
- if you use
local VARNAME, shellcheck complains about'local' is only valid in functions- solution: ALWAYS use the
src/*.shfiles to just call a function that is going to be coded in asrc/lib/*.shfile.
- solution: ALWAYS use the
- validations are purely based on output (something in output means failure)
bashly tutorial
Planning a bashly tutorial with the topics to be addressed:
- very minimal
bashly.ymlneededrndmdoingecho "$RANDOM"- highlight that the contents of
root_command.share going to be wrapped in aroot_command()function.
- passing long options
rndm --max NUMprints a random number between 0 andNUM- options are provided in the
$argsvariable rndm --min NUMprints a random number between NUM and 32767
- passing short options
--minor-m--maxor-M
- validate the argument:
- custom validations
- if the function prints a string to stdout, it's considered an error.
- bashly wants your code to be clean, with all inputs already validated
- numbers must be:
- integers
- between 0 and 32767
- min < max
- custom validations
- flags
rndm --webget's the random number from https://random.org/-was a short option
- dependencies
rndm --webdepends oncurlbeing available
- subcommands:
- convert
rndmtorndm number
- convert
- create
rndm password- the default behavior is to use alphanumeric characters for the password
--size NUM: tamanho da senha (default is 8)--alpha: only alphabet chars--num: only numbers- conflicts with
--alpha
- conflicts with
usage ideas
zxz
https://github.com/meleu/zxz - client for https://0x0.st/
cht
cheatsheet manager
features
- visualize with
batorglowfor syntax highlight? fzfto search files- save in markdown files
- configfile to specify directories
- separate private vs. public cheatsheets
testing "formatter" setting
- no formatter specified