Skip to content

Commit

Permalink
list->data
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiRegiani committed Jan 7, 2025
1 parent e36dee1 commit 3fa84fc
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 16 deletions.
12 changes: 6 additions & 6 deletions cmd/list.js → cmd/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ const bundles = (items) => {

const all = (items) => bundles(items)

const output = outputter('list', {
const output = outputter('data', {
bundles,
all,
error: (err) => `List Error (code: ${err.code || 'none'}) ${err.stack}`,
error: (err) => `Data Error (code: ${err.code || 'none'}) ${err.stack}`,
final: () => false
})

module.exports = (ipc) => async function list (cmd) {
const data = await ipc.list({ bundles: cmd.flags.bundles })
module.exports = (ipc) => async function data (cmd) {
const result = await ipc.data({ bundles: cmd.flags.bundles })
if (cmd.flags.bundles) {
return await output(false, data, { tag: 'bundles' }, ipc)
return await output(false, result, { tag: 'bundles' }, ipc)
}
return await output(false, data, { tag: 'all' }, ipc)
return await output(false, result, { tag: 'all' }, ipc)
}
13 changes: 6 additions & 7 deletions cmd/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const runners = {
gc: require('./gc'),
run: require('./run'),
versions: require('./versions'),
list: require('./list')
data: require('./data')
}

module.exports = async (ipc, argv = Bare.argv.slice(1)) => {
Expand Down Expand Up @@ -177,11 +177,10 @@ module.exports = async (ipc, argv = Bare.argv.slice(1)) => {
runners.versions(ipc)
)

const list = command(
'list',
summary('View local database contents'),
flag('--bundles', 'View only the Bundle collection'),
runners.list(ipc)
const data = command(
'data',
summary('View local content'),
runners.data(ipc)
)

const help = command('help', arg('[command]'), summary('View help for command'), (h) => {
Expand All @@ -205,7 +204,7 @@ module.exports = async (ipc, argv = Bare.argv.slice(1)) => {
sidecar,
gc,
versions,
list,
data,
help,
footer(usage.footer),
bail(explain),
Expand Down
2 changes: 1 addition & 1 deletion gui/preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ class IPC {
message (...args) { return electron.ipcRenderer.invoke('message', ...args) }
checkpoint (...args) { return electron.ipcRenderer.invoke('checkpoint', ...args) }
versions (...args) { return electron.ipcRenderer.invoke('versions', ...args) }
list (...args) { return electron.ipcRenderer.invoke('list', ...args) }
data (...args) { return electron.ipcRenderer.invoke('data', ...args) }
restart (...args) { return electron.ipcRenderer.invoke('restart', ...args) }
badge (...args) { return electron.ipcRenderer.invoke('badge', ...args) }

Expand Down
4 changes: 2 additions & 2 deletions subsystems/sidecar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const ops = {
Info: require('./ops/info'),
Shift: require('./ops/shift'),
Touch: require('./ops/touch'),
List: require('./ops/list')
Data: require('./ops/data')
}

// ensure that we are registered as a link handler
Expand Down Expand Up @@ -356,7 +356,7 @@ class Sidecar extends ReadyResource {

info (params, client) { return new ops.Info(params, client, this) }

list (params, client) { return new ops.List(params, client, this) }
data (params, client) { return new ops.Data(params, client, this) }

shift (params, client) { return new ops.Shift(params, client, this) }

Expand Down
File renamed without changes.

0 comments on commit 3fa84fc

Please sign in to comment.