Commit 723b284b473aae6f565803b4c91176190f9c8d91

Authored by Shrikant Sharat
1 parent 7a2ca59361

Use the arg parsing fn in -ensure-repo command.

Showing 1 changed file with 5 additions and 7 deletions Side-by-side Diff

... ... @@ -102,7 +102,7 @@ antigen-update () {
102 102 sort -u |
103 103 while read url; do
104 104 echo "**** Pulling $url"
105   - -antigen-ensure-repo --update --verbose "$url"
  105 + -antigen-ensure-repo "$url" --update --verbose
106 106 echo
107 107 done
108 108 }
... ... @@ -141,19 +141,17 @@ antigen-update () {
141 141 # and branch, it is pull-ed, i.e., updated.
142 142  
143 143 # Argument defaults.
  144 + # The url. No sane default for this, so just empty.
  145 + local url=
144 146 # Check if we have to update.
145 147 local update=false
146 148 # Verbose output.
147 149 local verbose=false
148 150  
149   - # Load any boolean arguments specified.
150   - while [[ $1 == --* ]]; do
151   - eval "local '${1#--}=true'"
152   - shift
153   - done
  151 + eval "$(-antigen-parse-args 'url ; update?, verbose?' "$@")"
  152 + shift $#
154 153  
155 154 # Get the clone's directory as per the given repo url and branch.
156   - local url="$1"
157 155 local clone_dir="$(-antigen-get-clone-dir $url)"
158 156  
159 157 # A temporary function wrapping the `git` command with repeated arguments.