Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-build-utils
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
korinf
etersoft-build-utils
Commits
160d393d
Commit
160d393d
authored
Oct 02, 2010
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gacl: rewrite arg parsing
parent
ae5ce5cb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
14 deletions
+22
-14
gacl
bin/gacl
+22
-14
No files found.
bin/gacl
View file @
160d393d
...
...
@@ -23,6 +23,9 @@ mygetopts()
echog
" gacl [-
$CURRENTBRANCHNAME
] package add newuser"
echog
" gacl [-
$CURRENTBRANCHNAME
] package del newuser"
echog
" gacl [-
$CURRENTBRANCHNAME
] package show"
echog
"Examples for current git project:"
echog
" gacl [-
$CURRENTBRANCHNAME
] add newuser"
echog
" gacl [-
$CURRENTBRANCHNAME
] show"
exit
0
fi
...
...
@@ -31,23 +34,28 @@ mygetopts()
shift
2
fi
# FIXME
# if two or one param only, try detect
if
[
-z
"
$3
"
]
||
[
-z
"
$2
"
]
;
then
# TODO
# one param
if
[
-z
"
$2
"
]
;
then
[
"
$1
"
=
"show"
]
||
fatal
"See
$0
--help for correct options"
PROJECTNAME
=
$(
get_gear_name
)
else
COMMAND
=
$1
# two param: add newuser or package show
elif
[
-z
"
$3
"
]
;
then
if
[
"
$1
"
=
"add"
]
;
then
# add newuser
PROJECTNAME
=
$(
get_gear_name
)
COMMAND
=
$1
PARAM
=
$2
else
# package show
PROJECTNAME
=
$1
COMMAND
=
$2
fi
else
# 3 or more param
PROJECTNAME
=
$1
shift
COMMAND
=
$2
PARAM
=
$3
fi
#echo PROJNAME: $PROJECTNAME
COMMAND
=
$1
shift
#echo COMMAND: $COMMAND
PARAM
=
$1
shift
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment