forked from coolaj86/walnut.js
		
	add another option
This commit is contained in:
		
							parent
							
								
									3de6e4843d
								
							
						
					
					
						commit
						7d899a7f04
					
				| @ -14,7 +14,7 @@ cli.parse({ | ||||
| , insecure: [ false, '(deprecated) allow insecure non-https connections', 'boolean' ] | ||||
| , cacert: [ false, '(not implemented) specify a CA for "self-signed" https certificates', 'string' ] | ||||
| , answer: [ 'a', 'The answer', 'string' ] | ||||
| , token: [ false, 'Token', 'string' ] | ||||
| , token: [ false, 'Token (TODO or filepath to token)', 'string' ] | ||||
| }); | ||||
| 
 | ||||
| cli.main(function (args, options) { | ||||
| @ -23,8 +23,9 @@ cli.main(function (args, options) { | ||||
|   options.answer = options.answer || args[1] | ||||
| 
 | ||||
|   if (options.insecure) { | ||||
|     console.error('--insecure is not supported. You must use secure connections.'); | ||||
|     return; | ||||
|     //console.error('--insecure is not supported. You must use secure connections.');
 | ||||
|     //return;
 | ||||
|     options.cacert = false; | ||||
|   } | ||||
| 
 | ||||
|   if (!options.hostname) { | ||||
| @ -42,6 +43,7 @@ cli.main(function (args, options) { | ||||
|     updater: options.service | ||||
|   , port: options.port | ||||
|   , cacert: options.cacert | ||||
|   , token: options.token | ||||
|   , ddns: [ | ||||
|       { "name": options.hostname | ||||
|       , "value": options.answer | ||||
| @ -52,7 +54,11 @@ cli.main(function (args, options) { | ||||
|     ] | ||||
|   }).then(function (data) { | ||||
|     if ('string') { | ||||
|       try { | ||||
|         data = JSON.parse(data); | ||||
|       } catch(e) { | ||||
|         console.error(data); | ||||
|       } | ||||
|     } | ||||
| 
 | ||||
|     console.log(JSON.stringify(data, null, '  ')); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user