From 3fa84fce114562907f90f4c0b227813a9361fff5 Mon Sep 17 00:00:00 2001 From: Andrei Regiani Date: Tue, 7 Jan 2025 19:52:44 +0300 Subject: [PATCH] list->data --- cmd/{list.js => data.js} | 12 ++++++------ cmd/index.js | 13 ++++++------- gui/preload.js | 2 +- subsystems/sidecar/index.js | 4 ++-- subsystems/sidecar/ops/{list.js => data.js} | 0 5 files changed, 15 insertions(+), 16 deletions(-) rename cmd/{list.js => data.js} (56%) rename subsystems/sidecar/ops/{list.js => data.js} (100%) diff --git a/cmd/list.js b/cmd/data.js similarity index 56% rename from cmd/list.js rename to cmd/data.js index 337a8a6cd..e1fbe8705 100644 --- a/cmd/list.js +++ b/cmd/data.js @@ -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) } diff --git a/cmd/index.js b/cmd/index.js index 5bf55d888..1cf684ac3 100644 --- a/cmd/index.js +++ b/cmd/index.js @@ -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)) => { @@ -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) => { @@ -205,7 +204,7 @@ module.exports = async (ipc, argv = Bare.argv.slice(1)) => { sidecar, gc, versions, - list, + data, help, footer(usage.footer), bail(explain), diff --git a/gui/preload.js b/gui/preload.js index f0a9f1289..00b22ea1f 100644 --- a/gui/preload.js +++ b/gui/preload.js @@ -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) } diff --git a/subsystems/sidecar/index.js b/subsystems/sidecar/index.js index 0beef3f77..f632d8a84 100644 --- a/subsystems/sidecar/index.js +++ b/subsystems/sidecar/index.js @@ -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 @@ -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) } diff --git a/subsystems/sidecar/ops/list.js b/subsystems/sidecar/ops/data.js similarity index 100% rename from subsystems/sidecar/ops/list.js rename to subsystems/sidecar/ops/data.js