pharo-project / pharo-launcher

Lets you manage your pharo images and download new ones
https://pharo-project.github.io/pharo-launcher/
MIT License
108 stars 46 forks source link

Allow CLI commands to select a template, image or VM by sequence number #567

Open Bajger opened 2 years ago

Bajger commented 2 years ago

Allow CLI commands to select a template, image or vm by sequence number

Describe the request Currently, images or templates can be identified only by full name that match exact name in the list. Example: ./pharo-launcher.sh image launch "myImageName" As a shortcut, we may support sequence nr. for our users like this: ./pharo-launcher.sh image launch #1 instead of name. Sequence number is the order as the images or templates are listed by list command e.g.:

./pharo-launcher.sh image list
#  Name                                             Architecture Pharo version Last modified      
-- ------------------------------------------------ ------------ ------------- -------------------
1  Pharo 9.0 - 64bit (stable)                       64           90            2021-11-13 13:18:02
2  P8                                               64           80            2022-03-01 17:05:56
3  Pharo 11.0 - 64bit (development version, latest) 64           110           2022-05-30 15:40:21

Expected behavior When sequence number argument is used, #<nr> validation of argument should happen and checked, if it matches the item in list (check ranges of list compared to provided argument). Name should be printed as a result of image or template operation as a visual verification to user, so he/she is sure he used right sequence number.

Expected development cost Add validator of argument on image, template, vm commands.

Additional context Note: Sequence number will refer to different image or template, when combining with create or delete.

demarey commented 2 years ago

yes, I think it would be very valuable! It takes time to implement but it will be very useful