-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Styleguide #98
Comments
We should keep in mind that this may add a second return statement which is kind of an bash coding antipattern. Nevertheless I would prefer the change. |
A simple return is very misleading. So you need a message on stderr, too, which gives you again two lines. |
we could simply define our own exit code like 5461 which means "insufficient amount of params". I don't see the necessity for a message on stderr |
updated the proposed example |
There is not that much benefit in removing one level of indentation. But I suggest to go one step further anyways and remove all those checks and commit to run all scripts with Functions that check for all variables being there, but are called somewhere in the code without all variable should not be possible at all and should be fixed. |
that is an even better idea IMO. anybody against/therefor too? |
-C (noclobber) could also be relevant, it makes it so that Would also catch errors where a |
Maybe longopts are better, so that even non-bash-aficionados can deduce what the options are doing. set -o errexit
set -o noclobber
set -o nounset
set -o pipefail |
|
I would like to propose a change to our styleguide. We currently have a lot of functions with var checking like this:
I would like to move it to a oneliner:
this would save up one level of indentation. @killermoehre or @dhxgit any opinions on this one?
The text was updated successfully, but these errors were encountered: