-rw-r--r-- | test/idiscover.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/idiscover.cc b/test/idiscover.cc index 05cbcae..873da12 100644 --- a/test/idiscover.cc +++ b/test/idiscover.cc | |||
@@ -15,36 +15,38 @@ template<typename _PDT> | |||
15 | } | 15 | } |
16 | 16 | ||
17 | ostream& operator<<(ostream& o,const opkele::xrd::service_t s) { | 17 | ostream& operator<<(ostream& o,const opkele::xrd::service_t s) { |
18 | o << "{" << endl | 18 | o << "{" << endl |
19 | << " Type: "; | 19 | << " Type: "; |
20 | copy(s.types.begin(),s.types.end(), | 20 | copy(s.types.begin(),s.types.end(), |
21 | ostream_iterator<string>(o," ")); | 21 | ostream_iterator<string>(o," ")); |
22 | o << endl | 22 | o << endl |
23 | << " URI: " << s.uris << endl | 23 | << " URI: " << s.uris << endl |
24 | << " LocalID: " << s.local_ids << endl; | 24 | << " LocalID: " << s.local_ids << endl; |
25 | o << "}"; | 25 | o << "}"; |
26 | } | 26 | } |
27 | 27 | ||
28 | int main(int argc,char **argv) { | 28 | int main(int argc,char **argv) { |
29 | try { | 29 | try { |
30 | if(argc<2) | 30 | if(argc<2) |
31 | throw opkele::exception(OPKELE_CP_ "Please, give me something to resolve"); | 31 | throw opkele::exception(OPKELE_CP_ "Please, give me something to resolve"); |
32 | for(int a=1;a<argc;++a) { | 32 | for(int a=1;a<argc;++a) { |
33 | opkele::idiscovery_t discovery(argv[a]); | 33 | opkele::idiscovery_t discovery(argv[a]); |
34 | clog | 34 | clog |
35 | << "===============================================================" << endl | 35 | << "===============================================================" << endl |
36 | << "User-supplied ID: " << argv[a] << endl | 36 | << "User-supplied ID: " << argv[a] << endl |
37 | << "Normalized ID: " << discovery.normalized_id << endl | 37 | << "Normalized ID: " << discovery.normalized_id << endl |
38 | << "Canonicalized ID: " << discovery.canonicalized_id << endl | 38 | << "Canonicalized ID: " << discovery.canonicalized_id << endl |
39 | << "The identity is " << (discovery.xri_identity?"":"not ") << "an i-name" << endl | 39 | << "The identity is " << (discovery.xri_identity?"":"not ") << "an i-name" << endl; |
40 | << endl | 40 | if(discovery.xrd.expires) |
41 | clog << "Information expires in " << discovery.xrd.expires-time(0) << " seconds" << endl; | ||
42 | clog << endl | ||
41 | << "CanonicalID: " << discovery.xrd.canonical_ids << endl | 43 | << "CanonicalID: " << discovery.xrd.canonical_ids << endl |
42 | << "LocalID: " << discovery.xrd.local_ids << endl | 44 | << "LocalID: " << discovery.xrd.local_ids << endl |
43 | << "Services: " << discovery.xrd.services << endl; | 45 | << "Services: " << discovery.xrd.services << endl; |
44 | } | 46 | } |
45 | }catch(exception& e) { | 47 | }catch(exception& e) { |
46 | cerr << "oops: " << e.what() << endl; | 48 | cerr << "oops: " << e.what() << endl; |
47 | _exit(1); | 49 | _exit(1); |
48 | } | 50 | } |
49 | _exit(0); | 51 | _exit(0); |
50 | } | 52 | } |