Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
ncBash
/
mcBash
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit aca53ec1
authored
Dec 05, 2013
by
sn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
..
1 parent
6978cdd9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
lib/fnc_mc_parameter.inc.sh
lib/fnc_mc_parameter.inc.sh
0 → 100644
View file @
aca53ec
#!/bin/bash
#
# Funktion zur Ausgabe von bash Befehlen
# @param int $1 - Stelle des Parameter (1 für erster, 2 für zweiter ... )
# @param bool $2 - wenn 1 dann muss sie vorhanden sein ansonsten abbruch, oder 0 für egal
# @param $3 - Parameter Variable die kontrolliert werden soll
# @param string $4 - optional: Hilfetext der immer ausgegeben wird
# @param string $5 - optional: Abbruchtext
#
mc_parameter
()
{
if
[
$2
==
"0"
]
;
then
optional
=
"(optinal)"
fi
mc_e
"
$1
. Parameter
$optional
$4
:
$3
"
if
[
$2
==
"1"
]
;
then
if
[
-z
$3
]
;
then
mc_h2
"Fehler bitte geben sie den
$1
. Parameter an!!!"
mc_e
$5
exit
fi
fi
}
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment