Skip to content

Commit 1c200c2

Browse files
committed
Rename and remove short version
1 parent df0dd0d commit 1c200c2

File tree

3 files changed

+23
-48
lines changed

3 files changed

+23
-48
lines changed

aliases

+1-2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ alias aws-account-id='~/.bash-my-aws/bin/bma aws-account-id'
3838
alias aws-accounts='~/.bash-my-aws/bin/bma aws-accounts'
3939
alias aws-panopticon='~/.bash-my-aws/bin/bma aws-panopticon'
4040
alias bucket-acls='~/.bash-my-aws/bin/bma bucket-acls'
41+
alias bucket-objects='~/.bash-my-aws/bin/bma bucket-objects'
4142
alias bucket-remove='~/.bash-my-aws/bin/bma bucket-remove'
4243
alias bucket-remove-force='~/.bash-my-aws/bin/bma bucket-remove-force'
4344
alias buckets='~/.bash-my-aws/bin/bma buckets'
@@ -115,8 +116,6 @@ alias rds-db-clusters='~/.bash-my-aws/bin/bma rds-db-clusters'
115116
alias rds-db-instances='~/.bash-my-aws/bin/bma rds-db-instances'
116117
alias region-each='~/.bash-my-aws/bin/bma region-each'
117118
alias regions='~/.bash-my-aws/bin/bma regions'
118-
alias s3-ls='~/.bash-my-aws/bin/bma s3-ls'
119-
alias s3-lsl='~/.bash-my-aws/bin/bma s3-lsl'
120119
alias skim-stdin='~/.bash-my-aws/bin/bma skim-stdin'
121120
alias stack-arn='~/.bash-my-aws/bin/bma stack-arn'
122121
alias stack-asg-instances='~/.bash-my-aws/bin/bma stack-asg-instances'

bash_completion.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,10 @@ complete -F _bma_aws-accounts_completion aws-account-cost-explorer
138138
complete -F _bma_aws-accounts_completion aws-account-cost-recommendations
139139
complete -F _bma_aws-accounts_completion aws-accounts
140140
complete -F _bma_buckets_completion bucket-acls
141+
complete -F _bma_buckets_completion bucket-objects
141142
complete -F _bma_buckets_completion bucket-remove
142143
complete -F _bma_buckets_completion bucket-remove-force
143144
complete -F _bma_buckets_completion buckets
144-
complete -F _bma_buckets_completion s3-ls
145-
complete -F _bma_buckets_completion s3-lsl
146145
complete -F _bma_certs_completion cert-delete
147146
complete -F _bma_certs_completion cert-users
148147
complete -F _bma_certs_completion certs

lib/s3-functions

+21-44
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,27 @@ bucket-acls() {
5555
done
5656
}
5757

58+
bucket-objects() {
59+
60+
# List of S3 Bucket Objects.
61+
#
62+
# $ bucket-objects example-bucket
63+
# object-key last-modified storage-class owner-display-name etag size
64+
# another-object-key last-modified storage-class owner-display-name etag size
65+
#
66+
67+
local buckets=$(skim-stdin "$@")
68+
[[ -z "$buckets" ]] && __bma_usage "bucket [bucket]" && return 1
69+
70+
local bucket
71+
for bucket in $buckets; do
72+
aws s3api list-objects \
73+
--bucket "$bucket" \
74+
--output text \
75+
--query "Contents[].[Key, LastModified, StorageClass, Owner.DisplayName, ETag, Size]"
76+
done
77+
}
78+
5879

5980
bucket-remove() {
6081

@@ -116,47 +137,3 @@ bucket-remove-force() {
116137
fi
117138
}
118139

119-
120-
s3-ls() {
121-
122-
# List of S3 Bucket Objects.
123-
#
124-
# $ s3-ls example-bucket
125-
# object-key
126-
# another-object-key
127-
#
128-
129-
local buckets=$(skim-stdin "$@")
130-
[[ -z "$buckets" ]] && __bma_usage "bucket [bucket]" && return 1
131-
132-
local bucket
133-
for bucket in $buckets; do
134-
aws s3api list-objects \
135-
--bucket "$bucket" \
136-
--output text \
137-
--query "Contents[].[Key]"
138-
done
139-
}
140-
141-
142-
s3-lsl() {
143-
144-
# Detail List of S3 Bucket Objects.
145-
#
146-
# $ s3-lsl another-example-bucket
147-
# object-key last-modified storage-class owner-display-name etag size
148-
# another-object-key last-modified storage-class owner-display-name etag size
149-
#
150-
151-
local buckets=$(skim-stdin "$@")
152-
[[ -z "$buckets" ]] && __bma_usage "bucket [bucket]" && return 1
153-
154-
local bucket
155-
for bucket in $buckets; do
156-
aws s3api list-objects \
157-
--bucket "$bucket" \
158-
--output text \
159-
--query "Contents[].[Key, LastModified, StorageClass, Owner.DisplayName, ETag, Size]"
160-
done
161-
}
162-

0 commit comments

Comments
 (0)