os_info icon indicating copy to clipboard operation
os_info copied to clipboard

Feature Request: OS Families

Open martintc opened this issue 2 years ago • 1 comments

I've done some work over on comtrya that uses this library and I was looking at how comtrya utilizes os_info and thought about how other programs may use os_info. Getting specific information is great, but in some cases, mostly in Linux, having the specific distro may be a little bit too much information for what is needed. As an example, Comtrya looks at all of the OS type to then decide what action to take. For some actions that may become unruly. So I am thinking, what if we add another parameter for a Generic "family." So you still get all of the detailed information but a generic label also. So for instance, all Linux distros would have a "Linux" family label. So a program that calls on information from os_info and doesnt care what distro it is can just compare against the family. It just needs to know it is linux, the calling code doesn't care if it is Gentoo or Debian or Fedora. An example would be comtrya with adding the ability for user management. Linux distros add users in pretty much the same fashion, but comtrya would have to have code for all possible variants of Type. I am also wondering if this would also allow code being ran on linux systems that don't have a specific Type definition in os_info to already be useful for calling code. In the case of a rust tool that handles user management, it could just compare against the family not against each individual type.

martintc avatar May 29 '22 05:05 martintc

Thank you for the suggestion, I think that makes sense. I will try to look into that, but feel free to submit a pull request if you like and/or want to speedup the process.

stanislav-tkach avatar May 30 '22 20:05 stanislav-tkach