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

Make CLI arguments accessible in zxpy programs #52

Merged
merged 5 commits into from
Feb 21, 2023
Merged

Conversation

tusharsadhwani
Copy link
Owner

@tusharsadhwani tusharsadhwani commented Feb 20, 2023

Allow passing arguments to CLI applications made with zxpy, by appending them after a --.

For example:

#!/usr/bin/env zxpy

import sys
print("Argv is:", sys.argv)

~"echo output: $1 $2 $3"
$ ./test.py           
Argv is: ['/bin/sh']
output:

$ ./test.py -- abc def
Argv is: ['/bin/sh', 'abc', 'def']
output: abc def

Resolves #50

@tusharsadhwani tusharsadhwani changed the title Fix sys.argv passed to tests Make CLI arguments accessible in zxpy programs Feb 20, 2023
@tusharsadhwani
Copy link
Owner Author

@digitalsignalperson can you check that the bahaviour specified in the PR description is what would be expected?

@tusharsadhwani tusharsadhwani merged commit 5b0db6b into master Feb 21, 2023
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.

Make args accessible to shell scripts
1 participant