Commit c1479baff862e554946839b249cc4a9226b57674

Authored by Shrikant Sharat
1 parent 27ff756cd1

Accept a --verbose option to -ensure-repo command.

This will be used to make the -ensure-repo command output more detailed
information on the changes, if any, made to the clone.

Showing 1 changed file with 8 additions and 3 deletions Side-by-side Diff

... ... @@ -140,12 +140,17 @@ antigen-update () {
140 140 # argument is `--update` and if a clone already exists for the given repo
141 141 # and branch, it is pull-ed, i.e., updated.
142 142  
  143 + # Argument defaults.
143 144 # Check if we have to update.
144 145 local update=false
145   - if [[ $1 == --update ]]; then
146   - update=true
  146 + # Verbose output.
  147 + local verbose=false
  148 +
  149 + # Load any boolean arguments specified.
  150 + while [[ $1 == --* ]]; do
  151 + eval "local '${1#--}=true'"
147 152 shift
148   - fi
  153 + done
149 154  
150 155 # Get the clone's directory as per the given repo url and branch.
151 156 local url="$1"