/**
 * Written by Sterling Zerr 9/20/16
 * This is the main class which takes 5 arguments:
 * 1.) Operation to perform:
 * a.) conceal - steganografies a message into the image
 * b.) reveal  - reveals the steganografied message in image
 * 2.) Flags of which color bytes to conceal the message into (-rgb)
 * a.) 'rgb'
 * b.) 'rg'
 * c.) 'rb'
 * d.) 'bg'
 * e.) 'r'
 * f.) 'b'
 * g.) 'g'
 * 3.) Path of the input image to conceal the message into
 * 4.) Path of the output image which holds the concealed message
 * 5.) Message to conceal into the image
 */

public class Steganography {

    public static void main(String[] args) {

        String operation = null;
        String flags = null;
        String inputFilePath = null;

        if (args.length > 0 && !args[0].equals("help")) {
            if (args[0].equals("conceal") || args[0].equals("reveal")) {
                operation = args[0];
            } else {
                System.out.println("Error: invalid operation - use 'conceal' or 'reveal'");
                System.exit(0);
            }
        } else {
            System.out.println("\nUsage: \n" +
                    "    conceal <flags> <inputPath> <outputPath> <message>\n" +
                    "    reveal <flags> <inputPath>\n\n" +
                    "    operation: 'conceal' or 'reveal'\n" +
                    "    flags: '-rgb' or '-rg' or '-rb' or '-bg' or '-r' or '-b' or '-g'\n" +
                    "    inputPath: path of the input image to coneal the message into\n" +
                    "    outputPath: path of the output image which holds the concealed message\n" +
                    "    message: message to conceal into the image");
            System.exit(0);
        }

        // TODO - regex checking for valid flags
        flags = args[1];

        if (args.length == 3) {
            inputFilePath = args[2];
        }
        if (args.length == 5) {
            inputFilePath = args[2];
        }
        if (args.length > 5) {
            System.out.println("Error: invalid number of arguments");
            System.exit(0);
        }

        if (operation.equals("conceal")) {
            if (args.length > 4 && args[3] != null && args[4] != null) {
                String outputFilePath = args[3];
                String message = args[4];

                StegImage si = new StegImage(inputFilePath, outputFilePath);
                Steganografier Steganografier = new Steganografier(si);
                Steganografier.selectableSteganographi(message, flags);
                String decodedMessage = Steganografier.selectableDesteganographi(flags);

                if (message.equals(decodedMessage)) {
                    si.saveImage();
                } else {
                    System.out.println("There was an error concealing the messge");
                    System.out.println(message + "   !=   " + decodedMessage);
                }

            } else {
                System.out.println("Error: invalid number of arguments");
                System.exit(0);
            }


        } else if (operation.equals("reveal")) {
            StegImage si = new StegImage(inputFilePath);
            Steganografier Steganografier = new Steganografier(si);
            String decodedMessage = Steganografier.selectableDesteganographi(flags);
            System.out.println(decodedMessage);
        }
    }
}

@@ -73,16 +73,21 @@
 h takes 
+3 or 
 5 argume
@@ -89,16 +89,43 @@
 rguments
+ depending on the operation
 :%0D%0A * 1.
@@ -347,16 +347,17 @@
  * a.) '
+-
 rgb'%0D%0A *
@@ -362,16 +362,17 @@
  * b.) '
+-
 rg'%0D%0A * 
@@ -376,16 +376,17 @@
  * c.) '
+-
 rb'%0D%0A * 
@@ -390,16 +390,17 @@
  * d.) '
+-
 bg'%0D%0A * 
@@ -404,16 +404,17 @@
  * e.) '
+-
 r'%0D%0A * f
@@ -417,16 +417,17 @@
  * f.) '
+-
 b'%0D%0A * g
@@ -430,16 +430,17 @@
  * g.) '
+-
 g'%0D%0A * 3
@@ -3173,18 +3173,16 @@
    %7D%0D%0A%0D%0A
-%0D%0A
         

fix inline doc a bit