cvmfs/cvmfs — pull request #68 by reneme (2013-01-17 18:54:13+00:00)
Title: Refactoring: cvmfs_server shellscript

This is a major refactoring of the `cvmfs_server` shell script which also changes its interface!

The command line parameter handling of the script was kind of wild until now. `cvmfs_server` expects three different types of parameters:
* a command (f.e. *mkfs*, *rmfs*, *transaction* or *publish*)
* some commands provide options that are not mandatory (like `-o owner`, `-f` or `-u upstream`)
* most commands need mandatory parameters like the repository name

Until now the whole parameter parsing was done at the end of a script in a hugh and highly nested `case` block that included various `optargs`-loops and exception checking for each of the *commands*.
Instead of having the whole parsing mixed together at one spot I created a shell script function for each of the commands. This simply gets called with all user-provided command line parameters as arguments. The actual parameter parsing for each of the commands is done inside this function, right before the actual execution takes place.
This allows for flexible error checking of the parameters and is more robust against misplaced option switches. Furthermore it encloses the knowledge of the needed parameters inside the sub-command functions instead of spreading it to a central parameter parsing code.

I changed the order of parameters a bit, before it was:
`cvmfs_server {command} [options]`
now it looks like:
`cvmfs_server {command} [options] `
in order to be consistent with most UNIX tools.

Also I dropped the feature, that `cvmfs_server` was automagically guessing the repository name if there was only one present in the system. This led to confusion of parameters and options before and was inconsistent in many cases.

Finally the script now provided a richer error reporting for missing or misplaced parameters.