Skip to content

Nested CLI-Arguments - #96

Merged
da-h merged 3 commits into
masterfrom
nested_args
Nov 16, 2021
Merged

Nested CLI-Arguments#96
da-h merged 3 commits into
masterfrom
nested_args

Conversation

@da-h

@da-h da-h commented Nov 16, 2021

Copy link
Copy Markdown
Owner

Nested CLI-Arguments

This MR introduces nested CLI-Arguments to miniflask.

Description

Setting a list of variables for a single module can become cumbersome.

Previously / Example:

python do.py --repo.modulegroup.module.var1 42 --repo.modulegroup.module.var2 43 --repo.modulegroup.module.var3 43 --repo.modulegroup.module.var4 42 --repo.modulegroup.module.var5 42

Fuzzy-arguments improve this user experience

python do.py --module.var1 42 --module.var2 43 --module.var3 43 --module.var4 42 --module.var5 42

However, the module name (module in this case) has to be written for every single variable (if the variable name may not be unique).

New Behavior:
With this MR, it is possible to instead specify variables in a nested fashion:

python do.py --module [ --var1 42 --var2 42 --var3 42 --var4 42 --var5 42 ]

Even nested expressions are possible,

python do.py --modulegroup [ --module [ --var1 42 --var2 42 ] --othermodule [ --var1 42 --var2 42 ] ]

Things done in this MR

  • Included nested arguments parsing into mf.parse_args

Check all before creating this PR:

  • Documentation adapted
  • unit tests adapted / created

@da-h da-h linked an issue Nov 16, 2021 that may be closed by this pull request
@da-h
da-h force-pushed the nested_args branch 2 times, most recently from 9e5fe0a to 42bbf33 Compare November 16, 2021 16:30
@da-h
da-h merged commit 006b38e into master Nov 16, 2021
@da-h da-h changed the title Nested args Nested CLI-Argumentjs Nov 16, 2021
@da-h da-h changed the title Nested CLI-Argumentjs Nested CLI-Arguments Nov 16, 2021
github-actions Bot pushed a commit that referenced this pull request Nov 16, 2021
@sbrodehl
sbrodehl deleted the nested_args branch October 7, 2022 12:18
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.

Group CLI-Arguments

1 participant