mssola / user_agent

This project has been moved, check the README.md file!

Home Page:https://github.com/mssola/useragent

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Shorter Linux tagging

dlebech opened this issue · comments

Question: Currently, Linux is being tagged as "Linux x86_64" for the OS part. It would be nice if it was just "Linux". I'll be happy to write up little PR for this, but I just wanted your opinion on it first.

One proposal for a solution would be to check if "Linux" appears in the OS name and then split on any spaces and take the first part. I don't know if this would work for all Linux variants.

Looks good to me, but I don't want to break the API. So, let's introduce a new method that does exactly what you are saying (e.g. RawOS). What do you think ?

That sounds like a good idea. Existing users are used to seeing "Linux x86_64" so that would break with a change to the OS function. I only have a small nitpick about the name as I think "Linux x86_64" is actually the "raw" version and "Linux" would be a prettier version, so perhaps PrettyOS, ParsedOS or ShortOS instead of RawOS. What do you think?

It's also a possibility that this function could return a struct or tuple that also contains the version number, if applicable. This would also fix #30

That sounds like a good idea. Existing users are used to seeing "Linux x86_64" so that would break with a change to the OS function. I only have a small nitpick about the name as I think "Linux x86_64" is actually the "raw" version and "Linux" would be a prettier version, so perhaps PrettyOS, ParsedOS or ShortOS instead of RawOS. What do you think?

Maybe FullOS or OSInfo, or something similar that specifies that the returned struct contains a verbose implementation of OS ?

It's also a possibility that this function could return a struct or tuple that also contains the version number, if applicable. This would also fix #30

👍

I think OSInfo is excellent :) Would you like me to write something up when I have time later this week?

Would you like me to write something up when I have time later this week?

Sure, take your time 👍