That is NOT from the command line. The command line means when you apply it from the Windows Command Prompt or the Mac OS X Terminal application. Actions require a UI and therefore are NOT done at the command line.
Now that being said your suggestion is a good one.