#!/usr/bin/env python

import argparse
from termcolor import colored, cprint

from githublist.parser import main as get_data
from githublist.serve import serve_content

parser = argparse.ArgumentParser(description='View repositories for any GitHub account.')
parser.add_argument('user', type=str, nargs='+', help='GitHub user handle')
parser.add_argument('-f', '--format', nargs='+',
                    choices=['json', 'csv', 'md', 'raw.txt', 'tbl.txt', 'all'],
                    help='File output format.')


def main():
    args = parser.parse_args()
    user = args.user
    format_ = ['json', 'csv', 'md', 'raw.txt', 'tbl.txt'] if 'all' in args.format else args.format

    for u in user:
        print('Preparing data for {}...'.format(colored(u, 'white')))
        d = get_data(u)
        for f in format_:
            if f is not None:
                print(' Writing {}...'.format(colored(f, 'white')), end='')
                serve_content(d, u, f)
                print(' Done!')
            else:
                serve_content(d, u, f)
    cprint('Complete!', 'red')
    return None

if __name__ == '__main__':
    main()

@@ -352,14 +352,8 @@
 ent(
-'-f', 
 '--f
@@ -496,17 +496,54 @@
  format.
-'
+ default=tbl.txt', default=%5B'tbl.txt'%5D
 )%0A%0A%0Adef 
@@ -615,16 +615,75 @@
 ormat_ =
+ args.format%0A    if 'all' in args.format:%0A        format_ =
  %5B'json'
@@ -722,49 +722,8 @@
 xt'%5D
- if 'all' in args.format else args.format
 %0A%0A  
@@ -863,42 +863,8 @@
 t_:%0A
-            if f is not None:%0A    
     
@@ -935,36 +935,32 @@
 '')%0A            
-    
 serve_content(d,
@@ -970,36 +970,32 @@
  f)%0A            
-  
-  
 print(' Done!')%0A
@@ -998,65 +998,8 @@
 !')%0A
-            else:%0A                serve_content(d, u, f)%0A
     

Add default format type