This repository has been archived by the owner on Feb 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #909 from lightninglabs/remote-lnd
Enable users to connect to a remote lnd node.
- Loading branch information
Showing
4 changed files
with
42 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* Parse a list of CLI arguments searching for a target argument. | ||
* @param {string} target The target argument we're searching for. | ||
* @return {string|undefined} The target argument's value, or undefined. | ||
*/ | ||
module.exports.parseCliArg = function(target) { | ||
let regex = new RegExp('--' + target); | ||
let value; | ||
process.argv.filter(a => { | ||
if (regex.test(a)) { | ||
let split = a.split('='); | ||
if (split.length > 1) { | ||
value = split[1]; | ||
} | ||
} | ||
}); | ||
return value; | ||
}; |