#!/bin/bash
#########################################################
# 							#
# This is BashStyle-NG  				#
#							#
# Licensed under GNU GENERAL PUBLIC LICENSE v3    	#
#							#
# Copyright Christopher Bratusek			#
#							#
#########################################################

. gettext.sh
export TEXTDOMAIN="bashstyle-rc"

case ${1} in
	-h | --help)
		bashstyle-help -a "Christopher Roy Bratusek" -e "nano@jpberlin.de" -h "https://www.nanolx.org/"\
			-l "GNU GPL v3" -n "treeps" -s "$(eval_gettext "tree-ified variant of ps")"\
			-v "${BSNG_VERSION}" -y "${BSNG_YEAR}"\
			-o "$(eval_gettext "none:|--")"
	;;

	*)
		ps f -u "${USER}" -o command,pid,%cpu,%mem,time,etime,tty | \
			awk 'NR <= 1 {print;next} !/awk/ && $0~var' var="${1:-".*"}"
	;;
esac
