Skip to content

Commit

Permalink
clean up backup schedule operations and flag-names
Browse files Browse the repository at this point in the history
  • Loading branch information
niristius committed Aug 15, 2024
1 parent e47afcc commit fb49dab
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
16 changes: 8 additions & 8 deletions src/commands/backup/schedule/delete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,26 @@ export class Delete extends DeleteBaseCommand<typeof Delete> {
static description = "Delete a backup schedule";
static resourceName = "backupSchedule";
static args = {
backupScheduleId: Args.string({
"backup-schedule-id": Args.string({
description: "ID of schedule to delete",
}),
};
static flags = {
...processFlags,
backupScheduleId: Flags.string({
"backup-schedule-id": Flags.string({
description: "ID of backup schedule to delete",
}),
};

protected async deleteResource(): Promise<void> {
// TODO: implement withBackupScheduleId()

const process = makeProcessRenderer(this.flags, "Updating backup schedule");

// TODO: implement withBackupScheduleId
let projectBackupScheduleId: string = "";
if (this.flags.backupScheduleId) {
projectBackupScheduleId = this.flags.backupScheduleId;
} else if (this.args.backupScheduleId) {
projectBackupScheduleId = this.args.backupScheduleId;
if (this.flags["backup-schedule-id"]) {
projectBackupScheduleId = this.flags["backup-schedule-id"];
} else if (this.args["backup-schedule-id"]) {
projectBackupScheduleId = this.args["backup-schedule-id"];
} else {
await process.error(
"Please provide a backup schedule id as flag or argument",
Expand Down
12 changes: 6 additions & 6 deletions src/commands/backup/schedule/update.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ export default class Create extends ExecRenderBaseCommand<
> {
static description = "Update an existing backup schedule";
static args = {
scheduleId: Args.string({
"backup-schedule-id": Args.string({
description: "Define the backup schedule that is to be updated",
}),
};
static flags = {
...processFlags,
scheduleId: Flags.string({
"backup-schedule-id": Flags.string({
description: "Define the backup schedule that is to be updated",
}),
description: Flags.string({
Expand All @@ -42,10 +42,10 @@ export default class Create extends ExecRenderBaseCommand<

// TODO: implement withBackupScheduleId()
let projectBackupScheduleId: string = "";
if (this.flags.scheduleId) {
projectBackupScheduleId = this.flags.scheduleId;
} else if (this.args.scheduleId) {
projectBackupScheduleId = this.args.scheduleId;
if (this.flags["backup-schedule-id"]) {
projectBackupScheduleId = this.flags["backup-schedule-id"];
} else if (this.args["backup-schedule-id"]) {
projectBackupScheduleId = this.args["backup-schedule-id"];
} else {
await process.error(
"Please provide a backup schedule id as flag or argument",
Expand Down

0 comments on commit fb49dab

Please sign in to comment.