diff options
author | Andrew Gallant <jamslam@gmail.com> | 2018-02-03 00:37:52 -0500 |
---|---|---|
committer | Andrew Gallant <jamslam@gmail.com> | 2018-02-04 10:40:20 -0500 |
commit | ce84e1ef049cfa2500e7a2df6a1d4427f1b7a192 (patch) | |
tree | 73bae1f1259450765d76a4da082467c60dd08896 /src/args.rs | |
parent | c8e755f11f31b6da04329cdc7433747bba70150f (diff) |
argv: refactor clap initialization
This commit refactors how we define flags. In theory, this commit
should not result in any behavioral changes (other than perhaps more
consistent rules for flag overrides).
There are two important changes:
Firstly, each flag (or tightly coupled group of flags) is defined in its
own function. This function includes the documentation for that flag. This
improves the locality for each flag; everything you need to know about it
is self-contained in one small region of code.
Secondly, each flag is defined in terms of a very small ripgrep-specific
layer above clap. This permits us to have a set of structured arguments
independent of clap. The intention here is that we can use this indirection
to generate other documentation such as man pages.
This commit lays the ground work for modifying our use of clap in
principled way such that flags can be specified multiple times without
conflict. This in turn will help us implement support for persistent
configuration.
Diffstat (limited to 'src/args.rs')
0 files changed, 0 insertions, 0 deletions