Skip to content

Commit

Permalink
Replace optimist dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Supereg committed Sep 19, 2022
1 parent 390f30d commit c7d406d
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 65 deletions.
5 changes: 3 additions & 2 deletions bin/dbus-dissect.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
const net = require('net');
const abs = require('abstract-socket');
const through2 = require('through2');
const optimist = require('optimist');
const minimist = require('minimist');
const message = require('../lib/message');
const readLine = require('../lib/readline');

var sessionBusAddress = process.env.DBUS_SESSION_BUS_ADDRESS;
var m = sessionBusAddress.match(/abstract=([^,]+)/);

var isSystemBus = optimist.boolean(['system']).argv.system;
var isSystemBus = minimist(process.argv.slice(2), { boolean: 'system' }).system;
console.log(isSystemBus);

var address = isSystemBus ? '/var/run/dbus/system_bus_socket' : `\0${m[1]}`;

Expand Down
7 changes: 5 additions & 2 deletions bin/dbus2js.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ const xml2js_opts = Object.assign({}, xml2js.defaults['0.1'], {
explicitArray: true
});
const dbus = require('../index');
const optimist = require('optimist');
const minimist = require('minimist');

var argv = optimist.boolean(['server', 'dump']).argv;
var argv = minimist(process.argv.slice(2), {
boolean: ['server', 'dump', 'xml'],
string: ['bus', 'service', 'path']
});

function die(err) {
console.log(err);
Expand Down
86 changes: 27 additions & 59 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
"@homebridge/long": "^5.2.1",
"event-stream": "^4.0.0",
"hexy": "^0.2.10",
"optimist": "^0.6.1",
"@homebridge/put": "0.0.7",
"minimist": "^1.2.6",
"@homebridge/put": "~0.0.8",
"safe-buffer": "^5.1.1",
"xml2js": "^0.4.17"
},
Expand All @@ -52,6 +52,7 @@
}
},
"devDependencies": {
"@types/minimist": "^1.2.2",
"eslint": "^6.0.0",
"eslint-config-prettier": "^3.0.0",
"eslint-plugin-markdown": "^3.0.0",
Expand Down

0 comments on commit c7d406d

Please sign in to comment.