# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

"""\
Usage:
  gh_user_download <who> <where>
  gh_user_download -h | --help
"""

from __future__ import print_function

import os

from pygithub3 import Github
from docopt import docopt


def main():
    arguments = docopt(__doc__, version="testing")

    who = arguments['<who>']
    where = arguments['<where>']

    gh = Github()

    repos = gh.repos.list(who).all()

    for repo in repos:
        url = repo.git_url
        print(url, 'to', os.path.join(where, repo.name))
        os.system('git clone ' + url + ' ' + os.path.join(where, repo.name))


if __name__ == '__main__':
    main()

@@ -499,16 +499,21 @@
 download
+ %5B-s%5D
  %3Cwho%3E %3C
@@ -519,16 +519,16 @@
 %3Cwhere%3E%0A
-
   gh_use
@@ -549,16 +549,58 @@
 %7C --help
+%0A%0AOptions:%0A  -s, --ssh  Checks out via ssh
 %0A%22%22%22%0A%0Afr
@@ -761,15 +761,11 @@
 on=%22
-testing
+1.0
 %22)%0A%0A
@@ -825,16 +825,45 @@
 where%3E'%5D
+%0A    ssh = arguments%5B'--ssh'%5D
 %0A%0A    gh
@@ -936,16 +936,110 @@
  repos:%0A
+        if ssh:%0A            url = 'git@github.com:' + who + '/' + repo.name%0A        else:%0A    
         
@@ -1070,23 +1070,13 @@
    p
-rint(url, 'to',
+ath =
  os.
@@ -1102,16 +1102,46 @@
 po.name)
+%0A        print(url, 'to', path
 )%0A      
@@ -1183,38 +1183,12 @@
 ' + 
-os.
 path
-.join(where, repo.name)
 )%0A%0A%0A

Add option to download via SSH