Conversation
Added 'rfd' and 'inquire' crates to Cargo.toml and updated Cargo.lock with their dependencies. This enables new functionality that relies on these libraries.
Updated dataset and file CLI commands to use the new file_picker utility for selecting upload files, supporting both single and multiple file uploads. Refactored direct upload body creation to work with UploadFile objects and improved error handling for file selection and MIME type inference.
Introduces src/cli/file_picker.rs, providing FilePickerOptions, FilePickerResult, and functions for selecting files via GUI or TTY. Also registers the new file_picker module in src/lib.rs. This enables flexible file selection for CLI workflows, supporting both single and multiple file picking.
Moved the rfd dependency to only build on macOS and Windows, and updated file picker logic to only use the GUI picker on those platforms. On other platforms, file selection now always falls back to TTY prompts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new, flexible file picker system to the CLI, allowing users to select files for upload using either a GUI dialog or a command-line prompt. It refactors the dataset and file upload logic to use this picker, supporting both single and multiple file selection and improving user experience across platforms.
File Picker System Integration
file_pickerwith theFilePickerOptionsstruct and related logic to support both GUI and TTY-based file selection, including multi-file support. This uses therfdandinquirecrates for GUI dialogs and command-line prompts, respectively. [1] [2] [3]Refactoring CLI Upload Workflows
DatasetSubCommandandFileSubCommandindataset.rsandfile.rsto use the new file picker, allowing users to select files interactively or via pre-supplied paths, with support for both single and multiple uploads. [1] [2] [3] [4] [5] [6]Direct Upload Logic Improvements
UploadFiletype, ensuring robust filename extraction and MIME type inference, and restricting direct uploads to local files only.Dependency Additions
rfd(for GUI file dialogs) andinquire(for interactive command-line prompts) toCargo.toml.These changes collectively improve the flexibility and usability of file selection in the CLI, making uploads more user-friendly and robust across different environments.