Permalink
Browse files

variables split - api

  • Loading branch information...
1 parent 09984df commit ea1d015bdf045a7d561662581e683ebbebf1f67b @mpapis mpapis committed Sep 15, 2011
@@ -29,7 +29,8 @@
array()
{
trace_filter array
- typeset _command="$1" _subcommand _name _variable
+ typeset _command _subcommand _name _variable
+ _command="$1"
shift || __sm.log.fail "Array command must be given as the first parameter."
case "${_command}" in
@@ -3,7 +3,8 @@
command()
{
trace_filter command
- typeset _command _subcommand _token _user _code _flags=()
+ typeset _command _subcommand _token _user _code _flags
+ _flags=()
while (( $# ))
do
@@ -3,7 +3,10 @@
# TODO: Rework this into a 1.0.0 module API
database_extension_setup()
{
- typeset extension="${1}" module="${2}" path="${3}"
+ typeset extension module path
+ extension="${1}"
+ module="${2}"
+ path="${3}"
shift || __sm.log.fail "Extension must be given as the first parameter."
shift || __sm.log.fail "Module must be given as the second parameter."
shift || __sm.log.fail "Path must be given as the third parameter."
@@ -18,7 +18,9 @@ api_database_initialize()
__sm.database.cli()
{
- typeset _ignored_args=() args_count=${#extension_args[@]}
+ typeset _ignored_args args_count index
+ _ignored_args=()
+ args_count=${#extension_args[@]}
for (( index=0 ; index < $args_count ; index++ ))
do
@@ -4,8 +4,10 @@ date()
{
true ${date_format:="%Y-%m-%dT%H:%M:%S"}
- typeset _start _end _date _step="day" \
- _format_in="%Y-%m-%d" _format_out="%Y-%m-%d"
+ typeset _start _end _date _step _format_in _format_out
+ _step="day"
+ _format_in="%Y-%m-%d"
+ _format_out="%Y-%m-%d"
while (( $# > 0 ))
do
@@ -9,8 +9,9 @@ extension()
{
trace_filter extensions
- typeset _command _params=() _name _uri
- typeset __extension_commands=(
+ typeset _command _params _name _uri __extension_commands
+ _params=()
+ __extension_commands=(
"in extension sets do=extension sets iterator"
"in extensions do=extension iterator"
"read known uri=get uri"
@@ -15,9 +15,10 @@ files()
{
trace_filter filesystem
- typeset _token _command _subcommand _path _file _files=() _source _target _mode \
- _owner _flags _string _regex
- typeset __files_commands=(
+ typeset _token _command _subcommand _path _file _files _source _target _mode \
+ _owner _flags _string _regex __files_commands
+ _files=()
+ __files_commands=(
"is empty=are empty"
"is nonempty=are nonempty"
"is executable=are executable"
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-# This module is a group module to used to load both the files and paths apis
-
@@ -8,7 +8,8 @@
hash()
{
- typeset _token _file _keys _valid_keys='^[^ ^=]+'
+ typeset _token _file _keys _valid_keys
+ _valid_keys='^[^ ^=]+'
while (( $# ))
do
@@ -2,6 +2,7 @@
shell()
{
+ typeset _token
while (( $# ))
do
_token="$1" && shift
@@ -2,7 +2,11 @@
package_extension_setup()
{
- typeset extension="${1:-}" module="${2:-}" path="${3:-}" ${language:=shell}
+ typeset extension module path
+ extension="${1:-}"
+ module="${2:-}"
+ path="${3:-}"
+ true ${language:=shell}
shift || __sm.log.fail "No extension name given."
shift || __sm.log.fail "No module name given."
shift || __sm.log.fail "No path given."
@@ -40,7 +40,9 @@
package()
{
trace_filter package
- typeset _token _subcommand _command _logfile _lines=50 _params=()
+ typeset _token _subcommand _command _logfile _lines _params
+ _lines=50
+ _params=()
while (( $# ))
do
@@ -1,2 +0,0 @@
-#!/bin/sh
-
@@ -31,7 +31,9 @@ export projects_path
#
p()
{
- typeset _path _regex1="${1:-}" _regex2="${2:-}"
+ typeset _path _regex1 _regex2
+ _regex1="${1:-}"
+ _regex2="${2:-}"
true "${projects_path:="$HOME/projects"}"
if [[ -z "${_regex1}" ]]
@@ -2,7 +2,11 @@
service_extension_setup()
{
- typeset extension="${1}" module="${2}" path="${3}" ${language:=shell}
+ typeset extension module path
+ extension="${1:-}"
+ module="${2:-}"
+ path="${3:-}"
+ true ${language:=shell}
shift || __sm.log.fail "Extension name not given as first parameter."
shift || __sm.log.fail "Module name not given as second parameter."
shift || __sm.log.fail "Path not given as third parameter."
@@ -11,7 +11,8 @@ service()
{
trace_filter service
- typeset _token _command _parameters=()
+ typeset _token _command _parameters
+ _parameters=()
while (( $# ))
do
@@ -4,7 +4,8 @@
step()
{
- typeset name="$1"
+ typeset name
+ name="$1"
shift || __sm.log.fail "Cannot take step as no step name given;"\
"step [name] <- missing name."
@@ -23,9 +23,12 @@ templates()
{
trace_filter templates
- typeset _command _name _target _source="${extension_templates_path}" \
- _mode=0644 _owner=$USER _template _params=()
- typeset __templates_commands=(
+ typeset _command _name _target _source _mode _owner _template _params __templates_commands
+ _source="${extension_templates_path}" \
+ _mode=0644
+ _owner=$USER
+ _params=()
+ __templates_commands=(
"exists=exist"
)
@@ -4,8 +4,9 @@ timestamp()
{
trace_filter timestamp
- typeset _command _params=() _name _uri
- typeset __extension_commands=(
+ typeset _command _params=() _name _uri __extension_commands
+ _params=()
+ __extension_commands=(
"show new"
"show current"
"save=set"
@@ -4,9 +4,9 @@ user()
{
trace_filter users
- typeset _command _subcommand _user _group _source _flags=() _value _shell
-
- typeset __user_commands=(
+ typeset _command _subcommand _user _group _source _flags _value _shell __user_commands
+ _flags=()
+ __user_commands=(
"is root"
"is privileged"
"is unprivileged"
@@ -6,8 +6,9 @@ variables()
{
trace_filter variables
- typeset _command _variables=() _type
- typeset __variables_commands=(
+ typeset _command _variables=() _type __variables_commands
+ _variables=()
+ __variables_commands=(
"is empty=are empty"
"is nonempty=are nonempty"
"must be empty"

0 comments on commit ea1d015

Please sign in to comment.