Danielededo / SagradaFamilia

Software Engineering Project 2017/2018 @Polimi
Apache License 2.0
1 stars 0 forks source link

no "usage tip" if no parameter #10

Closed ingconti closed 6 years ago

ingconti commented 6 years ago

1) I run client

java -jar /Users/ingconti/Downloads/LM_15_client.jar 2) it starts

I see: Non è stata inserita nessuna porta o indirizzo ip

(fine.. ) but: no "usage" info about paramters.

run ping on your *nix pc, you will see:

you got:

usage: ping [-AaDdfnoQqRrv] [-c count] [-G sweepmaxsize]

pls add a similar logic.

ingconti commented 6 years ago

If I use:

java -jar /Users/ingconti/Downloads/LM_15_client.jar 127.0.0.1

Non è stata inserita nessuna porta o indirizzo ip

but ip is present. pls verify HOW to pass paramters.

in Unix app you usually use:

[-xxx param1] [-yyyy param2]

where [] means optionals

so you should have:

java -jar ./LM_15_client.jar 127.0.0.1 or: java -jar ./LM_15_client.jar --PORT 1234 127.0.0.1

but your logic now is wrong

mariodiodoardo commented 6 years ago

ok now i changed it. Can you check if it works now? Another question, i don't understand is port a mandatory parameter or should i give it a default value?

ingconti commented 6 years ago

I wil check. port: 1) optional (I said it above... square brackets.. ) 2) you must have a default, but use param if passed 3) validate if is a valid number

mariodiodoardo commented 6 years ago

ok now i set it by default if is missing and i change CONFIG.md

ingconti commented 6 years ago

nice. I will try.