#!/bin/bash
################################################################
# Copyright (C) 2002 Robert Anderson
# Copyright (C) 2003 Walter Landry and the Regents of the University
#                                          of California
# 
# See the file "COPYING" for further information about
# the copyright and warranty status of this work.
# 

cachedir=~/.arx-cmd-opts

rm -rf $cachedir
mkdir $cachedir
cd $cachedir

arx -H | grep "[[:space:]]:[[:space:]]" | awk '{print $1}' | tr "\n" " " > arx-subcmds

# Collect options for subcommands
subcmds=`cat arx-subcmds`
 
for subcmd in $subcmds; do
    arx $subcmd --help | grep "^ -[a-zA-Z]" | awk '{print $1}' | tr "\n" " " > $subcmd-options
    arx $subcmd --help | grep "^ -[a-zA-Z]" | awk '{print $2}' | tr "\n" " " >> $subcmd-options
    arx $subcmd --help | grep "^ --[a-zA-Z]" | awk '{print $1}' | tr "\n" " " >> $subcmd-options
done

# Collect options for arx itself

arx --help | grep "^ -[a-zA-Z]" | awk '{print $1}' | tr "\n" " " > arx-options
arx --help | grep "^ -[a-zA-Z]" | awk '{print $2}' | tr "\n" " " >> arx-options
arx --help | grep "^ --[a-zA-Z]" | awk '{print $1}' | tr "\n" " " >> arx-options

###  Local Variables:
###  mode: shell-script
###  End:

# tag: Robert Anderson Sat Nov 16 22:28:38 PST 2002 (gen-opt-cache)

