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

Open
gayaldassanayake opened this issue Aug 16, 2023 · 8 comments
Open

Comments

@gayaldassanayake
Copy link

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
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?

@gayaldassanayake
Copy link
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
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
Copy link
Member

@kritikash18 are you still working on this?

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

No branches or pull requests

3 participants