#compdef ugrd

# Read over each line of the output of ug --dump_args
# split the line after the first space
# the first part is the option, the second part is the description
base_args=()
while read -r option description; do
	base_args+=("${option}[$description]")
done <<< "$(ugrd --dump_args)"

args=("-c[config file location]:config file:_files"
      "--config[config file location]:config file:_files"
      "--kernel-version[set the kernel version]:kernel version:_files -W /lib/modules -/"
      "--kver[set the kernel version]:kernel version:_files -W /lib/modules -/"
      "--log-file[specify the log file]:log file:_files"
      "--log-level[specify the log level]:log level:(0 5 10 20 30 40 50)"
      "*:file:_files")

args+=($base_args[@])

_arguments "${args[@]}"
