Enumerate items in a list so a user can select the numeric value
问题 I'm trying to find the most straightforward way to enumerate items in a list so that a user will not be burdened to type a long file name on a command line. The function below shows a user all .tgz and .tar files in a folder ... the user is then allowed to enter the name of the file he wants to extract. This is tedious and syntax-error prone for the user. I would like for a user to just select, say, a numeric value associated with the file (eg.. 1, 2, 3 etc.). Can someone give me some