Skip to content

Add short aliases to some S3 command options#9984

Open
EpicWink wants to merge 2 commits intoaws:developfrom
EpicWink:s3-short-params
Open

Add short aliases to some S3 command options#9984
EpicWink wants to merge 2 commits intoaws:developfrom
EpicWink:s3-short-params

Conversation

@EpicWink
Copy link
Copy Markdown

Aliases as specified with name. Single-letter aliases are prefixed with a single hyphen, otherwise with two hyphens. ValueError is raised when positional argument defines aliases.

Aliases are:

  • -r for --recursive (s3 cp, s3 ls, s3 mv, s3 rm)
  • -H for --human-readable (s3 ls)
  • -s for --summarize (s3 ls)
  • -n for --dryrun (s3 cp, s3 mv, s3 rm)

Resolves #9972

  • By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@EpicWink
Copy link
Copy Markdown
Author

EpicWink commented Jan 16, 2026

I've added support for short options to the completer, but it assumes all 1-length options are short, and it also changes the logic (instead of stripping the leading hyphens from the argument, it pre-pends hyphens to all available options). It would be simpler to remove support in the completer: did you want this?

I've left this merge request as multiple commits until this question is resolved (to make it easier to revert).

@EpicWink EpicWink marked this pull request as ready for review January 16, 2026 03:02
@EpicWink EpicWink force-pushed the s3-short-params branch 3 times, most recently from 166b899 to 80a0a07 Compare March 10, 2026 10:47
Aliases as specified with name. Single-letter aliases are prefixed with
a single hyphen, otherwise with two hyphens. ValueError is raised when
positional argument defines aliases.

Aliases are:
* '-r' for '--recursive' ('s3 cp', 's3 ls', 's3 mv', 's3 rm')
* '-H' for '--human-readable' ('s3 ls')
* '-s' for '--summarize' ('s3 ls')
* '-n' for '--dryrun' ('s3 cp', 's3 mv', 's3 rm')
(
self.operations_called[idx][1]['CopySource']['Key'],
self.operations_called[idx][1]['Key'],
self.operations_called[delete_indexes[i]][1]['Key'],
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This causes the test to be flakey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add short option parameters to aws s3 commands

2 participants