Skip to content

Commit c8d9dba

Browse files
committed
ls command implemented
1 parent 1e899aa commit c8d9dba

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module.exports = {
1919
},
2020

2121
getProxyList : function() {
22-
return this.configObj.proxies.keys();
22+
return Object.keys(this.configObj.proxies);
2323
},
2424

2525
setProxy : function(name, object) {

index.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,18 @@ loadConfig();
77
program
88
.version('0.0.1');
99

10+
/**
11+
* List all the proxies available
12+
*/
13+
program
14+
.command('ls')
15+
.description('List proxies')
16+
.action(function() {
17+
for (var i = 0; i < config.getProxyList().length; i++) {
18+
console.log(config.getProxyList()[i]);
19+
}
20+
});
21+
1022
/**
1123
* Add a new proxy by giving a name
1224
*/

0 commit comments

Comments
 (0)