Usage message
This commit is contained in:
parent
bef8ee829a
commit
7285aa1427
|
@ -8,3 +8,4 @@ LGfl,Landgericht Flensburg,Damen und Herren,Südergraben 22\\24937 Flensburg,046
|
|||
OLGsh,Schleswig-Holsteinisches Oberlandesgericht,Damen und Herren,Gottorfstraße 2\\24837 Schleswig,+ 49 4621 86-1372,+49 4621 86-0,Mit der Ihnen gebührenden Hochachtung,
|
||||
AGkerpen,Amtsgericht Kerpen,,Nordring 2-8\\50171 Kerpen,02237 508-470,02237 508-0,Mit der Ihnen gebührenden Hochachtung,LGk
|
||||
JCkalk,Jobcenter Köln\\Standort Kalk,Damen und Herren,Bergischer Ring 35-39\\51063 Köln,(0221) 96 44 34 00,(02 21) 96 44 35 90,Mit der Ihnen gebührenden Hochachtung,
|
||||
POLk,Polizeipräsidium Köln,Damen und Herren,Walter-Pauli-Ring 2-6\\51103 Köln,0221 229-2002,0221 229-0,Gruß,
|
||||
|
|
Can't render this file because it has a wrong number of fields in line 4.
|
|
@ -8,7 +8,26 @@ LOC=""
|
|||
COL=""
|
||||
BASEPATH=$(dirname $(realpath $0))
|
||||
|
||||
if [ $F = "-l" ] # -l möchte kein weiteres Argument, im Gegensatz zu allen anderen Optionen.
|
||||
function usage {
|
||||
echo "Usage:
|
||||
./address.sh <option> <handle>
|
||||
Option is exactly one of the following:
|
||||
-h Print this message und exit
|
||||
-l List all available handles and names.
|
||||
With those two options, no <handle> ist needed.
|
||||
-g Generate new entry
|
||||
-n Print name
|
||||
-o Print preferred Opening
|
||||
-c Print preferred Closing
|
||||
-a Print address
|
||||
-f Print fax number
|
||||
-t Print telephone number
|
||||
-p Print parent handle"
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
if [ "$F" = "-l" ] # -l möchte kein weiteres Argument, im Gegensatz zu allen anderen Optionen.
|
||||
then
|
||||
echo "handle: Name"
|
||||
while IFS="," read -r COL1 COL2 COLX
|
||||
|
@ -18,15 +37,22 @@ then
|
|||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$F" = "-h" ] # -h auch nicht, um genau zu sein.
|
||||
then
|
||||
usage
|
||||
fi
|
||||
|
||||
if [ $# -lt 2 ]
|
||||
then
|
||||
echo "Zu wenig Argumente"
|
||||
exit 1
|
||||
echo "Zu wenig Argumente
|
||||
"
|
||||
usage
|
||||
fi
|
||||
|
||||
if [ $# -gt 2 ]
|
||||
then
|
||||
echo "Ignoriere überschüssige Argumente"
|
||||
echo "Ignoriere überschüssige Argumente\n"
|
||||
usage
|
||||
fi
|
||||
|
||||
case $F in
|
||||
|
@ -35,12 +61,12 @@ case $F in
|
|||
O=true
|
||||
;;
|
||||
|
||||
"-a")
|
||||
"-o")
|
||||
COL=Anrede
|
||||
O=true
|
||||
;;
|
||||
|
||||
"-d")
|
||||
"-a")
|
||||
COL=Adresse
|
||||
O=true
|
||||
;;
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
\newcommand*{\receivestar}[1]{
|
||||
\DTLloaddb{adressen}{/home/bernhardt/Entwicklung/Letterhead/Adressen/Adressen.csv}
|
||||
\DTLassignfirstmatch{adressen}{handle}{#1}{\Name=Name,\Adresse=Adresse,\FaxNr=FaxNr,\TelNr=TelNr,\Opening=Anrede,\Closing=Closing}
|
||||
\newcommand\FullAdress{\Name\\\Adresse\\per Fax: \FaxNr}
|
||||
\ifthenelse{\equal{\Opening}{}}{\renewcommand\Opening{Damen und Herren}}
|
||||
% \ifthenelse{\equal{\Closing}{}}{\renewcommand\Closing{Mit der Ihnen gebührenden Hochachtung}}
|
||||
% Why the hell does this line throw "\equal not def'd" and the line before does not?
|
||||
|
@ -56,6 +57,7 @@
|
|||
\xDTLassignfirstmatch{adressen}{handle}{\handle}{\Name=Name,\Adresse=Adresse,\FaxNr=FaxNr,\TelNr=TelNr,\Opening=Anrede,\Closing=Closing}
|
||||
\setkomavar{yourref}{\aktenzeichen}
|
||||
\setkomavar{myref}{\myref}
|
||||
\newcommand\FullAdress{\Name\\\Adresse\\per Fax: \FaxNr}
|
||||
\ifthenelse{\equal{\Opening}{}}{\renewcommand\Opening{Damen und Herren}}
|
||||
\ifthenelse{\equal{\Closing}{}}{\renewcommand\Closing{Mit der Ihnen gebührenden Hochachtung}}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue