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

Unmatched argument log is printed in bal commands with --help flag #309

Closed
gayaldassanayake opened this issue Aug 16, 2023 · 10 comments · Fixed by #368
Closed

Unmatched argument log is printed in bal commands with --help flag #309

gayaldassanayake opened this issue Aug 16, 2023 · 10 comments · Fixed by #368

Comments

@gayaldassanayake
Copy link
Contributor

Description:
In some bal --help <cmd-name> commands, after the help text, an error Unmatched argument at index 1: is printed

Steps to reproduce:

$ bal --help openapi
NAME
       ballerina-openapi - Generate a Ballerina service or a client from an
       ... ELIMINATED FOR BREVITY
      Unmatched argument at index 1: 'openapi'

Affected Versions:
2201.7.0 (need to check in other versions as well)

OS, DB, other environment details and versions:

Related Issues (optional):

Suggested Labels (optional):

Suggested Assignees (optional):

@kritikash18
Copy link

Hi, Can I work on this?

@gayaldassanayake
Copy link
Contributor Author

👋 Welcome, @kritikash18 ! 🚀

We're thrilled to have you join the Ballerina Lang community! Whether you're a seasoned developer or just starting your journey with Ballerina, we value your contributions and look forward to collaborating with you.
To help you get started, here are some essential resources:

Understanding Ballerina Platform:
Learn what Ballerina is all about: Ballerina Platform
How to Contribute:
Read our contributing guidelines to understand how you can contribute effectively: Contribution Guide
Contributing to the Ballerina library:
If you're interested in contributing to our library, here are the guidelines: Library Contribution Guide
Learn Ballerina:
If you're new to Ballerina or want to enhance your skills, our official website offers a wealth of learning resources: Learn Ballerina
Get Help and Connect:
Join our Discord community to chat with fellow Ballerina enthusiasts and get assistance: Ballerina Discord
Remember, no contribution is too small, and your feedback is invaluable. Feel free to ask questions, propose ideas, or report issues. Together, we can make Ballerina even better!
Happy coding! 🎉

@kritikash18
Copy link

Hi, I'm following these instructions to build and test my code: https://github.com/ballerina-platform/ballerina-distribution/blob/master/docs/build-ballerina-from-source.md#building-the-complete-ballerina-distribution
I'm only building the runtime though. However, when I run commands like
bal openapi --help
it gives me error unknown command openapi. Is that expected? since I'm only building the runtime? If yes, do I need to follow both build the distribution and the runtime to get the full set?

@keizer619 keizer619 moved this from Todo to In Progress in Hacktoberfest 2023 Oct 13, 2023
@gayaldassanayake
Copy link
Contributor Author

For the openapi command to be included, you need the full distribution. Instead of openapi you can use run or test and reproduce the same with the pack you have right now.
eg :- bal --help run

@kritikash18
Copy link

kritikash18 commented Oct 15, 2023

Hi guys, I've noticed an odd difference. I ran two versions of bal
First, installed through brew - it gives me the same error as above
Second, after uninstalling brew version, I built the runtime code from source using gradlew clean build - it doesn't give this error at all, I tried 4-5 commands at least and it seems to work fine?
@gayaldassanayake
attaching screenshots for both brew version and local version below:

BREW VERSION:

Screenshot 2023-10-15 at 9 55 21 AM

LOCAL VERSION:

Screenshot 2023-10-15 at 9 55 47 AM

@gayaldassanayake
Copy link
Contributor Author

Sorry about the late response. Yes, you are correct. However if you build the distribution (https://github.com/ballerina-platform/ballerina-distribution.git) and use ballerina-distribution/ballerina/build/distributions/ballerina-2201.8.0-SNAPSHOT-swan-lake/bin/bal to run bal --help doc, you will ge the unmatched argument error.

My hunch is that the issue lies in https://github.com/ballerina-platform/ballerina-update-tool

@keizer619
Copy link
Member

As @gayaldassanayake mentioned this is happening in the zip artifacts built at ballerina-distribution repository.
In that zip we have additional shell file which gets called initially.

@keizer619 keizer619 moved this from In Progress to Todo in Hacktoberfest 2023 Nov 16, 2023
@keizer619
Copy link
Member

@kritikash18 are you still working on this?

@Jaagrav
Copy link
Contributor

Jaagrav commented Oct 9, 2024

@keizer619 I faced this issue as well and had some difficult time trying to figure out how I was executing the --help command wrong, hopefully this seems like a decent fix? PTAL.

#368

@github-project-automation github-project-automation bot moved this from Todo to Done in Good First Issues Nov 4, 2024
Copy link

github-actions bot commented Nov 4, 2024

This issue is NOT closed with a proper Reason/ label. Make sure to add proper reason label before closing. Please add or leave a comment with the proper reason label now.

      - Reason/EngineeringMistake - The issue occurred due to a mistake made in the past.
      - Reason/Regression - The issue has introduced a regression.
      - Reason/MultipleComponentInteraction - Issue occured due to interactions in multiple components.
      - Reason/Complex - Issue occurred due to complex scenario.
      - Reason/Invalid - Issue is invalid.
      - Reason/Other - None of the above cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants