<commit_before>#!/bin/env bash
usage() {
  cat << EOF
Usage:  ${0##*/} [options] [length]
  
generate password

options:
  -a            alphanumeric
  -g            (default)all printable characters, excluding space
EOF
}
main() {
  local -r optlist=":ag"
  local charset="graph"
  while getopts $optlist opt; do
    case $opt in
      a)
        charset="alnum"
	;;
      g)
        charset="graph"
	;;
      *)
        usage
        exit 1
	;;
    esac
  done
  length=${1:-8}
  tr -cd [:"$charset":] < /dev/urandom | head -c "$length" | xargs -0
}

main "$@"<commit_msg>Add missing shift for options in genpw<commit_after>#!/bin/env bash
usage() {
  cat << EOF
Usage:  ${0##*/} [options] [length]
  
generate password

options:
  -a            alphanumeric
  -g            (default)all printable characters, excluding space
EOF
}
main() {
  local -r optlist=":ag"
  local charset="graph"
  while getopts $optlist opt; do
    case $opt in
      a)
        charset="alnum"
	;;
      g)
        charset="graph"
	;;
      *)
        usage
        exit 1
	;;
    esac
  done
  shift $(($OPTIND - 1))
  length=${1:-8}
  tr -cd [:"$charset":] < /dev/urandom | head -c "$length" | xargs -0
}

main "$@"
{'fraction_non_alphanumeric': 0.15609348914858096, 'fraction_numerical': 0.009181969949916527, 'mean_word_length': 2.106217616580311, 'pattern_counts': {'":': 4, '<': 9, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7435779', 'n_tokens_mistral': 447, 'n_tokens_neox': 429, 'n_words': 119}