Open rmustacc opened 8 years ago
IIRC, the second option is complicated because "mput -f x y" will put the file to "y" (not "y/x") if "y" does not already exist. If that's not possible, explicitly failing seems much better, and I don't think I would consider that a breaking change.
FWIW:
$ mantash put -h
put a local file to manta
Usage:
put [OPTIONS] LOCAL-PATH MANTA-PATH
put [OPTIONS] LOCAL-PATH ... MANTA-DIRECTORY
Would it be too subtle to have behaviour like that ^^ (i.e. more like cp
) if no '-f' flag was given?
mput -f LOCAL-PATH MANTA-PATH # 1.
mput LOCAL-PATH MANTA-PATH # 2.
mput LOCAL-PATH ... MANTA-DIRECTORY # 3.
...stdin... | mput MANTA-PATH # 4.
mput -f LOCAL-PATH LOCAL-PATH MANTA-PATH # error because -f usage and >1 arg
I don't think there is an ambiguity, just perhaps subtle.
Then there may be other Qs, like should mput LOCAL-PATH MANTA-DIRECTORY
work as cp
does by writing to MANTA-DIRECTORY/$(basename LOCAL-PATH)
.
Today, if you try to specify mput with multiple invocations of the '-f' option, the last one wins. This behavior can be a little confusing. I'm not sure if we can change it, but it might be nice if we could have one of the following behaviors:
Maybe clarifying the manual page to specify that the last file wins would also be sufficient.