Red Hat Bugzilla – Bug 1002396
Some minor usability issues in zanata-cli pull
Last modified: 2015-07-30 21:21:19 EDT
1. zanata-cli --help pull doesn't indicate src-dir is required
2. it should - if possible - validate the required parameters before checking dependencies, to fail fast
3. Are you sure? (y/n) - the n should be N as it's the default
Regarding #1, with the latest version of client (3.1.1) there is actually a very subtle hint that --src-dir (-s) is required: unlike most of the other options, it is not surrounded by square brackets on the usage line at the top. But I agree that it is not enough!
We could probably do something with reflection to enhance the option descriptions and make it clearer which options are required, but honestly we would probably be better off making all of our options actually optional. After all, there is no reason to force the user to specify src-dir unless we are pulling source documents.
Also, getting useful help when a required option is missing is difficult with Args4j due to https://java.net/jira/browse/ARGS4J-14 We have a workaround, but there are some cases we don't handle. If the options weren't required, we wouldn't need the workaround.
Damian, can you expand on #2?
Re #2 - it takes a good few seconds to check the ivy dependencies before failing with "you forgot option x". It can be a tad annoying to do this a couple of times.
If the script can immediately recognise that the user has omitted an necessary switch then it can just bail out before the wait.
(In reply to Damian Jansen from comment #2)
> Re #2 - it takes a good few seconds to check the ivy dependencies before
> failing with "you forgot option x". It can be a tad annoying to do this a
> couple of times.
A good few seconds? It runs faster than I expected, but perhaps that's just because I expected it to take a little while. It's definitely slower than I would prefer. (And the first invocation of the day isn't as fast as the subsequent runs.)
> If the script can immediately recognise that the user has omitted an
> necessary switch then it can just bail out before the wait.
It can't really do that, because those dependencies (some of them, and we can't be selective) are needed to execute the Java code which checks the options.
I have changed the shell script so that it lets Ivy cache the resolution results. The first invocation should be a little faster, assuming the dependencies have been fetched before. Try zanata-cli-3.1.1-ivy-2.
Migrated; check JIRA for bug status: http://zanata.atlassian.net/browse/ZNTA-450