Skip to content

Commit 8aab53a

Browse files
authored
Merge pull request #197 from teharrison/master
minor search fix
2 parents ddac9b1 + 33c4ead commit 8aab53a

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

scripts/mg-search-metagenomes.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
%s
1313
1414
SYNOPSIS
15-
mg-search-metagenomes [ --help, --user <user>, --passwd <password>, --token <oAuth token>, --order <field name> --direction <cv: 'asc', 'desc'> --match <cv: 'all, 'any'> --status <cv: 'both', 'public', 'private'> --verbosity <cv: 'minimal', 'full'> %s ]
15+
mg-search-metagenomes [ --help, --user <user>, --passwd <password>, --token <oAuth token>, --order <field name> --direction <cv: 'asc', 'desc'> --match <cv: 'all, 'any'> --public ]
1616
1717
DESCRIPTION
1818
Retrieve list of metagenomes based on search criteria.
@@ -58,8 +58,7 @@ def main(args):
5858
parser.add_option("", "--limit", dest="limit", type="int", default=15, help="Number of results to show, if > 50 will use paginated queris to get all, default is 15")
5959
parser.add_option("", "--order", dest="order", default=None, help="field metagenomes are ordered by, default is by score")
6060
parser.add_option("", "--direction", dest="direction", default="asc", help="direction of order. 'asc' for ascending order, 'desc' for descending order, default is asc")
61-
parser.add_option("", "--status", dest="status", default="public", help="types of metagenomes to return. 'both' for all data (public and private), 'public' for public data, 'private' for users private data, default is public")
62-
parser.add_option("", "--index", dest="index", default=None, help="index to search against, default is main DB")
61+
parser.add_option("", "--public", dest="public", action="store_true", default=False, help="return both private and public data if using authenticated search, default is private only. non-authenticated search only returns public.")
6362
for sfield in SEARCH_FIELDS:
6463
parser.add_option("", "--"+sfield, dest=sfield, default=None, help="search parameter: query string for "+sfield)
6564

@@ -73,7 +72,7 @@ def main(args):
7372
total = 0
7473
maxLimit = 50
7574
params = [ ('limit', opts.limit if opts.limit < maxLimit else maxLimit),
76-
('public', 0 if opts.status == 'private' else 1) ]
75+
('public', 'yes' if opts.public or (not token) else 'no') ]
7776
if opts.index:
7877
params.append( ('index', opts.index) )
7978
for sfield in SEARCH_FIELDS:

0 commit comments

Comments
 (0)