How Not to Parse Command Line Arguments was originally published on December 15, 2006.


Today's Code Snippet is from S.C., who shared this in the Side Bar a littler earlier this week ...

public static void  main (String args[])
{
    // Get a hash value for the first argument
    int hash = getHashValue(args[0].toCharArray());

    switch(hash)
    {
        case 972346: // The first argument was "help"
            ...
            break;
        case -91058: // The first argument was "single"
            ...
            break;
        case -4830672: // The first argument was "multi"
            ...
            break;
        // etc
    }
}