|
14 | 14 | * limitations under the License. |
15 | 15 | */ |
16 | 16 |
|
17 | | -import { Arguments, PrettyUsageModel, Registrar, encodeComponent, renderUsage } from '@kui-shell/core' |
18 | | - |
19 | | -import * as Usage from './usage' |
| 17 | +import { Arguments, Registrar, encodeComponent } from '@kui-shell/core' |
20 | 18 |
|
21 | 19 | const opts = { needsUI: true, width: 720, height: 900 } |
22 | 20 |
|
23 | | -function doBrowse(this: string, usage: PrettyUsageModel, { REPL, parsedOptions }: Arguments) { |
24 | | - if (parsedOptions.h || parsedOptions.help) { |
25 | | - return renderUsage(usage) |
26 | | - } |
27 | | - |
| 21 | +function doBrowse(this: string, { REPL }: Arguments) { |
28 | 22 | return REPL.qexec(`ls ${encodeComponent(this)}`) |
29 | 23 | } |
30 | 24 |
|
31 | 25 | export default async function(registrar: Registrar) { |
32 | | - registrar.listen('/browse', renderUsage.bind(undefined, Usage.browse)) |
33 | | - registrar.listen('/browse/s3', doBrowse.bind('/s3', Usage.s3), opts) |
34 | | - registrar.listen('/browse/cc', doBrowse.bind('/s3/aws/commoncrawl', Usage.cc('cc')), opts) |
35 | | - registrar.listen('/browse/commoncrawl', doBrowse.bind('/s3/aws/commoncrawl', Usage.cc('commoncrawl')), opts) |
| 26 | + registrar.listen('/browse/s3', doBrowse.bind('/s3'), opts) |
| 27 | + registrar.listen('/browse/cc', doBrowse.bind('/s3/aws/commoncrawl'), opts) |
| 28 | + registrar.listen('/browse/commoncrawl', doBrowse.bind('/s3/aws/commoncrawl'), opts) |
36 | 29 | } |
0 commit comments