Skip to content

Commit

Permalink
fix: remove ancient pretty printers for ancient usage model
Browse files Browse the repository at this point in the history
BREAKING CHANGE: this removes some of the exported pretty printers from kui-shell/core
  • Loading branch information
starpit committed Sep 7, 2022
1 parent 5c0fe58 commit 364456c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 145 deletions.
95 changes: 0 additions & 95 deletions packages/core/src/core/usage/pretty-code.ts

This file was deleted.

35 changes: 0 additions & 35 deletions packages/core/src/core/usage/render-usage.ts

This file was deleted.

3 changes: 0 additions & 3 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@ export { isUsageError, UsageError, UsageModel, UsageRow } from './core/usage-err
export { isMessageWithUsageModel, isMessageWithCode } from './core/usage-error'

// ascii usage
export { default as renderUsage } from './core/usage/render-usage'
export { default as PrettyUsageModel } from './core/usage/types'
import * as pc from './core/usage/pretty-code'
export { pc }

// eventChannelUnsafe
export * from './api'
Expand Down
17 changes: 5 additions & 12 deletions plugins/plugin-s3/src/browse/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,16 @@
* limitations under the License.
*/

import { Arguments, PrettyUsageModel, Registrar, encodeComponent, renderUsage } from '@kui-shell/core'

import * as Usage from './usage'
import { Arguments, Registrar, encodeComponent } from '@kui-shell/core'

const opts = { needsUI: true, width: 720, height: 900 }

function doBrowse(this: string, usage: PrettyUsageModel, { REPL, parsedOptions }: Arguments) {
if (parsedOptions.h || parsedOptions.help) {
return renderUsage(usage)
}

function doBrowse(this: string, { REPL }: Arguments) {
return REPL.qexec(`ls ${encodeComponent(this)}`)
}

export default async function(registrar: Registrar) {
registrar.listen('/browse', renderUsage.bind(undefined, Usage.browse))
registrar.listen('/browse/s3', doBrowse.bind('/s3', Usage.s3), opts)
registrar.listen('/browse/cc', doBrowse.bind('/s3/aws/commoncrawl', Usage.cc('cc')), opts)
registrar.listen('/browse/commoncrawl', doBrowse.bind('/s3/aws/commoncrawl', Usage.cc('commoncrawl')), opts)
registrar.listen('/browse/s3', doBrowse.bind('/s3'), opts)
registrar.listen('/browse/cc', doBrowse.bind('/s3/aws/commoncrawl'), opts)
registrar.listen('/browse/commoncrawl', doBrowse.bind('/s3/aws/commoncrawl'), opts)
}

0 comments on commit 364456c

Please sign in to comment.