clustershell icon indicating copy to clipboard operation
clustershell copied to clipboard

prevent reordering with `cluset -e`

Open brianjmurrell opened this issue 5 years ago • 4 comments

$ cluset -e wolf-100vm3,wolf-122,wolf-123,wolf-124,wolf-125,wolf-126,wolf-127,wolf-128,wolf-129
wolf-122 wolf-123 wolf-124 wolf-125 wolf-126 wolf-127 wolf-128 wolf-129 wolf-100vm3

An option to not reorder the list would be useful as It could be that particular positions in the list (i.e. first, last, etc. are meaningful and that they should remain where they were in the input.

brianjmurrell avatar Jul 23 '19 02:07 brianjmurrell

I suppose a more useful example would be:

$ cluset -e wolf-100vm3,wolf-[122-129]
wolf-122 wolf-123 wolf-124 wolf-125 wolf-126 wolf-127 wolf-128 wolf-129 wolf-100vm3

to demonstrate why I want to use cluset in the first place.

brianjmurrell avatar Jul 23 '19 02:07 brianjmurrell

And would you expect from the following command?

$ cluset -e wolf-[122-129],wolf-[120-122]

degremont avatar Jul 23 '19 09:07 degremont

The existing behaviour for that is fine:

wolf-122 wolf-123 wolf-124 wolf-125 wolf-126 wolf-127 wolf-128 wolf-129

So generally speaking I would say expanding left to right, maintaining order, suppressing any duplicates along the way.

brianjmurrell avatar Jul 23 '19 11:07 brianjmurrell

expanding left to right, maintaining order,

That's not exactly my example :). In my example, the elements are not ordered. (120 comes after 122).

degremont avatar Jul 23 '19 12:07 degremont