Commit 35b17ac1 authored by Vitaly Lipatov's avatar Vitaly Lipatov

estrlist: add count method, fix --help

parent 82adfb3a
...@@ -46,6 +46,11 @@ list() ...@@ -46,6 +46,11 @@ list()
done done
} }
count()
{
list $@ | wc -l
}
union() union()
{ {
list $@ | sort -u list $@ | sort -u
...@@ -100,7 +105,7 @@ reg_include() ...@@ -100,7 +105,7 @@ reg_include()
} }
--help() help()
{ {
echo "estrlist developed for string list operations. See also cut, join, paste..." echo "estrlist developed for string list operations. See also cut, join, paste..."
echo "Usage: $0 <command> [args]" echo "Usage: $0 <command> [args]"
...@@ -126,5 +131,9 @@ if [ -z "$COMMAND" ] ; then ...@@ -126,5 +131,9 @@ if [ -z "$COMMAND" ] ; then
exit 1 exit 1
fi fi
if [ "$COMMAND" = "-h" ] || [ "$COMMAND" = "--help" ] ; then
COMMAND="help"
fi
shift shift
"$COMMAND" "$@" "$COMMAND" "$@"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment