@@ -160,6 +160,41 @@ exports.init = function (cli) {
160160
161161 } ,
162162
163+ domainRecords . showCommand = function ( recordid , name , options , _ ) {
164+ recordid = cli . interaction . promptIfNotGiven ( $ ( 'Record ID: ' ) , recordid , _ ) ;
165+
166+ var context = {
167+ subscription : profile . current . getSubscription ( options . subscription ) . id ,
168+ domain : {
169+ name : name
170+ } ,
171+ record : {
172+ id : recordid
173+ }
174+ } ;
175+
176+ domain . lookupDomainName ( context , _ ) ;
177+
178+ var record = domain . doRecordGet ( context , _ ) ;
179+
180+ var format = [
181+ [ $ ( 'Id' ) , 'id' ] ,
182+ [ $ ( 'Name' ) , null , function ( value ) {
183+ if ( value . name ) {
184+ return value . name ;
185+ }
186+ return context . domain . name ;
187+ } ] ,
188+ [ $ ( 'Type' ) , 'record_type' ] ,
189+ [ $ ( 'TTL' ) , 'ttl' ] ,
190+ [ $ ( 'Content' ) , 'content' ] ,
191+ [ $ ( 'Priority' ) , 'prio' ] ,
192+ ] ;
193+
194+ log . report ( format , record ) ;
195+
196+ } ,
197+
163198 domainRecords . command ( 'list [name]' )
164199 . usage ( '[options] [name]' )
165200 . description ( $ ( 'Show your domain dns records' ) )
@@ -178,4 +213,10 @@ exports.init = function (cli) {
178213 . option ( '-p --priority <priority>' , $ ( 'Record Priority.' ) )
179214 . execute ( domainRecords . addCommand ) ;
180215
216+ domainRecords . command ( 'show [recordid] [name]' )
217+ . usage ( '[options] <recordid> [name]' )
218+ . description ( $ ( 'Show a dns record for a domain' ) )
219+ . option ( '-i --id <recordid>' , $ ( 'The record id. Use dnsimple domain record list [domain] to see dns records and ids.' ) )
220+ . execute ( domainRecords . showCommand ) ;
221+
181222} ;
0 commit comments