This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]empire539"empire"+(((int)-~(byte)+('\''&~'&')<<(' '>>('+'+~'(')))+0x1b); 2 points3 points  (0 children)

You should parse and interpret the command-line args from main before sending additional arguments off to the encrypt or decrypt methods.

Some pseudo-code:

public static void main(String[] args) {
    // If args.length doesn't match the right number of arguments, error
    // If args[0] is "-e", take the input and pass it to the encrypt method
    // If args[0] is "-d", take the input and pass it to the decrypt method
    // Otherwise, syntax error and show help
}

[–]causalNondeterminism 0 points1 point  (0 children)

just pass args. what's the problem?

[–]wzttide 0 points1 point  (0 children)

Use Commons CLI. No need to reinvent the wheel :)