Repository: microsoft/PowerToys
File: src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.ValueGenerator/InputParser.cs (C#)

Code before:
                {
                    throw new FormatException("Empty hash request");
                }

                Log.Debug($"Will calculate {algorithmName} hash for: {content}", GetType());
                request = new HashRequest(algorithmName, Encoding.UTF8.GetBytes(content));
            }
            else if (command.StartsWith("guid", StringComparison.InvariantCultureIgnoreCase) ||
                     command.StartsWith("uuid", StringComparison.InvariantCultureIgnoreCase))
            {
                string content = query.Search.Substring(command.Length).Trim();

                // Default to version 4
                int version = 4;
                string versionQuery = command.Substring(4);

                if (versionQuery.Length > 0)
                {
                    if (versionQuery.StartsWith("v", StringComparison.InvariantCultureIgnoreCase))
                    {
                        versionQuery = versionQuery.Substring(1);
                    }

                    if (!int.TryParse(versionQuery, null, out version))
                    {
                        throw new ArgumentException("Could not determine requested GUID version. Supported versions are 1, 3, 4 and 5");
                    }
                }

                if (version == 3 || version == 5)
                {
                    string[] sParameters = content.Split(" ");

                    if (sParameters.Length != 2)
                    {
                        throw new ArgumentException($"GUID version {version} require 2 parameters - a namespace GUID and a name.\nExample: uuidv{version} ns:<DNS, URL, OID, or X500> <your input>");
                    }

                    string namespaceParameter = sParameters[0];
                    string nameParameter = sParameters[1];

                    request = new GUIDRequest(version, namespaceParameter, nameParameter);
                }
                else
                {
                    request = new GUIDRequest(version);
                }
            }
            else if (command.Equals("base64", StringComparison.OrdinalIgnoreCase))
            {
                int commandIndex = query.RawUserQuery.IndexOf(command, StringComparison.InvariantCultureIgnoreCase);

Review comment (suggestion):
Wondering if we should show the list of examples based on fuzzy search. Currently the query `uuidv` shows the error message and not the examples. Or at least decide if `uudiv` or `uuidv<unknown number>`.

Code after:
                {
                    throw new FormatException("Empty hash request");
                }

                Log.Debug($"Will calculate {algorithmName} hash for: {content}", GetType());
                request = new HashRequest(algorithmName, Encoding.UTF8.GetBytes(content));
            }
            else if (command.StartsWith("guid", StringComparison.InvariantCultureIgnoreCase) ||
                     command.StartsWith("uuid", StringComparison.InvariantCultureIgnoreCase))
            {
                string content = query.Search.Substring(command.Length).Trim();

                // Default to version 4
                int version = 4;
                string versionQuery = command.Substring(4);

                if (versionQuery.Length > 0)
                {
                    if (versionQuery.StartsWith("v", StringComparison.InvariantCultureIgnoreCase))
                    {
                        versionQuery = versionQuery.Substring(1);
                    }

                    if (!int.TryParse(versionQuery, null, out version))
                    {
                        throw new FormatException("Could not determine requested GUID version. Supported versions are 1, 3, 4 and 5");
                    }
                }

                if (version == 3 || version == 5)
                {
                    string[] sParameters = content.Split(" ");

                    if (sParameters.Length != 2)
                    {
                        throw new ArgumentException($"GUID version {version} require 2 parameters - a namespace GUID and a name.\nExample: uuidv{version} ns:<DNS, URL, OID, or X500> <your input>");
                    }

                    string namespaceParameter = sParameters[0];
                    string nameParameter = sParameters[1];

                    request = new GUIDRequest(version, namespaceParameter, nameParameter);
                }
                else
                {
                    request = new GUIDRequest(version);
                }
            }
            else if (command.Equals("base64", StringComparison.OrdinalIgnoreCase))
            {
                int commandIndex = query.RawUserQuery.IndexOf(command, StringComparison.InvariantCultureIgnoreCase);