aboutsummaryrefslogtreecommitdiff
path: root/property.sh
diff options
context:
space:
mode:
authorAlessandro Iezzi <aiezzi@alessandroiezzi.it>2021-03-26 12:58:56 +0100
committerAlessandro Iezzi <aiezzi@alessandroiezzi.it>2021-03-26 12:58:56 +0100
commitf54922269049658bdd53adadd1055e15fd490fba (patch)
treec00a8a1f731d1d95e3f33f288527f2215b509f1a /property.sh
downloadacme-scripts-f54922269049658bdd53adadd1055e15fd490fba.tar.gz
acme-scripts-f54922269049658bdd53adadd1055e15fd490fba.zip
Initial commit
Diffstat (limited to 'property.sh')
-rwxr-xr-xproperty.sh35
1 files changed, 35 insertions, 0 deletions
diff --git a/property.sh b/property.sh
new file mode 100755
index 0000000..a3fc5f1
--- /dev/null
+++ b/property.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+makeprop()
+{
+ SCOPE=`echo $1 | sed -E 's|(.).*|\1|'`
+ ATTRIBUTE=`echo $1 $2 | sed "s|^$SCOPE||"`
+
+ case "$SCOPE" in
+ '~')
+ SCOPE=default
+ ;;
+ '-')
+ SCOPE=private
+ ;;
+ '+')
+ SCOPE=public
+ ;;
+ '?')
+ SCOPE=protected
+ ;;
+ *)
+ ATTRIBUTE=$SCOPE$ATTRIBUTE
+ SCOPE=private
+ ;;
+ esac
+
+ echo -n "@Getter @Setter $SCOPE $ATTRIBUTE;"
+}
+
+
+IFS=''
+while read -r line || [ -n "$line" ]; do
+ makeprop $line
+ exit
+done