File tree Expand file tree Collapse file tree 3 files changed +21
-4
lines changed
Expand file tree Collapse file tree 3 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -240,6 +240,12 @@ async fn main() -> Result<()> {
240240 . long ( "url" )
241241 . help ( "Print the underlying GoaT API URL(s). Useful for debugging." ) ,
242242 )
243+ . arg (
244+ Arg :: new ( "goat-ui-url" )
245+ . short ( 'U' )
246+ . long ( "goat-ui-url" )
247+ . help ( "Print the underlying GoaT UI URL(s). View on the browser!" ) ,
248+ )
243249 } ;
244250
245251 let assembly_search_and_count = |name, about| {
@@ -377,6 +383,12 @@ async fn main() -> Result<()> {
377383 . long ( "url" )
378384 . help ( "Print the underlying GoaT API URL(s). Useful for debugging." ) ,
379385 )
386+ . arg (
387+ Arg :: new ( "goat-ui-url" )
388+ . short ( 'U' )
389+ . long ( "goat-ui-url" )
390+ . help ( "Print the underlying GoaT UI URL(s). View on the browser!" ) ,
391+ )
380392 } ;
381393
382394 // actually parse the matches.
Original file line number Diff line number Diff line change @@ -18,8 +18,6 @@ pub struct Report {
1818 pub search : Vec < String > ,
1919 /// The rank of the return type.
2020 pub rank : String ,
21- ///
22- pub url : bool ,
2321}
2422
2523impl Report {
@@ -28,7 +26,6 @@ impl Report {
2826 // simply return the populated struct
2927 // taxon, url, rank
3028 let search_op = matches. value_of ( "taxon" ) ;
31- let url = matches. is_present ( "url" ) ;
3229 // safe to unwrap, as default is defined.
3330 let rank = matches. value_of ( "rank" ) . unwrap ( ) . to_string ( ) ;
3431
@@ -38,7 +35,7 @@ impl Report {
3835 None => bail ! ( "There was no taxon input." ) ,
3936 } ;
4037
41- Ok ( Self { search, rank, url } )
38+ Ok ( Self { search, rank } )
4239 }
4340
4441 /// Make the URL. Currently only [`RecordType::Newick`] supported.
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ pub fn process_cli_args(
3434) -> Result < ( u64 , Vec < String > , Vec < String > ) > {
3535 // command line args same between taxon/assembly
3636 let print_url = matches. is_present ( "url" ) ;
37+ let print_goat_ui_url = matches. is_present ( "goat-ui-url" ) ;
3738 let tax_tree_enum = match matches. is_present ( "descendents" ) {
3839 true => TaxType :: Tree ,
3940 false => TaxType :: Name ,
@@ -221,6 +222,13 @@ pub fn process_cli_args(
221222 println ! ( "{}.\t GoaT API URL: {}" , index, url) ;
222223 }
223224 std:: process:: exit ( 0 ) ;
225+ } else if print_goat_ui_url {
226+ for ( index, url) in url_vector_api. iter ( ) . enumerate ( ) {
227+ // remove api/v2/
228+ let new_url = url. replace ( "api/v2/" , "" ) ;
229+ println ! ( "{}.\t GoaT API URL: {}" , index, new_url) ;
230+ }
231+ std:: process:: exit ( 0 ) ;
224232 }
225233
226234 // return the url vector
You can’t perform that action at this time.
0 commit comments