ev3dev / brickstrap

Tool for bootstrapping Debian and creating bootable image files for embedded systems
MIT License
35 stars 26 forks source link

Failes silently when there are command line options after the command #35

Closed dlech closed 8 years ago

dlech commented 8 years ago

It used to not matter what order the options or commands are in. Now, if you have an option, e.g. -f after the command in the command line, brickstrap fails silently.

cmacq2 commented 8 years ago

The bug is easy to fix: after shifting with shift $((OPTIND-1)) we need to check that $# -ge 1 (i.e that at least one more argument remains) or else you have the problem that the last shift 1 will error out.

Presumably it went undetected because it triggers only if you put the command in second to last position.

I'll update PR #29 with a fix.

cmacq2 commented 8 years ago

Since PR #29 has been merged, this issue can be closed now.