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

Use clap's validator instead. #1402

Merged
merged 4 commits into from
Jun 25, 2024
Merged

Use clap's validator instead. #1402

merged 4 commits into from
Jun 25, 2024

Conversation

fnando
Copy link
Member

@fnando fnando commented Jun 24, 2024

What

Use a clap validator to parse the alias argument.

$ stellar contract deploy --wasm ./target/wasm32-unknown-unknown/release/hello_world.wasm --network standalone --source alice --alias '!foo' --global
error: alias must be 1-30 chars long, and have only letters, numbers, underscores and dashes

Why

So we can use a built-in feature.

Known limitations

N/A

@fnando fnando requested a review from willemneal June 24, 2024 20:59
Copy link
Member

@willemneal willemneal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we have a test to show the error works?

@fnando
Copy link
Member Author

fnando commented Jun 24, 2024

@willemneal can you point me to a test I can borrow?

@willemneal
Copy link
Member

@willemneal willemneal enabled auto-merge (squash) June 25, 2024 18:38
Copy link
Member

@willemneal willemneal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use the new type solution later. Best to have something now.

@willemneal willemneal merged commit 7984cd0 into main Jun 25, 2024
25 checks passed
@willemneal willemneal deleted the alias-validator branch June 25, 2024 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants