rename to 'parse_flags', return flags after '--', use in scripts
add bash completion