static void Main(string[] args)
{
string action = null;
string user = null;
string key = null;
string netstorageURI = null;
string uploadfile = null;
string outputfile = null;
string targetFilename = null;
string dstFilename = null;
bool indexZip = false;
string firstarg = null;
foreach (string arg in args)
{
if (firstarg != null)
{
switch (firstarg)
{
case "-a":
action = arg;
break;
case "-u":
user = arg;
break;
case "-k":
key = arg;
break;
case "-o":
outputfile = arg;
break;
case "-f":
uploadfile = arg;
break;
case "-t":
targetFilename = arg;
break;
case "-d":
dstFilename = arg;
break;
}
firstarg = null;
}
else if (arg == "-h" || arg == "--help" || arg == "/?")
{
help();
return;
}
else if (arg == "-indexzip")
indexZip = true;
else if (!arg.StartsWith("-"))
netstorageURI = arg;
else
firstarg = arg;
}
execute(action, user, key, netstorageURI, uploadfile, outputfile, targetFilename, dstFilename, indexZip);
}