Shameless plug, but you did ask for examples:
- how to process arguments and trigger conditional functionality
- how to check for input errors
- how to perform command completion
- how to organise a bash script into functions, commands, and so forth
- how to present help messages
And if you want a good reference, use Greg's Wiki. It's a no-nonsense readable garden of chaos and beauty, with a pragmatic approach to getting things done in the best way. Just be really, really careful to investigate properly before asking anything on #bash - They can be fierce.