Skip to content

Commit

Permalink
chore: removed TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
d4rkr00t committed Mar 11, 2021
1 parent 63b70a0 commit 93e08a7
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ export default async function opaline(
return help({
helpFormatter,
config,
commandName: "index"
commandName: "index",
});
} else if (isCommand && hasCommand(commandName)) {
return help({
helpFormatter,
config,
commandName
commandName,
});
} else if (isCommand && !hasCommand(commandName)) {
return error(
Expand All @@ -70,7 +70,7 @@ export default async function opaline(
commandName,
config,
argv,
isCommand
isCommand,
});
}

Expand All @@ -82,13 +82,13 @@ export default async function opaline(
commandName: "index",
config,
argv,
isCommand
isCommand,
});
} else {
return help({
helpFormatter,
config,
commandName: ""
commandName: "",
});
}
}
Expand All @@ -101,13 +101,13 @@ export default async function opaline(
commandName: "index",
config,
argv,
isCommand
isCommand,
});
} else {
return help({
helpFormatter,
config,
commandName: ""
commandName: "",
});
}
}
Expand All @@ -117,7 +117,7 @@ async function run({
config,
commandName,
argv,
isCommand
isCommand,
}: {
config: OpalineConfig;
commandName: string;
Expand All @@ -133,7 +133,7 @@ async function run({
);
let inputs =
isCommand && commandName !== "index" ? rawInputs.slice(1) : rawInputs;
let args = Object.keys(command.meta.options || {}).map(opt => flags[opt]);
let args = Object.keys(command.meta.options || {}).map((opt) => flags[opt]);

try {
await command
Expand Down Expand Up @@ -163,7 +163,7 @@ function error(msg: string) {
function help({
helpFormatter,
config,
commandName
commandName,
}: {
helpFormatter: any;
config: OpalineConfig;
Expand All @@ -172,10 +172,7 @@ function help({
helpCommand({
helpFormatter,
config,
commandName
commandName,
});
process.exit(0);
}

// TODO: logging
// TODO: command aliases

0 comments on commit 93e08a7

Please sign in to comment.