Skip to content

Conversation

@SimonKrughoff
Copy link
Contributor

These switches allow processing and verification steps to be turned off.

Note that this does not change the default behavior. The switches turn the different aspect off.

done
shift $((OPTIND-1))

if [ "$DOPROCESS" = true ] ; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the shebang line is invoking bash, the improved [[ ]] can be used for testing. Variables do not need to be quoted inside of [[ ]] and == may be used instead of the posix = equality operator.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do.

p) DOPROCESS=false;;
v) DOVERIFY=false;;
h) usage;;
*) usage;;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, h and * don't need to be separate cases as * will match h but that might be a slightly non-obvious to future maintainers. However, it should be possible to condense these two matches with h | *).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm removing the * as we discussed.

DOVERIFY=true

usage() {
print_error
Copy link
Contributor

@jhoblitt jhoblitt Jan 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is down to personal preference but you could replace the multiple print_error calls with.

print_error "$(cat <<-EOF

EOF
)"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to leave this as is since it's the same as in other scripts in this repo. I'm happy to file a ticket to update the syntax in the future.

These switches allow processing and verification steps to be turned off.
@SimonKrughoff SimonKrughoff force-pushed the u/krughoff/add-switches branch from 56dd07c to 812a30d Compare January 26, 2018 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants