Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce #[structopt(external_subcommand)] #314

Merged
merged 3 commits into from
Jan 18, 2020

Conversation

CreepySkeleton
Copy link
Collaborator

@CreepySkeleton CreepySkeleton commented Dec 22, 2019

Closes #130

I took some time to develop and debug, but it's finally ready. I have one concern thought.

tests/subcommands.rs Outdated Show resolved Hide resolved
@CreepySkeleton
Copy link
Collaborator Author

Sorry for the radio silence, the New Year and all :)

This is not abandoned, I'll get to it in 1-2 days.

Comment on lines +1 to +8
error[E0308]: mismatched types
--> $DIR/external_subcommand_wrong_type.rs:13:15
|
13 | Other(Vec<CString>)
| ^^^^^^^ expected struct `std::ffi::CString`, found struct `std::ffi::OsString`
|
= note: expected type `std::vec::Vec<std::ffi::CString>`
found type `std::vec::Vec<std::ffi::OsString>`
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error message is rather unfortunate: I would very much like it to say "expected OsString", but there's nothing we can do about it 😢

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the best I've managed to come up with:

error[E0308]: mismatched types
  --> $DIR/external_subcommand_wrong_type.rs:13:15
   |
13 |     Other(Vec<CString>)
   |               ^^^^^^^ expected struct `std::ffi::CString`, found struct `std::ffi::OsString`
   |
   = note: expected type `std::vec::Vec<std::ffi::CString>`
              found type `std::vec::Vec<std::ffi::OsString>`

error[E0308]: mismatched types
  --> $DIR/external_subcommand_wrong_type.rs:13:15
   |
13 |     Other(Vec<CString>)
   |               ^^^^^^^
   |               |
   |               expected struct `std::ffi::OsString`, found struct `std::ffi::CString`
   |               this match expression has type `std::vec::Vec<std::ffi::OsString>`
   |
   = note: expected type `std::vec::Vec<std::ffi::OsString>`
              found type `std::vec::Vec<std::ffi::CString>`

While it is indeed possible to draw the error message we desire, I can't get rid of the first one.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's acceptable

@CreepySkeleton
Copy link
Collaborator Author

OK, ready to go

@CreepySkeleton
Copy link
Collaborator Author

ping @TeXitoi

Copy link
Owner

@TeXitoi TeXitoi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use of AllowExternalSubcommands
2 participants