This repository has been archived by the owner on Nov 1, 2023. It is now read-only.
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.
A Friday afternoon jaunt.
To be merged after #2855; does the remaining work to close #2277 (and closes off some things that Dependabot was trying to upgrade).
Tested by manually running the commands; we don't have good coverage for this kind of stuff. OTOH, most of these commands are for the experimental local fuzzing mode, which is not fully supported yet. I did specifically test the
onefuzz-task managed
command which is the one used in production.Details
clap
to 4.1.6structopt
as this is subsumed by clap nowenvlogger
to 0.10 (removes problematic dependency)default-features=false
onproc-maps
(removes a feature which is only needed to support FreeBSD), and bump it to 0.3The main changes migrating
clap
are:value_t!
is gone; now usematches.get_one::<T>
. IfT
is notString
then a parser must have been registered on theArg
when it was created, witharg.value_parser(value_parser!(T))
.Command::with_name
andArg::with_name
are now callednew
.Command
andSubcommand
were unified, andApp
is removed.arg.takes_value(true)
is gone; it is the default. For flags usearg.action(ArgAction::SetTrue)
and then retrieve the flag value withmatches.get_flag
.This code would be simplified a lot by using the
clap::Parser
on structs, but that requires reworking the code significantly as we cannot dynamically add/remove arguments the way that this is currently done.Also found
Found one bug while manually testing the
onefuzz-task local
commands; see comment below.