broadinstitute/fiss

CLI's User warning not accepting default

Opened this issue · 7 comments

When I use fissfc to delete a sample, the CLI asks me if I really want to delete the entity. The possible responses are Y\n, with Y (yes) being the default. If I just hit return, however, the default is not done. I have to explicitly respond with 'Y' in order for the fissfc command to be run.

wm8b6-23c:~ birger$ fissfc sample_delete -w CCL_Discordance_Portal -p broad-fc-ccl-discordance -e test8
WARNING: this will delete sample test8 in broad-fc-ccl-discordance/CCL_Discordance_Portal
Are you sure? [Y\n]:

Noted, Chet. We'll take a look after the dust settles from our DSP demo (of Hydrant) today.

Sam, can you look at this? It stems from Chet's work on the CCLE portal, which has a deadline of 1.5 weeks, so it'd be good if we can get the pieces he's using in tip-top shape. Last week I made a hotfix for another issue.

Yes, I have a proposed fix at hand, via a compatibility update from six.moves import input and a modification to the confirm prompt which either sets a default or accepts a default kwarg, but I'll walk through the use cases of _confirm_prompt to better determine the impact of this change.

Is this actually a fix though? Looking at the code, the prompt never had a default. If a user wants to auto-confirm and skip all prompts, then they can simply give the -y flag to fissfc before specifying their function.

In my opinion, both scenarios are valid use cases. The user shouldn't be required to pass a global flag in order to accept a default input response.

Note there is no need to rush and fix this (I don't need it for the data portal I'm developing)...it is just some anomalous behavior I observed and I wanted to report it back the team.

@sammeier, I'm saying I'm not sure I agree that there should be a default response. The global flag removes the prompts altogether, it doesn't create a default.