Skip to content

password from a pipe or a non-terminalΒ #12

@gilleslamiral

Description

@gilleslamiral

Hi,

I hope gts is meant to be run also without a end-user ready to type a password at each run.

The syntax documented as username:password no longer works.
The code main() has:

    pw = getpass.getpass('Password:')

I suggest to replace it with:

    if sys.stdin.isatty():
        pw = getpass.getpass('Password:')
    else:
        print 'Password:'
        pw = sys.stdin.readline().rstrip()

This way it'll be possible to use:

{ sleep 1; cat secret.nchah ; } | gts 'nchah' 'github-traffic-stats' 'save_csv'

Otherwise I'm open to any other suggestion to avoid a user typing the password at each request.
Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions