Skip to content

Commit fda4bd0

Browse files
designcodeclaude
andauthored
fix: restore --force flag and remove -f alias from --format (#54)
* fix: restore --force flag on destructive commands and remove -f alias from --format The previous refactor (auto-inject global arguments) silently changed the meaning of -f from --force to --format on rm/mv commands. This restores --force/-f on rm and mv (supporting the -rf convention), adds --force (without -f alias) back to buckets delete, objects delete, access-keys delete, iam policies delete, iam users remove, and iam users revoke-invitation for backwards compatibility, and removes -f as an alias for --format globally. Also excludes auto-generated command-registry.ts from eslint. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * ci: enable workflow_dispatch for integration tests Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7f17153 commit fda4bd0

13 files changed

Lines changed: 83 additions & 58 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
push:
99
branches:
1010
- main
11+
workflow_dispatch:
1112

1213
jobs:
1314
build:
@@ -28,7 +29,7 @@ jobs:
2829

2930
integration:
3031
runs-on: ubuntu-latest
31-
if: github.event_name == 'push'
32+
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
3233
steps:
3334
- uses: actions/checkout@v4
3435
with:

eslint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ export default tseslint.config(
2424
},
2525
},
2626
{
27-
ignores: ["dist/", "node_modules/", "**/*.cjs"],
27+
ignores: ["dist/", "node_modules/", "**/*.cjs", "src/command-registry.ts"],
2828
},
2929
);

src/lib/access-keys/delete.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default async function remove(options: Record<string, unknown>) {
1313
const format = getFormat(options);
1414

1515
const id = getOption<string>(options, ['id']);
16-
const force = getOption<boolean>(options, ['yes', 'y']);
16+
const force = getOption<boolean>(options, ['yes', 'y', 'force']);
1717

1818
if (!id) {
1919
failWithError(context, 'Access key ID is required');

src/lib/buckets/delete.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default async function deleteBucket(options: Record<string, unknown>) {
2323
const format = getFormat(options);
2424

2525
const names = getOption<string | string[]>(options, ['name']);
26-
const force = getOption<boolean>(options, ['yes', 'y']);
26+
const force = getOption<boolean>(options, ['yes', 'y', 'force']);
2727

2828
if (!names) {
2929
failWithError(context, 'Bucket name is required');

src/lib/iam/policies/delete.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default async function del(options: Record<string, unknown>) {
1515
const format = getFormat(options);
1616

1717
let resource = getOption<string>(options, ['resource']);
18-
const force = getOption<boolean>(options, ['yes', 'y']);
18+
const force = getOption<boolean>(options, ['yes', 'y', 'force']);
1919

2020
const iamConfig = await getOAuthIAMConfig(context);
2121

src/lib/iam/users/remove.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default async function removeUser(options: Record<string, unknown>) {
1515
const format = getFormat(options);
1616

1717
const resourceOption = getOption<string | string[]>(options, ['resource']);
18-
const force = getOption<boolean>(options, ['yes', 'y']);
18+
const force = getOption<boolean>(options, ['yes', 'y', 'force']);
1919

2020
if (isFlyOrganization()) return;
2121

src/lib/iam/users/revoke-invitation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default async function revokeInvitation(
1717
const format = getFormat(options);
1818

1919
const resourceOption = getOption<string | string[]>(options, ['resource']);
20-
const force = getOption<boolean>(options, ['yes', 'y']);
20+
const force = getOption<boolean>(options, ['yes', 'y', 'force']);
2121

2222
if (isFlyOrganization()) return;
2323

src/lib/mv.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ let _jsonMode = false;
1919
export default async function mv(options: Record<string, unknown>) {
2020
const src = getOption<string>(options, ['src']);
2121
const dest = getOption<string>(options, ['dest']);
22-
const force = getOption<boolean>(options, ['yes', 'y']);
22+
const force = getOption<boolean>(options, ['yes', 'y', 'force', 'f']);
2323
const recursive = !!getOption<boolean>(options, ['recursive', 'r']);
2424
const format = getFormat(options);
2525
_jsonMode = format === 'json';

src/lib/objects/delete.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default async function deleteObject(options: Record<string, unknown>) {
2424

2525
const bucket = getOption<string>(options, ['bucket']);
2626
const keys = getOption<string | string[]>(options, ['key']);
27-
const force = getOption<boolean>(options, ['yes', 'y']);
27+
const force = getOption<boolean>(options, ['yes', 'y', 'force']);
2828

2929
if (!bucket) {
3030
failWithError(context, 'Bucket name is required');

src/lib/rm.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ let _jsonMode = false;
1616

1717
export default async function rm(options: Record<string, unknown>) {
1818
const pathString = getOption<string>(options, ['path']);
19-
const force = getOption<boolean>(options, ['yes', 'y']);
19+
const force = getOption<boolean>(options, ['yes', 'y', 'force', 'f']);
2020
const recursive = !!getOption<boolean>(options, ['recursive', 'r']);
2121
const format = getFormat(options);
2222
_jsonMode = format === 'json';

0 commit comments

Comments
 (0)