diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-10-28 04:34:33 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-10-28 06:04:41 +0300 |
commit | 6ac46c9708f46f9dd83dd36008d6f7c9569b74eb (patch) | |
tree | ae9b6a7109e53b778ea95eae7bd271a1204f894c /source/blender/blenlib/BLI_args.h | |
parent | 5711b8514726a15a1cb1783fd56a0dda48b5b0a2 (diff) |
BLI_args: refactor argument passes
Avoid passing the pass argument to BLI_argsAdd, instead set this
once for each group of passes.
This means we can add new passes without having to bump the arguments
to BLI_argsAdd.
Diffstat (limited to 'source/blender/blenlib/BLI_args.h')
-rw-r--r-- | source/blender/blenlib/BLI_args.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/blenlib/BLI_args.h b/source/blender/blenlib/BLI_args.h index 54b5161f15a..2bd0e7b9019 100644 --- a/source/blender/blenlib/BLI_args.h +++ b/source/blender/blenlib/BLI_args.h @@ -41,12 +41,14 @@ typedef int (*BA_ArgCallback)(int argc, const char **argv, void *data); struct bArgs *BLI_argsInit(int argc, const char **argv); void BLI_argsFree(struct bArgs *ba); +/** The pass to use for #BLI_argsAdd. */ +void BLI_argsPassSet(struct bArgs *ba, int current_pass); + /** * Pass starts at 1, -1 means valid all the time * short_arg or long_arg can be null to specify no short or long versions */ void BLI_argsAdd(struct bArgs *ba, - int pass, const char *short_arg, const char *long_arg, const char *doc, @@ -57,7 +59,6 @@ void BLI_argsAdd(struct bArgs *ba, * Short_case and long_case specify if those arguments are case specific */ void BLI_argsAddCase(struct bArgs *ba, - int pass, const char *short_arg, int short_case, const char *long_arg, |