From 1f89a46b5225fa40b33fd75e9624e7fa19798d36 Mon Sep 17 00:00:00 2001 From: Brett Inman Date: Wed, 27 Apr 2016 11:34:51 -0700 Subject: [PATCH] Make -q flag totally quiet for env-setup.fish The first echo and setup.py steps are not quiet and result in output that is annoying if your Fish is configured to source the file. --- hacking/env-setup.fish | 52 ++++++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 20 deletions(-) diff --git a/hacking/env-setup.fish b/hacking/env-setup.fish index d0bc717905..0c3f351c2a 100644 --- a/hacking/env-setup.fish +++ b/hacking/env-setup.fish @@ -8,6 +8,15 @@ set PREFIX_PYTHONPATH $ANSIBLE_HOME/lib set PREFIX_PATH $ANSIBLE_HOME/bin set PREFIX_MANPATH $ANSIBLE_HOME/docs/man +# set quiet flag +if set -q argv + switch $argv + case '-q' '--quiet' + set QUIET "true" + case '*' + end +end + # Set PYTHONPATH if not set -q PYTHONPATH set -gx PYTHONPATH $PREFIX_PYTHONPATH @@ -15,7 +24,9 @@ else switch PYTHONPATH case "$PREFIX_PYTHONPATH*" case "*" - echo "Appending PYTHONPATH" + if not [ $QUIET ] + echo "Appending PYTHONPATH" + end set -gx PYTHONPATH "$PREFIX_PYTHONPATH:$PYTHONPATH" end end @@ -38,7 +49,11 @@ set -gx ANSIBLE_LIBRARY $ANSIBLE_HOME/library # Generate egg_info so that pkg_resources works pushd $ANSIBLE_HOME -python setup.py egg_info +if [ $QUIET ] + python setup.py -q egg_info +else + python setup.py egg_info +end if test -e $PREFIX_PYTHONPATH/ansible*.egg-info rm -r $PREFIX_PYTHONPATH/ansible*.egg-info end @@ -47,22 +62,19 @@ find . -type f -name "*.pyc" -delete popd -if set -q argv - switch $argv - case '-q' '--quiet' - case '*' - echo "" - echo "Setting up Ansible to run out of checkout..." - echo "" - echo "PATH=$PATH" - echo "PYTHONPATH=$PYTHONPATH" - echo "ANSIBLE_LIBRARY=$ANSIBLE_LIBRARY" - echo "MANPATH=$MANPATH" - echo "" - - echo "Remember, you may wish to specify your host file with -i" - echo "" - echo "Done!" - echo "" - end +if not [ $QUIET ] + echo "" + echo "Setting up Ansible to run out of checkout..." + echo "" + echo "PATH=$PATH" + echo "PYTHONPATH=$PYTHONPATH" + echo "ANSIBLE_LIBRARY=$ANSIBLE_LIBRARY" + echo "MANPATH=$MANPATH" + echo "" + echo "Remember, you may wish to specify your host file with -i" + echo "" + echo "Done!" + echo "" end + +set -e QUIET