-
Notifications
You must be signed in to change notification settings - Fork 50
inform user when no source specified #178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
All the beangulp commands do nothing silently if no source is specified. Why does |
|
If "source" is a required parameter, I'd expect a program to tell me that rather than to just complete doing nothing. |
|
Then the correct solution would be to make the argument required and return an error if it is not provided, and doing so for all commands implemented by beangulp, not just one. However, not making the argument required is a deliberate design choice: command line tools are often invoked with wildcard inputs and they should not error out if the wildcard is empty. This is a very well established convention: if no input is specified, do nothing. |
|
There a huge difference between providing an empty array and not providing it at all, though. |
When passing parameters on the command line, zero or more parameters can be assigned to an argument. There is no such thing as passing an empty array to an argument. |
|
I agree with your conclusion but I still think, using defensive programming, that such case should be explicitly handled rather than implied. Having software that does nothing and hiding required parameters because of the limitations of the command line does not sound like a good practice to me. |
|
What's the difference between the first version of the proposed patch and the latest? It does exactly the same. |
|
Such a trivial issue. |
Log informational message if no source specified, otherwise the archive function completes silently without doing anything.