Help me get some ideas

Hello,
I have been given a scripting project, but have not learned any scripting. I need to get some ideas on how to start. Attached is part of the project:

I have no idea how to parse the arguments. What I had in mind was to get the arguments ($1, $2, ... ) and have if statements for different cases. The different cases are:
1-argument --> pid
2-arguments --> (-g pid, pid -g, -n name, name -n, -gn name, -ng name, name -gn, name -ng)
3-arguments --> (name -n -g, name -g -n, ...)

but this clearly isn't the right way to do it.
Here is the usage variable btw:

USAGE='Usage: KillByName.sh [-g] -n <name> or KillByName [-g] <pid>'

Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.