🌱 Capture flag args in bash

Source
#!/bin/bash
#set -o nounset
#set -o errexit

INPUT='./urls.txt'
DEVICE='mobile'

while getopts 'i:d:' flag; do
  case "${flag}" in
    i) INPUT=${OPTARG} ;;
    d) DEVICE=${OPTARG} ;;
  esac
done

lighthouse-batch -f $INPUT -h -o ./reports/`date '+%Y-%m-%d_%H.%M.%S'`-$DEVICE -p '--emulated-form-factor="$DEVICE"'
Made by Brandon . If you find this project useful you can donate.