awslabs / aws-shell

An integrated shell for working with the AWS CLI.
Apache License 2.0
7.15k stars 770 forks source link

Add support for multiline command #200

Open xiaxuantan opened 6 years ago

xiaxuantan commented 6 years ago

Make some enhancement according to #194

If we want to do cross-line editing, a "\" should be appended at the end of the line; any other character would be considered as the end of a command.

aws> ec2 describe-spot-price-history \
     --region=ap-northeast-2 \
     --instance-types c4.large \
     --start-time=$(date +%s) \
     --product-descriptions="Linux/UNIX" \
     --query 'SpotPriceHistory[*].{az:AvailabilityZone, price:SpotPrice}'
[
    {
        "az": "ap-northeast-2c",
        "price": "0.026700"
    },
    {
        "az": "ap-northeast-2a",
        "price": "0.026700"
    }
]
  1. multiline commands can also be searched in the shell
    (reverse-i-search)`ec2`: ec2 describe-spot-price-history \
                         --region=ap-northeast-2 \
                         --instance-types c4.large \
                         --start-time=$(date +%s) \
                         --product-descriptions="Linux/UNIX" \
                         --query 'SpotPriceHistory[*].{az:AvailabilityZone, price:SpotPrice}'