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

Fix for multiple extension entry bug (+ api change) in 'build' subcmd #170

Merged
merged 16 commits into from
Oct 3, 2023
Merged

Fix for multiple extension entry bug (+ api change) in 'build' subcmd #170

merged 16 commits into from
Oct 3, 2023

Conversation

shakfu
Copy link
Contributor

@shakfu shakfu commented Oct 3, 2023

In the prior commit there was a bug which prevented multiple extensions from being entered via the build subcmd (it would always take the last one entered).

The below code

build_sp.add_argument("-n", "--ext-name", nargs=True, help="name of extension")
build_sp.add_argument("-p", "--ext-path", nargs=True, help="path of extension")

really should have been

build_sp.add_argument("-n", "--ext-name", nargs='+', help="name of extension")
build_sp.add_argument("-p", "--ext-path", nargs='+', help="path of extension")

But it was found that this would force the user to enter names and files separately:

python -m pydust build \
	--ext-name 'fib._lib' 'fib._hello' \
	--ext-path 'fib/fib.zig' 'fib/hello.zig'

While this is not terrible, this PR proposes the following new api for entering extensions from the commandline instead:

build_sp.add_argument("-e", "--extensions", nargs='+', help="space separated list of extension '<name>=<path>' entries")

which would allow the entry of multiple extensions as follows:

python -m pydust build --extensions 'fib._lib=fib/fib.zig' 'fib._hello=fib/hello.zig'
# or
python -m pydust build -e 'fib._lib=fib/fib.zig' 'fib._hello=fib/hello.zig'

@gatesn gatesn enabled auto-merge (squash) October 3, 2023 08:32
@gatesn gatesn merged commit 35eddc4 into spiraldb:develop Oct 3, 2023
1 check passed
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.

2 participants