Skip to content
This repository has been archived by the owner on Mar 3, 2022. It is now read-only.

find-internet-password: illegal option -- w #186

Closed
jalanb opened this issue Jun 25, 2014 · 11 comments
Closed

find-internet-password: illegal option -- w #186

jalanb opened this issue Jun 25, 2014 · 11 comments

Comments

@jalanb
Copy link
Contributor

jalanb commented Jun 25, 2014

Running on OS X, 10.7.5, Ruby 1.8.7, ghi 0.9.3
I frequently see the error in the title, and would appreciate any hints as to how to deal with it. Example interaction follows:

$ ghi list
⠙find-internet-password: illegal option -- w
Usage: find-internet-password [-a account] [-s server] [options...] [-g] [keychain...]
    -a  Match "account" string
    -c  Match "creator" (four-character code)
    -C  Match "type" (four-character code)
    -d  Match "securityDomain" string
    -D  Match "kind" string
    -j  Match "comment" string
    -l  Match "label" string
    -p  Match "path" string
    -P  Match port number
    -r  Match "protocol" (four-character code)
    -s  Match "server" string
    -t  Match "authenticationType" (four-character code)
    -g  Display the password for the item found
If no keychains are specified to search, the default search list is used.
        Find an internet password item.
# jalanb/kd open issues
  13: Explain to user why that directory was chosen
  12: Consider frecency @
  10: Allow user to choose time format  enhancement   ready
   9: Clean history  enhancement  @
   3: Project structure  enhancement   in progress  4 @
   2: Installation  enhancement   ready  @
   1: Improve documentation  enhancement   ready
@stephencelis
Copy link
Owner

Hm, it looks like OS X Lion doesn't support -w, described as follows:

    -w  Display only the password on stdout

Try to edit ~/.gitconfig and change the ghi.token entry to:

[ghi]
  token = "!(security find-internet-password -a $YOUR_USERNAME -s github.com -l 'ghi token' -g 3>&2 2>&1 1>&3) 2>/dev/null | cut -d'\"' -f2"

(Substitute $YOUR_USERNAME with your GitHub username.)

@jalanb
Copy link
Contributor Author

jalanb commented Jul 6, 2014

That led to a cycle of:

Change ~/.gitconfig as per suggestion above

$ ghi list
# Global, open issues assigned to you
Authorization required.

Not authorized for this action with your token. To regenerate a new token:

Please run 'ghi config --auth <username>'

OK, I can do that

$ ghi config --auth $MY_USERNAME
Enter $MY_USERNAME's GitHub password (never stored):       ✔
A ghi token already exists!

Please revoke all previously-generated ghi personal access tokens here:

  https://github.com/settings/applications

Away to website and revoke permission in Github

$ ghi config --auth $MY_USERNAME
Enter $MY_USERNAME's GitHub password (never stored):       ✔
✔︎ Token saved to keychain.

Try again

$ ghi list
⠙find-internet-password: illegal option -- w
Usage: find-internet-password [-a account] [-s server] [options...] [-g] [keychain...]
    -a  Match "account" string
    -c  Match "creator" (four-character code)
    -C  Match "type" (four-character code)
    -d  Match "securityDomain" string
    -D  Match "kind" string
    -j  Match "comment" string
    -l  Match "label" string
    -p  Match "path" string
    -P  Match port number
    -r  Match "protocol" (four-character code)
    -s  Match "server" string
    -t  Match "authenticationType" (four-character code)
    -g  Display the password for the item found
If no keychains are specified to search, the default search list is used.
        Find an internet password item.
#
Authorization required.

Please run 'ghi config --auth <username>'

Change ~/.gitconfig as per suggestion above

$ ghi list
# Global, open issues assigned to you
Authorization required.

Not authorized for this action with your token. To regenerate a new token:

Please run 'ghi config --auth <username>'

And round we go again

@AlexChesters
Copy link
Contributor

Closing this issue as it seems like it only affects an old version of OS X

@fluffywaffles
Copy link

This issue also affects me on OS X Yosemite 10.10.5 - I don't know how old that is, but it's a lot newer than OS X 10.7, which I think is "Lion." Ruby is 2.0.0. ghi is latest; 1.0.4.

Not the first issue, re find-password, but the second issue:

dhcp-129-105-140-172:~ jordan$ ghi
⠙security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.
#
Authorization required.

Please run 'ghi config --auth <username>'

Then I run config, which says ⠓security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain. I try to use ghi again. Return to the top, except now it says Token already exists when I get to config. I revoke tokens. I run it again. Same result. Etc.

EDIT:
Something that might be applicable to this issue: my user folder is on a Network drive. This is the computer I use at work.

@AlexChesters AlexChesters reopened this Feb 24, 2016
@AlexChesters
Copy link
Contributor

OS X Yosemite is only one major version behind the latest so this is more of an issue if it affects that version. What command were you running @skorlir?

@fluffywaffles
Copy link

I ran ghi, then ghi config --auth <username> with my username. No other steps, apart from brew installing ghi in the first place.

@AlexChesters
Copy link
Contributor

@skorlir are you using SourceTree by any chance?

@fluffywaffles
Copy link

Nope. Just regular 'ol git.

If you have trouble reproducing, and are willing to point me in the right direction, I'd be glad to take a stab at fixing this and making a PR. Thought I'd offer. 😄

@AlexChesters
Copy link
Contributor

This looks like it could be a duplicate of #275, can you follow the steps here and see if they help?

@fluffywaffles
Copy link

Actually, that worked. I can't imagine how it's related to SourceTree, at least in this case, but it fixed it! Thanks!

@AlexChesters
Copy link
Contributor

I have absolutely no idea either. It's very strange! Glad you got sorted though @skorlir :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants