- afb-client-demo -H -d unix:@afm_platform_rundir@/apis/ws/afm-main "$1" "$2" |
- awk '$1=="ON-REPLY" && $3!="success"{$1="ERROR:";$2="";print > "/dev/stderr";exit 1;}NR>1'
+ local verb="$1"
+ afb-client-demo -H -d unix:@afm_platform_rundir@/apis/ws/afm-main "$verb" "$2" |
+ awk '$1=="ON-REPLY" && $3!="success"{$1="ERROR:";$2="";print > "/dev/stderr";exit 1;}NR>1'
+}
+
+all=false
+force=false
+uid="$UID"
+help=false
+
+set -- $(getopt -l all,force,help,uid: -s afhu: -n afm-util -- "$@")
+while :
+do
+ case "$1" in
+ -a|--all) all=true; shift;;
+ -f|--force) force=true; shift;;
+ -h|--help) help=true; shift;;
+ -u|--uid) uid="$2"; shift 2;;
+ --) shift; break;;
+ *) help=true; break;;
+ esac
+done
+
+getall() {
+ case "$1" in
+ -a|--all) echo -n '{"all":true}';;
+ *) echo -n true;;
+ esac