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

Shell: Cannot accept double quoted strings as single param #86

Closed
davidcfk opened this issue Nov 17, 2014 · 6 comments
Closed

Shell: Cannot accept double quoted strings as single param #86

davidcfk opened this issue Nov 17, 2014 · 6 comments

Comments

@davidcfk
Copy link

It seems like the shell mode can't accept strings that are enclosed in double quotes as a single parameter, it still considers spaces within text "like this" to be two arguments, as an example.

A classic use case was to add a ssh key using create_ssh_key, the second parameter (the key) consists of the ssh type, the key and the machine identifier, so providing all the parameters will lead it to think you have supplied 4 parameters, rather than only 2.

gitlab> create_ssh_key test "some key here" wrong number of arguments (4 for 2) nil

@asedge
Copy link
Collaborator

asedge commented Nov 17, 2014

@davidcfk What version of the gem are you using? I have submitted some code that was merged (#66) in Sept to improve the shell arg parsing but it has not been packaged into an updated gem yet. Could you get the latest code from the repo here and try using that for now?

@davidcfk
Copy link
Author

Thanks, I was using the 3.2.0 ( i just followed the installation instructions on the site ): since then, I've just been using the gitlab directly from the prompt (rather than entering shell), that worked perfectly for me!

@asedge
Copy link
Collaborator

asedge commented Nov 27, 2014

I've confirmed that this works with the latest code on the master branch:

gitlab> create_ssh_key test "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDhyVYP6zCH6zd7dkV/XYqYgTIb9qvqC7Vq/ghVTIFTLEWpa6Lvjs5VTli78uaB/U1Ftg6QBpvWnvABvLmC02Ia8R72XBeHAlG4hYzCFjv/234esbYMxtuV7/YXdZwe/YDlPtZv7/N+d9hA4SFxk72xyklesd5iNRTMMX0/L6IPUC0vLcSKhUKIYtBoalWRGrBrLSHy9+5cOem1iHSOBHfHParQR406ZsSk+w3mPQrIkEZ6IDq89aA8PjFj7av37AWxDRcsS2pI07QlhIy2I7COKRO8GJ6UGWRgflJi/iVldI0T1a9BQDGxpMQSLovTSFOjXR73kglnZ8lVg84tqDDD sean@wiggum"                                                  
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Gitlab.create_ssh_key test, ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDhyVYP6zCH6zd7dkV/XYqYgTIb9qvqC7Vq/ghVTIFTLEWpa6Lvjs5VTli78uaB/U1Ftg6QBpvWnvABvLmC02Ia8R72XBeHAlG4hYzCFjv/234esbYMxtuV7/YXdZwe/YDlPtZv7/N+d9hA4SFxk72xyklesd5iNRTMMX0/L6IPUC0vLcSKhUKIYtBoalWRGrBrLSHy9+5cOem1iHSOBHfHParQR406ZsSk+w3mPQrIkEZ6IDq89aA8PjFj7av37AWxDRcsS2pI07QlhIy2I7COKRO8GJ6UGWRgflJi/iVldI0T1a9BQDGxpMQSLovTSFOjXR73kglnZ8lVg84tqDDD sean@wiggum |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| created_at | 2014-11-27T18:00:46.036Z                                                                                                                                                                                                                                                                                                                                                                                 |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| id         | 4                                                                                                                                                                                                                                                                                                                                                                                                        |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| key        | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDhyVYP6zCH6zd7dkV/XYqYgTIb9qvqC7Vq/ghVTIFTLEWpa6Lvjs5VTli78uaB/U1Ftg6QBpvWnvABvLmC02Ia8R72XBeHAlG4hYzCFjv/234esbYMxtuV7/YXdZwe/YDlPtZv7/N+d9hA4SFxk72xyklesd5iNRTMMX0/L6IPUC0vLcSKhUKIYtBoalWRGrBrLSHy9+5cOem1iHSOBHfHParQR406ZsSk+w3mPQrIkEZ6IDq89aA8PjFj7av37AWxDRcsS2pI07QlhIy2I7COKRO8GJ6UGWRgflJi/iVldI0T1a9BQDGxpMQSLovTSFOjXR73kglnZ8lVg84tqDDD sean@wiggum |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| title      | test                                                                                                                                                                                                                                                                                                                                                                                                     |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
gitlab>

@NARKOZ Safe to close?

@NARKOZ NARKOZ closed this as completed Nov 27, 2014
@davidcfk
Copy link
Author

Thanks, I see, so I had to clone this master branch in order for it to work. Originally I just did
gem install gitlab but I can confirm now on a different machine this does not work (despite being on version 3.2.0)

Here are the correct steps to installing (for me) if you wish to update the README.md document:

git clone https://github.com/NARKOZ/gitlab.git
cd gitlab
gem build gitlab.gemspec
sudo gem install ./gitlab-3.2.0.gem #For cases that plain installing the gem without sudo doesn't work

That should have the updated 3.2.0 copy installed rather than the one that's out of the standard gem install gitlab

If this is just a nuance on a couple of my machines let me know, I tried on two MacOSX as well as a Debian7 to confirm this behavior. Thanks!

@NARKOZ
Copy link
Owner

NARKOZ commented Nov 28, 2014

@davidcfk manual build instructions are described on the website

http://narkoz.github.io/gitlab/installation

@davidcfk
Copy link
Author

Ohhhhh thanks! I'm obviously oblivious I clicked on Documentation rather
than Website when I went to the site... Thanks for that!

On Fri, Nov 28, 2014 at 4:27 PM, Nihad Abbasov notifications@github.com
wrote:

@davidcfk https://github.com/davidcfk manual build instructions are
described on the website

http://narkoz.github.io/gitlab/installation


Reply to this email directly or view it on GitHub
#86 (comment).

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

3 participants