Cp does not support wildcards
At least on Windows, I can't use a * wildcard to copy files from my local computer to the Algorithmia store.
The error I get looks like this:
Error uploading ./model.*: io error: The filename, directory name, or volume label syntax is incorrect. (os error 123)
[catching up on issues - my apology]
Wildcard support when copying is currently limited to whatever your shell expands. For bash and similar, the shell expands * and similar to full paths, so algo cp *.png data://.my/images becomes something like algo cp /path/to/foo.png /path/to/bar.png data://.my/images which this CLI supports. Unfortunately, on Windows, I don't believe either cmd or Powershell expand wildcards, leaving it to each program to implement wildcard support.
I would like to see some glob support inside this CLI, primarily as a way to glob with remote paths, so it seems reasonable to also implement local globbing for Windows shells. However, I don't currently have any ETA for this. I can help you come up with specific cmd or powershell expansion loops if you have a particular scenario you need to support.
Implementation notes
I see 2 main implementation paths:
-
Use FindFirstFile/FindNextFile Windows APIs directly via winapi crate. This would need feature flagged for just windows builds, and would be consistent with other Windows tools.
-
Use glob's implementation. This looks very straight-forward, but might not exactly match Windows user expectations in corner cases. Also, since
bash/zsh/etc...will still handle glob expansion before callingalgo, this might be redundant and inconsistent (for example,algo cp *.pngexpanded by the shell might behave slightly differently thanalgo cp "*.png"expanded byalgo).
(I currently lean slightly toward the first approach)