Accept both simple string and list of strings in args fields for debug config#191
Merged
playdohface merged 1 commit intozed-extensions:mainfrom Feb 16, 2026
Conversation
tartarughina
approved these changes
Feb 15, 2026
Comment on lines
+406
to
+415
| /// A type that can be deserialized from either a single string or a list of strings. | ||
| /// | ||
| /// When serialized, it always produces a single string. If it was a list, | ||
| /// the elements are joined with a space. | ||
| #[derive(Deserialize, Debug, Clone)] | ||
| #[serde(untagged)] | ||
| pub enum ArgsStringOrList { | ||
| String(String), | ||
| List(Vec<String>), | ||
| } |
Collaborator
There was a problem hiding this comment.
Nice touch for adopting the multiple args while maintaining compatibility
Comment on lines
+423
to
+424
| ArgsStringOrList::String(s) => serializer.serialize_str(s), | ||
| ArgsStringOrList::List(l) => serializer.serialize_str(&l.join(" ")), |
Collaborator
There was a problem hiding this comment.
Should we consider trimming the string or single elements in the list before joining?
Collaborator
Author
There was a problem hiding this comment.
Hmm, we could but I don't really see how that gives us anything. Command-line-args are generally separated by "any amount of whitespace" and if users have trailing and/or leading spaces they work just as well. Personally I'd keep the Serializer as stupid as possible so nobody needs to think twice about what it's doing
Collaborator
There was a problem hiding this comment.
Good, if things are going to work regardless of whitespaces there's not reason not to merge this
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.
Fixes #190
Adds a new type for leniently deserialized argument-lists. Users can supply either a single string (with whitespace-separated args) or a list of strings (commonly this would be an element for each argument, but mix and match will work as well). Since we only pass these on we simply join them by space upon serializing them back to a string.