Skip to content

Commit 9cb0fe5

Browse files
committed
fix: yargs usage
1 parent 8c392bc commit 9cb0fe5

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/app.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { hideBin } from 'yargs/helpers';
12
import yargs from 'yargs';
23

34
// eslint-disable-next-line import/extensions
@@ -22,15 +23,12 @@ function isValidLogLevel(debug?: string): debug is LogLevel | undefined {
2223
}
2324

2425
(async () => {
25-
// kinda ugly workaround for yargs
26-
const myYargs = (await yargs()) as unknown as typeof yargs;
27-
2826
const logger = new ConsoleLogger(
2927
(isValidLogLevel(process.env.DEBUG) && process.env.DEBUG) ||
3028
(process.env.NODE_ENV === 'development' ? LogLevel.Debug : LogLevel.Log)
3129
);
3230

33-
const { argv } = myYargs
31+
const { argv } = yargs(hideBin(process.argv))
3432
.usage('NODE RADIUS Server\nUsage: radius-server')
3533
.example('radius-server --port 1812 -s radiussecret', 'start on port 1812 with a secret')
3634
.default({

0 commit comments

Comments
 (0)