hugovk / norwegianblue

CLI to show end-of-life dates for a number of products.
https://endoflife.date
MIT License
74 stars 4 forks source link

Add [y/n] prompt to suggestion #133

Closed adriens closed 1 year ago

adriens commented 1 year ago

:bulb: Idea

As implemented in :

I really enjoy a lot this feature.

:bulb: Would it possible in the output, in addition to this :

ubuntu $ eol pthon
Product 'pthon' not found, run 'eol all' for list. Did you mean: 'python'?
ubuntu $ 

to reply this :

ubuntu $ eol pthon
Product 'pthon' not found, run 'eol all' for list. Did you mean: 'python'? If yes, try this:
eol python
ubuntu $ 

:moneybag: Benefits

:bookmark: Related contents

hugovk commented 1 year ago

Alternatively:

$ eol pthon
Product 'pthon' not found, run 'eol all' for list. Did you mean: 'python'? [y/n]

And if they press Y or y:

$ eol pthon
Product 'pthon' not found, run 'eol all' for list. Did you mean: 'python'? [y/n] Y
┌───────┬────────────┬─────────┬────────────────┬────────────┐
│ cycle │  release   │  latest │ latest release │    eol     │
├───────┼────────────┼─────────┼────────────────┼────────────┤
│  3.11 │ 2022-10-24 │  3.11.2 │   2023-02-07   │ 2027-10-24 │
│  3.10 │ 2021-10-04 │ 3.10.10 │   2023-02-07   │ 2026-10-04 │
│  3.9  │ 2020-10-05 │  3.9.16 │   2022-12-06   │ 2025-10-05 │
│  3.8  │ 2019-10-14 │  3.8.16 │   2022-12-06   │ 2024-10-14 │
│  3.7  │ 2018-06-26 │  3.7.16 │   2022-12-06   │ 2023-06-27 │
│  3.6  │ 2016-12-22 │  3.6.15 │   2021-09-03   │ 2021-12-23 │
│  3.5  │ 2015-09-12 │  3.5.10 │   2020-09-05   │ 2020-09-13 │
│  3.4  │ 2014-03-15 │  3.4.10 │   2019-03-18   │ 2019-03-18 │
│  3.3  │ 2012-09-29 │  3.3.7  │   2017-09-19   │ 2017-09-29 │
│  2.7  │ 2010-07-03 │  2.7.18 │   2020-04-19   │ 2020-01-01 │
│  2.6  │ 2008-10-01 │  2.6.9  │   2013-10-29   │ 2013-10-29 │
└───────┴────────────┴─────────┴────────────────┴────────────┘

$ 

If N or n then exit with an error code like before.

If they just press enter, we could default to either yes: [Y/n] or no: [y/N].

adriens commented 1 year ago

Brilliant idea :heavy_heart_exclamation:

:bulb: Would it possible to add a -y option like for apt-get which would automatically answer y ?

adriens commented 1 year ago

Using this feature to help choose products ids :