Commit Graph

99 Commits

Author SHA1 Message Date
Kevin van Zonneveld
12f1013611 Credit @gdevenyi for his testing and suggestions 2016-06-19 13:17:52 +02:00
Kevin van Zonneveld
d70312e916 Add a comment about expansion, see #26 2016-06-19 13:13:38 +02:00
Kevin van Zonneveld
fc7802d707 Respect --no-color by setting the NO_COLOR flag in main.sh. Fixes #25. thx @gdevenyi 2016-06-19 13:06:53 +02:00
Kevin van Zonneveld
8687e384eb Split out changelog into separate file, credit @rouson for the FAQ 2016-03-03 12:45:07 +01:00
Izaak Beekman
a86d8d82b1
Mangle long-option names to allow dashes
Fixes problem where long options with dashes, like `--no-color` were
 broken. This was due to the fact that bash variable names must match
 `[_a-zA-Z][_0-9a-zA-Z]*` and the usage parsing and option handling was
 trying to create variables with dashes in their names. Short of
 employing Bash4 associative arrays, "name mangling" seemed like the
 best solution to this problem.

Solution: map dashes to underscores when creating bash variables in the
script that correspond to long option flags. The downside of this is
that `--no_color` and `--no-color` will collide, but users expecting to
use options that are identical except one has an underscore and the
other has a dash deserve the ensuing confusion.
2016-02-19 23:25:09 -05:00
Kevin van Zonneveld
db690268ea Whitespace 2016-02-17 13:46:05 +01:00
Kevin van Zonneveld
366d8c7c9c Update version 2016-02-17 13:41:46 +01:00
Kevin van Zonneveld
67f2eafc81 Update version 2016-02-17 09:53:20 +01:00
Kevin van Zonneveld
c3297e4a7a Better versioning 2016-02-17 09:35:59 +01:00
Kevin van Zonneveld
2019c5146a Upgrade version 2016-02-16 22:23:28 +01:00
Kevin van Zonneveld
d365e8dcea Allow disabling colors via NO_COLOR environment variable 2016-02-16 22:19:40 +01:00
Kevin van Zonneveld
915f858d5e Add __os magic var 2016-02-16 22:19:08 +01:00
Kevin van Zonneveld
cbe70aa80e Put comments on own line 2016-02-16 22:09:28 +01:00
Kevin van Zonneveld
ff907092a3 Document caveats 2016-02-16 22:08:27 +01:00
Kevin van Zonneveld
56721e9cd5 Add test for longopt parsing 2016-02-16 22:05:11 +01:00
Kevin van Zonneveld
df3d535ab1 Make long option parsing work on OSX's BSD awk 20070501 2016-02-16 21:59:38 +01:00
Kevin van Zonneveld
2196cc4411 Add __base magic var 2016-02-16 21:58:25 +01:00
Kevin van Zonneveld
90ad85f419 Port back more refined colorscheme from @arathai's fork 2016-02-16 21:24:41 +01:00
Kevin van Zonneveld
9935335ee8 Add @zbeekman as an author 2016-02-16 20:53:59 +01:00
Izaak Beekman
bfb8d40f6c Enable long, GNU style options
- Enable long, GNU style options, fixes #1
 - *CAVEAT* A short option must be preset for every long option;
   but every short option need *not* have a long option
 - No BASH 4 features were added, works with bash 3 and standard sed and
   awk
 - `--` is still respected as the separator between options and arguments
 - Use `awk` only instead of `awk` and `sed` for parsing short options
   from usage string
 - Enable errexit, nounset and pipefail at the top
2016-02-16 14:39:10 -05:00
Kevin van Zonneveld
ecd6a9f04b Easier testing on travis 2016-02-16 15:48:48 +01:00
Kevin van Zonneveld
f2e8ff236a Add clarifications 2015-11-11 16:10:35 +01:00
Josh
23b68a1bfc Update main.sh
Fix super trivial typo
2015-02-19 19:51:00 -05:00
Kevin van Zonneveld
5b8cf352c8 Use BASH_SOURCE[0] 2014-11-11 12:41:18 +01:00
Kevin van Zonneveld
752036320a Update main.sh 2014-07-29 17:32:23 +02:00
Kevin van Zonneveld
e2602f6a58 Merge branch 'master' of github.com:kvz/bash3boilerplate
Conflicts:
	main.sh
2014-07-23 11:34:05 +02:00
Kevin van Zonneveld
af23876cd1 Bump version 2014-07-23 11:31:42 +02:00
Kevin van Zonneveld
e5af9cf01b Consistent use of longhand options 2014-07-23 11:31:34 +02:00
Kevin van Zonneveld
7304249545 Whitespace 2014-07-23 11:31:17 +02:00
Kevin van Zonneveld
17e7677757 Shrink boilerplate function 2014-07-23 11:30:53 +02:00
Kevin van Zonneveld
3f8ac03553 Color support for more xterms 2014-07-23 11:30:33 +02:00
Kevin van Zonneveld
667bfd7350 Localize function vars 2014-07-23 11:30:09 +02:00
Kevin van Zonneveld
5e492a419c DIR and FILE are actually local vars, so lowercase
Also improve pathfinding to not rely on readlink, and to work as
expected when file is sourced
2014-07-23 11:29:42 +02:00
Kevin van Zonneveld
35b7b8927d Wrap comments for readability 2014-07-23 11:28:54 +02:00
Kevin van Zonneveld
5f1de4077c Better defaulting of ENV vars 2014-07-23 11:28:38 +02:00
Kevin van Zonneveld
61c70a5045 More descriptive doc header 2014-07-23 11:28:23 +02:00
Kevin van Zonneveld
4e35f9fc0c More portable shebang 2014-07-23 11:27:53 +02:00
Kevin van Zonneveld
d94f32f93a No global scope for local variables 2013-09-06 13:46:32 +02:00
Kevin van Zonneveld
5cc1abc71a Fix Typo 2013-09-06 13:24:18 +02:00
Kevin van Zonneveld
ef898f55e9 Change /bin/bash shebang to /usr/bin/env for better portability 2013-04-19 13:14:38 +02:00
Kevin van Zonneveld
2155d65692 Write all messages to stderr
So that scripts based on bash3boilerplate are easier to use before pipes.  
It also makes it feasible to use an emergency inside a function without losing emergency's output being captured by the function's caller
2013-04-18 17:09:24 +03:00
Kevin van Zonneveld
089b13735f Reusable front matter 2013-03-28 15:33:44 +01:00
Kevin van Zonneveld
8c1ada1857 Licensed under MIT 2013-03-27 15:53:41 +01:00
Kevin van Zonneveld
b9dfc56e3c better magic variables for current FILE & DIR 2013-03-24 13:35:58 +01:00
Kevin van Zonneveld
95f044d453 Update main.sh 2013-03-24 12:26:25 +01:00
Kevin van Zonneveld
1ec58a1671 Consistently enclose vars 2013-03-20 15:37:14 +01:00
Kevin van Zonneveld
ca5f37bb4d Small clarifications 2013-02-26 13:12:53 +01:00
Kevin van Zonneveld
6aadcb3222 SemVer. More consistent docs 2013-02-25 23:54:34 +01:00
Kevin van Zonneveld
d309bba768 Introduce first verion of main.sh 2013-02-25 23:39:51 +01:00