Add some abbreviations for common commands

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2013-08-06 07:05:47 -07:00
parent ceffc000eb
commit a10aea280b
7 changed files with 79 additions and 78 deletions

View File

@ -3414,29 +3414,29 @@ usage() # $1 = exit status
echo " restart [ -n ] [ -p ] [ -f ] [ <directory> ]" echo " restart [ -n ] [ -p ] [ -f ] [ <directory> ]"
echo " restore [ -n ] [ <file name> ]" echo " restore [ -n ] [ <file name> ]"
echo " save [ <file name> ]" echo " save [ <file name> ]"
echo " show [ -b ] [ -x ] [ -t {filter|mangle|nat} ] [ {chain [<chain> [ <chain> ... ]" echo " [ show | list | ls ] [ -b ] [ -x ] [ -t {filter|mangle|nat} ] [ {chain [<chain> [ <chain> ... ]"
echo " show [ -f ] capabilities" echo " [ show | list | ls ] [ -f ] capabilities"
echo " show arptables" echo " [ show | list | ls ] arptables"
echo " show classifiers" echo " [ show | list | ls ] classifiers"
echo " show config" echo " [ show | list | ls ] config"
echo " show connections" echo " [ show | list | ls ] connections"
echo " show event [ <event> ...]" echo " [ show | list | ls ] event [ <event> ...]"
echo " show events" echo " [ show | list | ls ] events"
echo " show filters" echo " [ show | list | ls ] filters"
echo " show ip" echo " [ show | list | ls ] ip"
if [ $g_family -eq 4 ]; then if [ $g_family -eq 4 ]; then
echo " show ipa" echo " [ show | list | ls ] ipa"
fi fi
echo " show [ -m ] log [<regex>]" echo " [ show | list | ls ] [ -m ] log [<regex>]"
echo " show [ -x ] mangle|nat|raw|rawpost" echo " [ show | list | ls ] [ -x ] mangle|nat|raw|rawpost"
echo " show nfacct" echo " [ show | list | ls ] nfacct"
echo " show policies" echo " [ show | list | ls ] policies"
echo " show routing" echo " [ show | list | ls ] routing"
echo " show tc [ device ]" echo " [ show | list | ls ] tc [ device ]"
echo " show vardir" echo " [ show | list | ls ] vardir"
echo " show zones" echo " [ show | list | ls ] zones"
echo " start [ -f ] [ -p ] [ <directory> ]" echo " start [ -f ] [ -p ] [ <directory> ]"
echo " stop" echo " stop"
echo " status" echo " status"
@ -3681,7 +3681,7 @@ shorewall_cli() {
fatal_error "$g_product is not running" fatal_error "$g_product is not running"
fi fi
;; ;;
show|list) show|list|ls)
get_config Yes No Yes get_config Yes No Yes
shift shift
show_command $@ show_command $@

View File

@ -335,7 +335,7 @@
<arg>-<replaceable>options</replaceable></arg> <arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>show</option></arg> <arg choice="opt"><option>show | list | ls </option></arg>
<arg><option>-b</option></arg> <arg><option>-b</option></arg>
@ -357,7 +357,7 @@
<arg>-<replaceable>options</replaceable></arg> <arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>show</option></arg> <arg choice="opt"><option>show | list | ls </option></arg>
<arg><option>-f</option></arg> <arg><option>-f</option></arg>
@ -371,7 +371,7 @@
<arg>-<replaceable>options</replaceable></arg> <arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>show</option></arg> <arg choice="opt"><option>show | list | ls </option></arg>
<arg <arg
choice="req"><option>classifiers|connections|config|events|filters|ip|ipa|zones|policies|marks</option></arg> choice="req"><option>classifiers|connections|config|events|filters|ip|ipa|zones|policies|marks</option></arg>
@ -384,7 +384,7 @@
<arg>-<replaceable>options</replaceable></arg> <arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>show</option></arg> <arg choice="opt"><option>show | list | ls </option></arg>
<arg choice="plain"><option>event</option><arg <arg choice="plain"><option>event</option><arg
choice="plain"><replaceable>event</replaceable></arg></arg> choice="plain"><replaceable>event</replaceable></arg></arg>
@ -397,7 +397,7 @@
<arg>-<replaceable>options</replaceable></arg> <arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>show</option></arg> <arg choice="opt"><option>show | list | ls </option></arg>
<arg><option>-x</option></arg> <arg><option>-x</option></arg>
@ -411,7 +411,7 @@
<arg>-<replaceable>options</replaceable></arg> <arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>show</option></arg> <arg choice="opt"><option>show | list | ls </option></arg>
<arg choice="plain"><option>tc</option></arg> <arg choice="plain"><option>tc</option></arg>
</cmdsynopsis> </cmdsynopsis>
@ -423,7 +423,7 @@
<arg>-<replaceable>options</replaceable></arg> <arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>show</option></arg> <arg choice="opt"><option>show | list | ls </option></arg>
<arg><option>-m</option></arg> <arg><option>-m</option></arg>

View File

@ -1982,6 +1982,7 @@ sub supplied( $ ) {
# ensure that it has an appropriate number of columns. # ensure that it has an appropriate number of columns.
# supply '-' in omitted trailing columns. # supply '-' in omitted trailing columns.
# Handles all of the supported forms of column/pair specification # Handles all of the supported forms of column/pair specification
# Handles segragating raw iptables input in INLINE rules
# #
sub split_line1( $$;$$ ) { sub split_line1( $$;$$ ) {
my ( $description, $columnsref, $nopad, $maxcolumns ) = @_; my ( $description, $columnsref, $nopad, $maxcolumns ) = @_;
@ -1993,7 +1994,7 @@ sub split_line1( $$;$$ ) {
$inline_matches = ''; $inline_matches = '';
# #
# First see if there is a semicolon on the line; what follows will be column/value paris # First see if there is a semicolon on the line; what follows will be column/value pairs or raw iptables input
# #
my ( $columns, $pairs, $rest ) = split( ';', $currentline ); my ( $columns, $pairs, $rest ) = split( ';', $currentline );

View File

@ -1578,9 +1578,9 @@ usage() # $1 = exit status
echo "where <command> is one of:" echo "where <command> is one of:"
echo " add <interface>[:<host-list>] ... <zone>" echo " add <interface>[:<host-list>] ... <zone>"
echo " allow <address> ..." echo " allow <address> ..."
echo " check [ -e ] [ -r ] [ -p ] [ -r ] [ -T ] [ <directory> ]" echo " [ check | ck ] [ -e ] [ -r ] [ -p ] [ -r ] [ -T ] [ <directory> ]"
echo " clear" echo " clear"
echo " compile [ -e ] [ -p ] [ -t ] [ -c ] [ -d ] [ -T ] [ <directory name> ] [ <path name> ]" echo " [ compile | co ] [ -e ] [ -p ] [ -t ] [ -c ] [ -d ] [ -T ] [ <directory name> ] [ <path name> ]"
echo " delete <interface>[:<host-list>] ... <zone>" echo " delete <interface>[:<host-list>] ... <zone>"
echo " disable <interface>" echo " disable <interface>"
echo " drop <address> ..." echo " drop <address> ..."
@ -1623,31 +1623,31 @@ usage() # $1 = exit status
echo " safe-restart [ -t <timeout> ] [ <directory> ]" echo " safe-restart [ -t <timeout> ] [ <directory> ]"
echo " safe-start [ -t <timeout> ] [ <directory> ]" echo " safe-start [ -t <timeout> ] [ <directory> ]"
echo " save [ <file name> ]" echo " save [ <file name> ]"
echo " show [ -x ] [ -t {filter|mangle|nat|raw|rawpost} ] [ {chain [<chain> [ <chain> ... ]" echo " [ show | list | ls ] [ -x ] [ -t {filter|mangle|nat|raw|rawpost} ] [ {chain [<chain> [ <chain> ... ]"
echo " show actions" echo " [ show | list | ls ] actions"
echo " show [ -f ] capabilities" echo " [ show | list | ls ] [ -f ] capabilities"
echo " show classifiers" echo " [ show | list | ls ] classifiers"
echo " show config" echo " [ show | list | ls ] config"
echo " show connections" echo " [ show | list | ls ] connections"
echo " show dynamic <zone>" echo " [ show | list | ls ] dynamic <zone>"
echo " show filters" echo " [ show | list | ls ] filters"
echo " show ip" echo " [ show | list | ls ] ip"
if [ $g_family -eq 4 ]; then if [ $g_family -eq 4 ]; then
echo " show ipa" echo " [ show | list | ls ] ipa"
fi fi
echo " show [ -m ] log [<regex>]" echo " [ show | list | ls ] [ -m ] log [<regex>]"
echo " show macro <macro>" echo " [ show | list | ls ] macro <macro>"
echo " show macros" echo " [ show | list | ls ] macros"
echo " show marks" echo " [ show | list | ls ] marks"
echo " show [ -x ] mangle|nat|raw|rawpost|routing" echo " [ show | list | ls ] [ -x ] mangle|nat|raw|rawpost|routing"
echo " show nfacct" echo " [ show | list | ls ] nfacct"
echo " show policies" echo " [ show | list | ls ] policies"
echo " show routing" echo " [ show | list | ls ] routing"
echo " show tc [ device ]" echo " [ show | list | ls ] tc [ device ]"
echo " show vardir" echo " [ show | list | ls ] vardir"
echo " show zones" echo " [ show | list | ls ] zones"
echo " start [ -f ] [ -n ] [ -p ] [ -c ] [ -T ] [ <directory> ]" echo " start [ -f ] [ -n ] [ -p ] [ -c ] [ -T ] [ <directory> ]"
echo " status" echo " status"
echo " stop" echo " stop"
@ -1661,7 +1661,7 @@ usage() # $1 = exit status
compiler_command() { compiler_command() {
case $COMMAND in case $COMMAND in
compile) compile|co)
shift shift
compile_command $@ compile_command $@
;; ;;
@ -1670,7 +1670,7 @@ compiler_command() {
shift shift
refresh_command $@ refresh_command $@
;; ;;
check) check|ck)
shift shift
check_command $@ check_command $@
;; ;;

View File

@ -54,7 +54,7 @@
<arg>-<replaceable>options</replaceable></arg> <arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>check</option></arg> <arg choice="plain"><arg><option>check | ck </option></arg></arg>
<arg><option>-e</option></arg> <arg><option>-e</option></arg>
@ -88,7 +88,7 @@
<arg>-<replaceable>options</replaceable></arg> <arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>compile</option></arg> <arg choice="plain"><arg><option>compile | co </option></arg></arg>
<arg><option>-e</option></arg> <arg><option>-e</option></arg>
@ -502,7 +502,7 @@
<arg>-<replaceable>options</replaceable></arg> <arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>show</option></arg> <arg choice="opt"><option>show | list | ls </option></arg>
<arg><option>-b</option></arg> <arg><option>-b</option></arg>
@ -524,7 +524,7 @@
<arg>-<replaceable>options</replaceable></arg> <arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>show</option></arg> <arg choice="opt"><option>show | list | ls </option></arg>
<arg><option>-f</option></arg> <arg><option>-f</option></arg>
@ -538,7 +538,7 @@
<arg>-<replaceable>options</replaceable></arg> <arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>show</option></arg> <arg choice="opt"><option>show | list | ls </option></arg>
<arg <arg
choice="req"><option>actions|classifiers|connections|config|events|filters|ip|ipa|macros|zones|policies|marks</option></arg> choice="req"><option>actions|classifiers|connections|config|events|filters|ip|ipa|macros|zones|policies|marks</option></arg>
@ -551,7 +551,7 @@
<arg>-<replaceable>options</replaceable></arg> <arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>show</option></arg> <arg choice="opt"><option>show | list | ls </option></arg>
<arg choice="plain"><option>event</option><arg <arg choice="plain"><option>event</option><arg
choice="plain"><replaceable>event</replaceable></arg></arg> choice="plain"><replaceable>event</replaceable></arg></arg>
@ -564,7 +564,7 @@
<arg>-<replaceable>options</replaceable></arg> <arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>show</option></arg> <arg choice="opt"><option>show | list | ls </option></arg>
<arg choice="plain"><option>macro</option><arg <arg choice="plain"><option>macro</option><arg
choice="plain"><replaceable>macro</replaceable></arg></arg> choice="plain"><replaceable>macro</replaceable></arg></arg>
@ -577,7 +577,7 @@
<arg>-<replaceable>options</replaceable></arg> <arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>show</option></arg> <arg choice="opt"><option>show | list | ls </option></arg>
<arg><option>-x</option></arg> <arg><option>-x</option></arg>
@ -591,7 +591,7 @@
<arg>-<replaceable>options</replaceable></arg> <arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>show</option></arg> <arg choice="opt"><option>show | list | ls </option></arg>
<arg choice="plain"><option>tc</option></arg> <arg choice="plain"><option>tc</option></arg>
</cmdsynopsis> </cmdsynopsis>
@ -603,7 +603,7 @@
<arg>-<replaceable>options</replaceable></arg> <arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>show</option></arg> <arg choice="opt"><option>show | list | ls </option></arg>
<arg><option>-m</option></arg> <arg><option>-m</option></arg>

View File

@ -335,7 +335,7 @@
<arg>-<replaceable>options</replaceable></arg> <arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>show</option></arg> <arg choice="opt"><option>show | list | ls </option></arg>
<arg><option>-b</option></arg> <arg><option>-b</option></arg>
@ -357,7 +357,7 @@
<arg>-<replaceable>options</replaceable></arg> <arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>show</option></arg> <arg choice="opt"><option>show | list | ls </option></arg>
<arg><option>-f</option></arg> <arg><option>-f</option></arg>
@ -371,7 +371,7 @@
<arg>-<replaceable>options</replaceable></arg> <arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>show</option></arg> <arg choice="opt"><option>show | list | ls </option></arg>
<arg <arg
choice="req"><option>classifiers|connections|config|events|filters|ip|ipa|zones|policies|marks</option></arg> choice="req"><option>classifiers|connections|config|events|filters|ip|ipa|zones|policies|marks</option></arg>
@ -384,7 +384,7 @@
<arg>-<replaceable>options</replaceable></arg> <arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>show</option></arg> <arg choice="opt"><option>show | list | ls </option></arg>
<arg choice="plain"><option>event</option><arg <arg choice="plain"><option>event</option><arg
choice="plain"><replaceable>event</replaceable></arg></arg> choice="plain"><replaceable>event</replaceable></arg></arg>
@ -397,7 +397,7 @@
<arg>-<replaceable>options</replaceable></arg> <arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>show</option></arg> <arg choice="opt"><option>show | list | ls </option></arg>
<arg><option>-x</option></arg> <arg><option>-x</option></arg>
@ -411,7 +411,7 @@
<arg>-<replaceable>options</replaceable></arg> <arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>show</option></arg> <arg choice="opt"><option>show | list | ls </option></arg>
<arg choice="plain"><option>tc</option></arg> <arg choice="plain"><option>tc</option></arg>
</cmdsynopsis> </cmdsynopsis>
@ -423,7 +423,7 @@
<arg>-<replaceable>options</replaceable></arg> <arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>show</option></arg> <arg choice="opt"><option>show | list | ls </option></arg>
<arg><option>-m</option></arg> <arg><option>-m</option></arg>

View File

@ -53,7 +53,7 @@
<arg>-<replaceable>options</replaceable></arg> <arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>check</option></arg> <arg choice="opt"><option>check | ck </option></arg>
<arg><option>-e</option></arg> <arg><option>-e</option></arg>
@ -86,7 +86,7 @@
<arg>-<replaceable>options</replaceable></arg> <arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>compile</option></arg> <arg choice="opt"><option>compile | co </option></arg>
<arg><option>-e</option></arg> <arg><option>-e</option></arg>
@ -447,7 +447,7 @@
<arg>-<replaceable>options</replaceable></arg> <arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>show</option></arg> <arg choice="opt"><option>show | list | ls </option></arg>
<arg><option>-b</option></arg> <arg><option>-b</option></arg>
@ -469,7 +469,7 @@
<arg>-<replaceable>options</replaceable></arg> <arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>show</option></arg> <arg choice="opt"><option>show | list | ls </option></arg>
<arg><option>-f</option></arg> <arg><option>-f</option></arg>
@ -483,7 +483,7 @@
<arg>-<replaceable>options</replaceable></arg> <arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>show</option></arg> <arg choice="opt"><option>show | list | ls </option></arg>
<arg <arg
choice="req"><option>actions|classifiers|connections|config|events|filters|ip|macros|zones|policies|tc|marks</option></arg> choice="req"><option>actions|classifiers|connections|config|events|filters|ip|macros|zones|policies|tc|marks</option></arg>
@ -496,7 +496,7 @@
<arg>-<replaceable>options</replaceable></arg> <arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>show</option></arg> <arg choice="opt"><option>show | list | ls </option></arg>
<arg choice="plain"><option>event</option><arg <arg choice="plain"><option>event</option><arg
choice="plain"><replaceable>event</replaceable></arg></arg> choice="plain"><replaceable>event</replaceable></arg></arg>
@ -509,7 +509,7 @@
<arg>-<replaceable>options</replaceable></arg> <arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>show</option></arg> <arg choice="opt"><option>show | list | ls </option></arg>
<arg choice="plain"><option>tc</option></arg> <arg choice="plain"><option>tc</option></arg>
</cmdsynopsis> </cmdsynopsis>
@ -521,7 +521,7 @@
<arg>-<replaceable>options</replaceable></arg> <arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>show</option></arg> <arg choice="opt"><option>show | list | ls </option></arg>
<arg><option>-m</option></arg> <arg><option>-m</option></arg>