Skip to content

Commit

Permalink
feat: add commands to index
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-bisonai committed Dec 8, 2023
1 parent 256e5fa commit a949c67
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
11 changes: 8 additions & 3 deletions cli/src/datafeed.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { command, option, string as cmdstring } from 'cmd-ts'
import { command, option, string as cmdstring, subcommands } from 'cmd-ts'
import { insertHandler as adapterInsertHandler } from './adapter'
import { insertHandler as aggregatorInsertHandler } from './aggregator'
import { ReadFile } from './cli-types'
Expand Down Expand Up @@ -36,7 +36,7 @@ export function datafeedSub() {
// datafeed bulk-insert --source ${source}
// datafeed bulk-activate --source ${source}

const bulkInsert = command({
const insert = command({
name: 'bulk-insert',
args: {
data: option({
Expand All @@ -51,7 +51,7 @@ export function datafeedSub() {
handler: bulkInsertHandler()
})

const bulkActivate = command({
const activate = command({
name: 'bulk-activate',
args: {
data: option({
Expand All @@ -65,6 +65,11 @@ export function datafeedSub() {
},
handler: bulkActivateHandler()
})

return subcommands({
name: 'adapter',
cmds: { insert, activate }
})
}

export function bulkInsertHandler() {
Expand Down
5 changes: 4 additions & 1 deletion cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { binary, command, run, subcommands } from 'cmd-ts'
import { adapterSub } from './adapter'
import { aggregatorSub } from './aggregator'
import { chainSub } from './chain'
import { datafeedSub } from './datafeed'
import { delegatorSub } from './delegator'
import { fetcherSub } from './fetcher'
import { listenerSub } from './listener'
Expand All @@ -23,6 +24,7 @@ async function main() {
const reporter = reporterSub()
const delegator = delegatorSub()
const proxy = proxySub()
const datafeed = datafeedSub()

const version = command({
name: 'version',
Expand All @@ -45,7 +47,8 @@ async function main() {
reporter,
version,
delegator,
proxy
proxy,
datafeed
}
})

Expand Down

0 comments on commit a949c67

Please sign in to comment.