Section 3 of 3 - Return to Section 1?
Part of my writing on hobby videogame development




What Command-Line Arguments are Valid? Required?

If you're ever unsure what command line arguments are allowable for a given compiler, other program, or system command (basic functionality like dir/ls, cd, etc.), try giving the program name or command an argument like "/?" (DOS), "--help" (works for gcc and g++ compiler), "-help" (works for Adobe's mxmlc Flash compiler), or if using Mac/Linux, typing "man" (short for manual) before it, like so:

dir /?
gcc --help
./mxmlc -help
man ls [Note: Use arrows to scroll, and press the Q key to quit]


After typing these, the command-line window will be filled with text describing optional arguments, or additional parameters/arguments for additional detail.

In many cases, programs and system commands that require command-line arguments will provide helpful details about what arguments are needed if the program is called without passing any arguments.

What Are Some Other System Commands?

Here is a summary of common system commands, including those covered earlier:

PurposeWindows/DOSMac/Linux
View directory contents

dir

ls

Change active directory

cd

cd

Identify current folder

[in the prompt]

pwd

Copy a file or folder

copy

cp

Rename/move
file or folder

ren

mv

Make folder

mkdir

mkdir

Remove folder
(Must be empty)

rmdir

rmdir

Remove file

del

rm


Now What?

You've been introduced to:

  1. What is the command-line
  2. What are command-line arguments
  3. How to navigate and view folders using the command-line
  4. How to learn which command-line arguments are valid

This is far from a comprehensive guide on how to use the command-line, but with a little practice navigating between folders, more online reading, and experimenting with "/?" arguments or "man" calls to investigate options for the system commands, the command-line can become a lot more comfortable. Next time you find a technical walkthrough that involves using command-line arguments, you'll be ready.



-Chris DeLeon
chris@gamedevlessons.com
April 28, 2010