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

Can't provide extended argument on Cli call #98

Closed
camlafit opened this issue Jan 5, 2015 · 4 comments
Closed

Can't provide extended argument on Cli call #98

camlafit opened this issue Jan 5, 2015 · 4 comments

Comments

@camlafit
Copy link

camlafit commented Jan 5, 2015

Hi

I try to use CLI on bash script. My purpose create an user.

As described on gitlab cli help (http://www.rubydoc.info/gems/gitlab/Gitlab/Client/Users#create_user-instance_method) , I define first argument as mail, and second with password.
But as described by https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/users.md I want add username and name required. To this I try to use last argument, an YAML option.

gitlab create_user "cam@example.com" "tototo" "---\n'username': camlafit\n---\'name': cam"

The script return an invalid YAML string because it's escaped.

How to do this ?

@asedge
Copy link
Collaborator

asedge commented Jan 5, 2015

Try passing those options as a YAML Hash. For example:

gitlab create_user "cam@example.com" "tototo" "{username: camlafit, name: 'cam'}"

This worked on my development Gitlab server. One small issue I encountered was that the password you were trying to use was too short (8 char minimum).

@asedge asedge closed this as completed Jan 6, 2015
@asedge
Copy link
Collaborator

asedge commented Jan 6, 2015

Reopen if the solution provided does not work for you. Thanks!

@camlafit
Copy link
Author

camlafit commented Jan 6, 2015

Hi

Thanks I've tried with an YAML hash (as described in documentation) but I've been this result :
Server responded with code 400, message: #<Gitlab::ObjectifiedHash:0x000000013353f0>. Request URI: https://example.com/api/v3/users

Then I've presume were a problem on my option.

I've tried as supossed with a password stronger and it's ok.

Do you think Is it possible to have a return more explicit ?

@asedge
Copy link
Collaborator

asedge commented Jan 6, 2015

@camlafit Would you mind opening a new issue for this? The output could definitely be improved. Thanks!

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

No branches or pull requests

2 participants