Skip to content

Commit

Permalink
ENH: Added keyword 'all' for set.
Browse files Browse the repository at this point in the history
The keyword ‘all’ can be used in __set to specify all guests.
  • Loading branch information
EpiJunkie committed Jul 22, 2016
1 parent f6e7ad4 commit 9d0e05b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions lib/chyves-properties
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,19 @@ __set() {
local _guests_list _lastguest _prop _val
local _guests_list="$1" # This is script indexed.

# If keywoard "all" used, replace with all guest names in comma separated list.
[ "$_guests_list" = all ] && local _guests_list="$_GUEST_NAMES_ACTIVE"

shift 2 # Keep from setting "set" or guest name as a property.
for arg in "$@"; do

# Guest name detector
if [ -z "$( echo "$arg" | grep '=' )" ]; then
local _guests_list="$arg"

# If keywoard "all" used, replace with all guest names in comma separated list.
[ "$_guests_list" = all ] && local _guests_list="$_GUEST_NAMES_ACTIVE"

__verify_guests $arg

# Skip remaining loop, as it is property specific.
Expand Down
2 changes: 1 addition & 1 deletion man/chyves.8.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ chyves <guest> disk list
chyves <guest> get {<property>|all}
chyves <guest>|MG|all reclaim
chyves <guest> rename <new-guest-name>
chyves <guest>|MG|global|defaults set [<prop1>=<value>]...
chyves <guest>|MG|global|defaults|all set [<prop1>=<value>]...
chyves <guest> snapshot [<@snapshotname>]
chyves <guest> snapshot delete <@snapshotname>
chyves <guest> snapshot rollback [<@snapshotname>]
Expand Down

0 comments on commit 9d0e05b

Please sign in to comment.