aws-vault exec intercepts long options

Created on 30 Nov 2018  路  3Comments  路  Source: 99designs/aws-vault

When passing a binary executed with aws-vault exec long options, it seems that they are not properly passed to the executable:

$ aws-vault exec some_profile awless --format csv buckets                                                                                                                                                                          
aws-vault: error: unknown long flag '--format', try --help

As you can see in the above example, the --format flag should be passed to awless and not be consumed by aws-vault.

Most helpful comment

Maybe this should be added to aws-vault exec --help?
I simply forgot that this using -- was a requirement to separate the commands.
I bet I'm not the first person who was stumped by this.

For future reference, the double dash is documented in the POSIX guidelines:

Guideline 10:
The first -- argument that is not an option-argument should be accepted as a delimiter indicating the end of options. Any following arguments should be treated as operands, even if they begin with the '-' character.

All 3 comments

@jottr the execution is wrong, it should have been:

aws-vault exec some_profile -- awless --format csv buckets    

See the missing -- , thats how almost all bash ones needs to be passed.

Maybe this should be added to aws-vault exec --help?
I simply forgot that this using -- was a requirement to separate the commands.
I bet I'm not the first person who was stumped by this.

For future reference, the double dash is documented in the POSIX guidelines:

Guideline 10:
The first -- argument that is not an option-argument should be accepted as a delimiter indicating the end of options. Any following arguments should be treated as operands, even if they begin with the '-' character.

Glad you got it fixed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shivaman picture shivaman  路  6Comments

solsglasses picture solsglasses  路  3Comments

prelegalwonder picture prelegalwonder  路  5Comments

ismailyenigul picture ismailyenigul  路  4Comments

iconara picture iconara  路  6Comments