mixer-tools icon indicating copy to clipboard operation
mixer-tools copied to clipboard

Would like a "mixer bundle remove --all" option

Open bktan8 opened this issue 7 years ago • 11 comments

It would be nice to have a "remove --all" option to completely remove all bundles instead of having to name each bundle.

bktan8 avatar May 07 '18 17:05 bktan8

What is wrong with

cd /usr/share/clear/bundles
swupd bundle remove *

icarus-sparry avatar May 07 '18 17:05 icarus-sparry

@icarus-sparry I'm not sure how that would solve his problem, let alone work. I believe @bktan8 wants to essentially wipe his mixbundles file. I think that sounds like a reasonable feature request. I'd say just remove the contents of mixbundles but that is an implementation detail the user doesn't need to know about.

matthewrsj avatar May 07 '18 18:05 matthewrsj

Ah, I managed to see this as a request to remove all bundles from the OS - my mistake.

So something like

        mixer bundle remove $( mixer bundle list XXXX)

instead?

icarus-sparry avatar May 07 '18 18:05 icarus-sparry

That would need more processing I believe, since mixer bundle list outputs a bunch of other garbage too... /me glares at @kevincwells

matthewrsj avatar May 07 '18 18:05 matthewrsj

That --all flag seems like a good idea to me. It shouldn't require much work to add/maintain it anyway.

rchiossi avatar May 07 '18 18:05 rchiossi

I think it would be better to have a --short flag for mixer bundle list to just give the names only, so you can compose things, e.g.

       mixer bundle list --short | grep -v '^R-' | xargs mixer bundle remove

to remove things which are not R packages. The --all might be the most frequent need, but it is surely not the only one.

icarus-sparry avatar May 07 '18 19:05 icarus-sparry

In that case it might be better to just make bundle remove support regex?

mixer bundle remove '^(?!R-).*$'

(or something)

matthewrsj avatar May 07 '18 19:05 matthewrsj

In that case it might be better to just make bundle remove support regex?

That is a bit too much. If you need regex support you better of using some other tool to get you what you want.

I think it would be better to have a --short flag for mixer bundle list to just give the names only

Do we have other use cases for getting the list, names only or removing them all is the only one so far?

rchiossi avatar May 07 '18 19:05 rchiossi

That is a bit too much. If you need regex support you better of using some other tool to get you what you want.

Why? We can just import "regexp" and use the library.

matthewrsj avatar May 07 '18 20:05 matthewrsj

Why? We can just import "regexp" and use the library.

Because then you need to add testing and documentation for the regex use and fix any awkward error that might appear because someone found a weird regex that breaks everything.

rchiossi avatar May 07 '18 21:05 rchiossi

we don't have to re-implement regex parsing. All we have to do is pass the string to the library function. That is hardly anything more to test

matthewrsj avatar May 07 '18 22:05 matthewrsj