I believe he's asking about passing command line arguments to his program rather than using his program to call a command-line function.
As copeg stated, what problem are you running into?
Right away I can tell you have a few grammatical errors with your code. You're trying to access arg0 which doesn't exist.
if (args[0].equals(arg0))
{
//perform file operation
}
if (args[1].equals(arg0))
{
perform sort type
}
Perhaps you meant an actual string, such as
-fres?
Try this instead:
if (args[0].equals("-fres"))
{
//perform file operation
}
if (args[1].equals("-fres"))
{
perform sort type
}