Alright so I've been trying to come up with a solution and I am having a bit of trouble. Hoping someone can point me in the right direction here.
If a -d argument is provided then, instead of printing the result, the program should write the result to a file at the specified path.
So java src/CLI.java -d out.txt 9 should write 81 into a file named out.txt. The order that -d and --operation are provided should not matter. java src/CLI.java -d out.txt --operation factorial 3 and java src/CLI.java --operation factorial -d out.txt 3 should behave exactly the same.
What I have works with the previous challenge. The two big glaring issues is how to handle the order in which the commands are given and then writing to a file the value provided. I was going to look up how to write to a file (since I don't believe that was covered yet) The bigger issue I am struggling with is how to handle the commands in which I receive them. I also probably need to setup an enum or something if I ever want to expand my available commands.