-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d8ee652
commit 3793638
Showing
12 changed files
with
170 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
import { createApp } from 'vue' | ||
import App from './App.vue' | ||
|
||
const font = new FontFace('Anonymous Pro', 'url(./fonts/Anonymous_Pro-Regular.ttf)') | ||
document.fonts.add(font); | ||
|
||
createApp(App).mount('#app') | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import {Command, CommandResponse} from "@/scripts/command"; | ||
import {CommandInterface} from "@/scripts/parser"; | ||
import {getHelpMessage} from "@/scripts/commands/export"; | ||
import {commands} from "@/scripts/commands/export"; | ||
|
||
export class Help implements Command { | ||
name = 'help'; | ||
description = "Help Command" | ||
argumentDescription = [ | ||
{ | ||
key: "command", | ||
keyDescription: "Command to get help for." | ||
} | ||
] | ||
|
||
|
||
constructor(public command:CommandInterface) {} | ||
|
||
|
||
getCommands(){ | ||
console.log(commands); | ||
const commandNames: Array<string> = []; | ||
for(let i = 0; i < commands.length; i++) { | ||
commandNames.push(commands[i].name); | ||
} | ||
return commandNames; | ||
} | ||
|
||
|
||
async execute(): Promise<CommandResponse> { | ||
|
||
if(this.command.arguments?.length !== 0){ | ||
const message = getHelpMessage(this.command.argumentsAsString as string); | ||
return{ | ||
command: this.command.command, | ||
fullCommand: this.command.fullCommand, | ||
returnValue: { | ||
type: 'success', | ||
furtherDetails: `Help command for ${this.command}` | ||
}, | ||
output: message, | ||
showAsRawHTML: false | ||
} | ||
} else { | ||
let commandsString = `List of commands: \n`; | ||
const commandsArray = this.getCommands(); | ||
console.log(commandsArray); | ||
commandsArray.forEach(cmd => { | ||
commandsString += `<span style="font-size: 20px"><em>${cmd}</em>\n</span>`; | ||
}); | ||
|
||
return{ | ||
command: this.command.command, | ||
fullCommand: this.command.fullCommand, | ||
returnValue: { | ||
type: 'success', | ||
furtherDetails: `List commands` | ||
}, | ||
showAsRawHTML: true, | ||
output: commandsString, | ||
} | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters