Currently, I do not let user specify the mode within the GUI. The program runs in the specified mode when it was started. So, I expect a
string 'local' or 'remote' as one of the command line parameters. I read in this forum somewhere that asking user to type in mode is not permissible. In my instructions they do specify the possible command line parameters and mode is not one of them.
But I do not see any other reasonable way to figure out the mode only based on either file name or host name. Unless I try to instantiate the Data class with the only parameter I get from user (it could be file name or host name, port number is optional) and if it throws exception, I will not know if user entered filename or hostname. Even when there is exception thrown by Data class, it could be for two reasons file does not exist or it is not a file name.
The other way is to make port number mandatory and then the number of parameters will tell if user intends to run the program in local or remote mode. I feel it is rather clumsy to do this way.
Appreciate anyone's rely on this. Thanks