Akira, thanks for working on this, and thank you for including changes for both bash and cmd. Allen, thanks for the ping.
The current patch's cmd scripts aren't working. The --loglevel argument is not getting stripped off before passing to the java.exe call. Since java.exe doesn't recognize --loglevel as an argument, it aborts immediately.
To fix this, you'll need to change 2 points in the code that strip away "pre-processed" command line arguments. Unfortunately, this is code duplicated across the 4 main entry points (perhaps unavoidable due to cmd limitations). You'll need to make this change in hadoop.cmd, hdfs.cmd, mapred.cmd and yarn.cmd. Do a find on "--config", and basically you can clone whatever is done for --config and do the same for --loglevel. The first point will be near the top of the file, and this is done to make sure command selection can find the command in the first position. The second point will be in a subroutine named make_command_arguments, and this is done to prevent passing the argument to java.exe.
I see mapred.cmd is setting HADOOP_LOGLEVEL. I expect you won't need to do that, because hadoop-config.cmd will get called through mapred.cmd. Same thing for yarn-config.cmd. It calls hadoop-config.cmd, so you can drop this part of the change.
Also, I have a small suggestion on the 4 documentation files that have this line:
+| --loglevel loglevel | Overwrites the log level. Default is INFO.
Can we also briefly list the valid log level settings, just in case the user isn't familiar with the logging libraries?
Thanks again. I can take it for another test run when a new patch is ready.