From fe733c1356ee26dfac00f9fa8d334510258ca49e Mon Sep 17 00:00:00 2001 From: Kevin van Zonneveld Date: Tue, 21 Jun 2016 10:32:29 +0200 Subject: [PATCH] Elaborate on new best practice a little --- FAQ.md | 2 +- README.md | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/FAQ.md b/FAQ.md index 55a4d5d..fc3c8f4 100644 --- a/FAQ.md +++ b/FAQ.md @@ -58,7 +58,7 @@ contains the line then you can evaluate the corresponding argument and assign it to a variable as follows: ```bash -temp_file_name="${arg_t}" +__temp_file_name="${arg_t}" ``` ## What is a magic variable? diff --git a/README.md b/README.md index 9c3b886..3898647 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ When hacking up Bash scripts, there are often higher level things like logging, configuration, command-line argument parsing that: - You need every time - - Come with a number of pitfalls to get right + - Come with a number of pitfalls to avoid - Keep you from your actual work Here's an attempt to bundle those things in a generalized way so that @@ -31,10 +31,10 @@ they are reusable as-is in most scripts. ## Goals -Delete-key-friendly. I propose using [`main.sh`](./main.sh) as a base and removing the -parts you don't need, rather than introducing a ton of packages, includes, compilers, etc. +**Delete-key-friendly**. We propose using [`main.sh`](./main.sh) as a base and removing the +parts you don't need, rather than introducing packages, includes, compilers, etc. -Aiming for portability, I'm targeting Bash 3 (OSX still ships +**Portability**. We're targeting Bash 3 (OSX still ships with 3 for instance). If you're going to ask people to install Bash 4 first, you might as well pick a more advanced language as a dependency. @@ -102,7 +102,7 @@ $ my_script some more args --blah - In functions, use `local` before every variable declaration - This project settles on two spaces for tabs - Use `UPPERCASE_VARS` to indicate environment variables that can be controlled outside your script -- Use `__double_underscore_prefixed_vars` to indicate global variables that are solely controlled inside your script +- Use `__double_underscore_prefixed_vars` to indicate global variables that are solely controlled inside your script, with the exception of arguments wich are already prefixed with `arg_`, and functions, over which b3bp poses no restrictions. ## Frequently Asked Questions