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

Error: "app.match is not a function" when --app begins with "-" #287

Closed
krukow opened this issue Oct 27, 2017 · 3 comments
Closed

Error: "app.match is not a function" when --app begins with "-" #287

krukow opened this issue Oct 27, 2017 · 3 comments
Assignees
Labels
Better documentation Write better documentation

Comments

@krukow
Copy link
Member

krukow commented Oct 27, 2017

Example reproduction:

$ mobile-center test run uitest --app "-a-/app" \
   --devices 12345678 --app-path MyDrivingiOS.ipa \
   --test-series "master" --locale "en_US" \
   --build-dir  MyDriving/MyDriving.UITests/bin/Debug \
   --uitest-tools-dir packages/Xamarin.UITest.2.1.3/tools
Preparing tests... done.
Error: app.match is not a function
@krukow krukow changed the title Error: app.match when --app begins with "-" Error: "app.match is not a function" when --app begins with "-" Oct 28, 2017
@christav
Copy link

As a workaround, you can specify the argument like this instead:

mobile-center test run uitest --app="-a-/app" \
   --devices 12345678 --app-path MyDrivingiOS.ipa \
   --test-series "master" --locale "en_US" \
   --build-dir  MyDriving/MyDriving.UITests/bin/Debug \
   --uitest-tools-dir packages/Xamarin.UITest.2.1.3/tools

Note the use of "=" instead of a space separating the --app flag from its argument.

The underlying cause of this appears to be an issue with the way we're parsing the command line arguments, the app name is being parsed as a "-a" switch. The "=" syntax works around this.

@christav
Copy link

christav commented Dec 2, 2017

So thinking on this further, I think using = in cases like this is the best we're going to get. looking at the rules for parsing gnu-style long arguments this is what's supposed to happen - this case is simply ambiguous.

I'm currently thinking that this is best handled via documentation or a change to appcenter so that app/user names can't start with a -.

@amchew
Copy link
Contributor

amchew commented Nov 8, 2018

Hi @krukow ! We've documented the workaround in the CLI docs (thanks to @hilts-vaughan for the submission 👍 !). I'll be closing this ticket for now, let us know if you have any other feedback. Hope all is good :)

@amchew amchew closed this as completed Nov 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Better documentation Write better documentation
Projects
None yet
Development

No branches or pull requests

3 participants