Skip to content

Commit

Permalink
Minor code fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
siokas committed Apr 13, 2020
1 parent 0fff2e7 commit 361e45b
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 39 deletions.
4 changes: 2 additions & 2 deletions AppDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { AppDetailsAccessors } from "./interfaces.ts";
/**
* Accessors of the app name, description and version.
*
* @export default
* @export
* @class AppDetailAccessors
*/
export default class AppDetails implements AppDetailsAccessors {
export class AppDetails implements AppDetailsAccessors {
/**
* The name of the app.
*
Expand Down
4 changes: 2 additions & 2 deletions Command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { CommandOptions } from "./interfaces.ts";
/**
* Command class
*
* @export default
* @export
* @class Command
*/
export default class Command {
export class Command {
/**
* If the command has a required value
* to be passed from the user.
Expand Down
10 changes: 4 additions & 6 deletions Denomander.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,23 @@ import {
Parasable,
PublicAPI
} from "./interfaces.ts";
import AppDetails from "./AppDetails.ts";
import Command from "./Command.ts";
import { AppDetails } from "./AppDetails.ts";
import { Command } from "./Command.ts";
import {
findCommandFromArgs,
removeCommandFromArray,
isCommandInArgs,
isCommandFromArrayInArgs,
containCommandInOnCommandArray
} from "./helpers.ts";

/**
* The main class
*
* @export default
* @export
* @class Denomander
* @extends AppDetails
*/
export default class Denomander extends AppDetails
implements Parasable, PublicAPI {
export class Denomander extends AppDetails implements Parasable, PublicAPI {
/**
* Holds all the commands
*
Expand Down
41 changes: 23 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,30 +158,35 @@ program.parse(args);

## ToDo

- [X] program.on() method
- [ ] Custom option processing
- [X] Option to change default commands (help, version)
- [X] description(), action() methods
- [X] Multiple short flags (-abc)
- [ ] Long Flag alias
- [X] program.on() method
- [ ] Custom option processing
- [X] Option to change default commands (help, version)
- [X] description(), action() methods
- [X] Multiple short flags (-abc)
- [ ] Long Flag alias

## Used

- [Deno](https://deno.land)
- [Deno STD Libraries](https://deno.land/std/)
- [FlatIcon](https://www.flaticon.com/) for the logo
- [Deno](https://deno.land)
- [Deno STD Libraries](https://deno.land/std/)
- [FlatIcon](https://www.flaticon.com/) for the logo

## Release History

- [0.1.0](https://github.com/siokas/denomander/releases/tag/0.1.0)
- Initial Commit
- [0.2.0](https://github.com/siokas/denomander/releases/tag/0.2.0)
- Change Command of Default Options [help, version]
- Custom help and version (program.on() method)
- Add description() and action() methods for commands
- [0.3.0](https://github.com/siokas/denomander/releases/tag/0.3.0)
- Multiple short flags
- Comma and vertical bar separated options
- [0.1.0](https://github.com/siokas/denomander/releases/tag/0.1.0)
- Initial Commit
- [0.2.0](https://github.com/siokas/denomander/releases/tag/0.2.0)
- Change Command of Default Options [help, version]
- Custom help and version (program.on() method)
- Add description() and action() methods for commands
- [0.3.0](https://github.com/siokas/denomander/releases/tag/0.3.0)
- Multiple short flags
- Comma and vertical bar separated options
- [0.3.1](https://github.com/siokas/denomander/releases/tag/0.3.1)
- Add docblocks
- Extract some interfaces
- Fix some code readability errors
- Change internal exported classed to named from default (Only mod.ts file has the default export od Denomander class)


## Meta
Expand Down
2 changes: 1 addition & 1 deletion appDetails.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assertEquals, test } from "./deno_deps.ts";
import AppDetails from "./AppDetails.ts";
import { AppDetails } from "./AppDetails.ts";

test(function app_detail_accessors() {
const program = new AppDetails();
Expand Down
8 changes: 4 additions & 4 deletions command.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { assertEquals, test } from "./deno_deps.ts";
import Command from "./Command.ts";
import { Command } from "./Command.ts";

test(function command_option() {
let option = new Command({
const option = new Command({
value: "-h --help",
description: "Print command line options (currently set)",
});
Expand All @@ -17,7 +17,7 @@ test(function command_option() {
});

test(function command_required_option() {
let required_option = new Command(
const required_option = new Command(
{
value: "-p --port",
description: "Define Port Number",
Expand All @@ -35,7 +35,7 @@ test(function command_required_option() {
});

test(function command_command() {
let command = new Command({
const command = new Command({
value: "new [name]",
description: "Create a new file",
is_required: false,
Expand Down
2 changes: 1 addition & 1 deletion denomander.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assertEquals, assertThrows, test } from "./deno_deps.ts";
import Denomander from "./Denomander.ts";
import { Denomander } from "./Denomander.ts";

test(function app_option() {
const program = new Denomander();
Expand Down
2 changes: 1 addition & 1 deletion helpers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
containCommandInOnCommandArray,
trimString
} from "./helpers.ts";
import Command from "./Command.ts";
import { Command } from "./Command.ts";
import { OnCommand } from "./interfaces.ts";

test(function strip_dashes() {
Expand Down
2 changes: 1 addition & 1 deletion helpers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Command from "./Command.ts";
import { Command } from "./Command.ts";
import { OnCommand } from "./interfaces.ts";

/**
Expand Down
4 changes: 2 additions & 2 deletions interfaces.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Command from "./Command.ts";
import Denomander from "./Denomander.ts";
import { Command } from "./Command.ts";
import { Denomander } from "./Denomander.ts";

export interface PublicAPI {
option(value: string, description: string): Denomander;
Expand Down
2 changes: 1 addition & 1 deletion mod.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import Denomander from "./Denomander.ts";
import { Denomander } from "./Denomander.ts";

export default Denomander;

0 comments on commit 361e45b

Please sign in to comment.