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

Use the stdlib instead of atty #43

Open
o0Ignition0o opened this issue Sep 18, 2023 · 3 comments
Open

Use the stdlib instead of atty #43

o0Ignition0o opened this issue Sep 18, 2023 · 3 comments

Comments

@o0Ignition0o
Copy link
Member

apollographql/router#3809

The apollo-router-scaffold crate currently depends on clap version 2.34.0 which depends on the atty crate which has potential unsoundness and is unmaintained. Upgrading clap to version 4.4.2 (same as the apollo-router depends on) would remove atty from the workspace entirely.

@gabhijit
Copy link
Contributor

@o0Ignition0o : In my local fork, I quickly tried using clap version 4.4.x, it seems to work fine. Related: When we move to clap version 4.x, we may need to get rid of the structopt. Does that make sense?

I can take a shot at this.

@bnjjj
Copy link
Collaborator

bnjjj commented Nov 10, 2023

Yes @gabhijit it would make sense to get rid of the structopt since it's included in clap now

@gabhijit
Copy link
Contributor

Will send a PR for this sometime next week, will also see if any other dependencies can be updated.

gabhijit added a commit to gabhijit/cargo-scaffold that referenced this issue Nov 15, 2023
Updated `clap` to use version 4 and thus removed some unwanted
dependencies such as `structopt` and `bestructed`

Also updated all dependencies to their latest minor versions.
gabhijit added a commit to gabhijit/cargo-scaffold that referenced this issue Nov 20, 2023
Updated `clap` to use version 4 and thus removed some unwanted
dependencies such as `structopt` and `bestructed`

Also updated all dependencies to their latest minor versions.
gabhijit added a commit to gabhijit/cargo-scaffold that referenced this issue Nov 20, 2023
Updated `clap` to use version 4 and thus removed some unwanted
dependencies such as `structopt` and `buildstructor`

Also updated all dependencies to their latest minor versions.
bnjjj pushed a commit that referenced this issue Dec 13, 2023
* Clap v4 and updated ther dependencies (#43)

Updated `clap` to use version 4 and thus removed some unwanted
dependencies such as `structopt` and `buildstructor`

Also updated all dependencies to their latest minor versions.

* Better support for 'building' `Opts` structure.

Added `default` derive on the `Opts` structure and a bunch of public
methods to set various attributes of the `Opts` structure. Thus `Opts`
structure can now be created using `Opts::parse` or using
`Opts::default` and then can be updated using `builder` pattern.

Also added documentation and unit tests for building `Opts` structure.

Changed the example to use the `builder` pattern from original
`parse_from` based derive.

* Public APIs to use `Into` and `builder` function

All the public API functions were using `&str`, which is not wrong per
se, but even better approach is to use an `Into` for the public API.
Updated public APIs to use this.

Also added a `builder` function as using `default` may not be obvious,
but a documented `builder` API is a good choice.
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

No branches or pull requests

3 participants