major refactoring of cvmfs_server shellscript to optimize parameter parsing and parameter misuse
adapted test scripts to the new cvmfs_server shellscript interface
automagically deduct repo name in some special cases
usage text adaption
removed passing of usage string to /dev/tty
Merge pull request #68 from reneme/cvmfs_server_optarg

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} <parameters> [options]
now it looks like:
cvmfs_server {command} [options] <parameters>
in order to be consistent with most UNIX tools.

Finally the script now provided a richer error reporting for missing or misplaced parameters.