Opened at 2010-06-28T22:25:20Z
Last modified at 2010-06-29T00:30:08Z
#1103 new defect
"tahoe cp -r" gives unhelpful error message when you append a ':" to the dircap as arg
Reported by: | zooko | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | undecided |
Component: | code-frontend-cli | Version: | 1.7.0 |
Keywords: | usability error easy | Cc: | |
Launchpad Bug: |
Description
The help text for tahoe cp says:
Usage: tahoe [options] cp FROM.. TO … You can also use a dircap as either FROM or TO target:
but it doesn't work. Using --dir-cap=$DIRCAP and the tahoe: alias works:
$ tahoe cp --verbose --node-url=http://127.0.0.1:3456 --dir-cap= URI:DIR2:ctmtx2awdo4xt77x5xxaz6nyxm:n5t546ddvd6xlv4v6se6sjympbdbvo7orwizuzl42urm73sxazqa -r . tahoe: examining 0 of 10 examining 1 of 10 examining 2 of 10 examining 0 of 1 …
but using the $DIRCAP as an argument yields an incorrect error message:
$ tahoe cp --verbose --node-url=http://127.0.0.1:3456 -r . URI:DIR2-RO:ixqhc4kdbjxc7o65xjnveoewym:5x6lwoxghrd5rxhwunzavft2qygfkt27oj3fbxlq4c6p45z5uneq: cannot copy directory into a file
Change History (3)
comment:1 follow-up: ↓ 3 Changed at 2010-06-28T22:32:33Z by zooko
- Summary changed from "tahoe cp -r" won't accept a dircap as TO argument to "tahoe cp -r" gives unhelpful error message when you append a ':" to the dircap as arg
comment:2 Changed at 2010-06-29T00:27:03Z by davidsarah
- Keywords error easy added
comment:3 in reply to: ↑ 1 Changed at 2010-06-29T00:30:08Z by davidsarah
Replying to zooko:
To fix this ticket, make it emit a nice helpful error message in this case. This might be hard because how can it tell that the last argument is a dircap with added garbage after instead of being a filename? Or a tahoe alias named "URI" followed by a path?
It can tell that this is neither a valid dircap+path nor a valid direct filecap, so the error message "cannot copy directory into a file" is definitely wrong. Creating an alias called "URI" should be rejected, since it can't be parsed unambiguously.
Oh, I see that I'm supposed to not append a trailing : to the dircap. (I guess I was thinking of it as being like an SSH address with the dircap as being like the remote host identifier and the path as being like the path-within-that-remote-host part.)
To fix this ticket, make it emit a nice helpful error message in this case. This might be hard because how can it tell that the last argument is a dircap with added garbage after instead of being a filename? Or a tahoe alias named "URI" followed by a path?