|
|
|
@ -2,6 +2,13 @@ import { ref } from 'vue'
|
|
|
|
|
import type { SimpleCommand, Uri } from './Config'
|
|
|
|
|
import { useRouter } from 'vitepress'
|
|
|
|
|
|
|
|
|
|
const SHELL = 'k0rSH'
|
|
|
|
|
const VERSION = '0.5'
|
|
|
|
|
const AUTHOR = 'k0r'
|
|
|
|
|
const DESCRIPTION = 'the k0r SHell'
|
|
|
|
|
const URL = 'https://git.k0r.in/n/k0r.386'
|
|
|
|
|
const ISSUES = 'https://git.k0r.in/n/k0r.386/issues'
|
|
|
|
|
|
|
|
|
|
type VitePressPage = {
|
|
|
|
|
frontmatter: Record<string, string>
|
|
|
|
|
src: string
|
|
|
|
@ -47,8 +54,7 @@ export default function useTerminal(inputEl: HTMLTextAreaElement, commands: Simp
|
|
|
|
|
|
|
|
|
|
type SYS_OUT = 'NOT_FOUND' | 'USAGE' | 'INFO' | '404'
|
|
|
|
|
|
|
|
|
|
const SHELL = 'k0rSH'
|
|
|
|
|
const INFO = 'k0rSH v0.1: the k0r SHell, fiddled together by k0r -- https://k0r.in'
|
|
|
|
|
const INFO = `${SHELL} v${VERSION}: ${DESCRIPTION}, fiddled together by ${AUTHOR} -- ${URL}`
|
|
|
|
|
const PAD = 16
|
|
|
|
|
const USAGE = [
|
|
|
|
|
...commands.map(cmd => {
|
|
|
|
@ -74,7 +80,12 @@ export default function useTerminal(inputEl: HTMLTextAreaElement, commands: Simp
|
|
|
|
|
break
|
|
|
|
|
case 'INFO':
|
|
|
|
|
console.log('explaining myself')
|
|
|
|
|
addLine(`${SHELL}: ${INFO}`)
|
|
|
|
|
addLine(INFO)
|
|
|
|
|
setFooter([{
|
|
|
|
|
label: 'source code', uri: URL
|
|
|
|
|
}, {
|
|
|
|
|
label: 'issue tracker', uri: ISSUES
|
|
|
|
|
}])
|
|
|
|
|
break
|
|
|
|
|
case '404':
|
|
|
|
|
console.log('page not found', arg)
|
|
|
|
|