@oada/cli
Version:
CLI OADA client
30 lines • 967 B
JavaScript
import { Flags } from '@oclif/core';
import Command from '../BaseCommand.js';
import { expandPath } from '../io.js';
import getConn from '../connections.js';
import { shell } from '../highlight.js';
const examples = [
shell `$ oada delete /bookmarks/foo`,
shell `$ oada rm /bookmarks/foo /bookmarks/bar /bookmarks/baz*`,
];
class Delete extends Command {
async run() {
const { argv: paths } = await this.parse(Delete);
const conn = getConn(this.iconfig);
for await (const p of paths) {
const pp = expandPath(conn, `${p}`);
for await (const path of pp) {
await conn.delete({ path });
}
}
}
}
Delete.description = 'perform an OADA DELETE';
Delete.aliases = ['d', 'rm', 'DELETE'];
Delete.examples = examples;
Delete.flags = {
recursive: Flags.boolean({ char: 'R', default: false }),
};
Delete.strict = false;
export default Delete;
//# sourceMappingURL=delete.js.map