amazon web services - Why aws --version writes to stderr? -


why standard check aws --version prints expected output stderr, not stdout?

$ aws --version 2>err.log $ cat err.log aws-cli/1.11.65 python/2.7.13 darwin/16.5.0 botocore/1.5.28 $ aws --version > out.log aws-cli/1.11.65 python/2.7.13 darwin/16.5.0 botocore/1.5.28 $ cat out.log $ 

it make sense write result stdout if command completed successfully. other commands aws ec2 describe-images or aws ec2 describe-instances write output stdout correctly.

checked on centos , macos.

this caused bug in argparse fixed in python 3.4.

the awscli written in python , uses argparse module parse command line. uses action="version" feature of argparse simplify version printing. prints version string stderr prior python 3.4 , prints stdout in python 3.4+.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -