---
title: "urfave/cli: Unicode flag names in Go CLI help | VulCode"
description: "In urfave/cli we fixed the help of BoolWithInverseFlag, which showed one-character non-ASCII names with two dashes because it counted bytes, in Go."
url: "https://vulcode.com/en/opensource/contributions/urfave-cli"
lang: "en"
---

[All contributions](https://vulcode.com/en/opensource/contributions)

urfave/cli

# urfave/cli

A declarative Go package for building command line tools.

[See the repository](https://github.com/urfave/cli) [All contributions](https://vulcode.com/en/opensource/contributions)

- **Language**: Go
- **GitHub stars**: 24,329
- **Merged changes**: 1
- **Project site**: [cli.urfave.org](https://cli.urfave.org)

## What we changed

The help of BoolWithInverseFlag shows one-character non-ASCII names and aliases with a single dash, like every other flag.

### What this work shows

- Runes and bytes in Go

- CLI help and flag output

- Table-driven tests in Go

What was broken

### Flag ü got two dashes

BoolWithInverseFlag.String() chose - or -- with len(name) == 1, and len() in Go counts bytes. A one-character non-ASCII name such as ü takes two bytes, so the help showed --[no-]ü while any other flag with that name showed -ü.

How we fixed it

### The shared prefixFor function

The name and each alias now get their prefix from prefixFor, which the rest of the library uses and which counts characters instead of bytes. Two new cases in TestBoolWithInverseString with ü as the name and as an alias failed before the change.

[#2461](https://github.com/urfave/cli/pull/2461)

## Merged change 1

- [#2461 fix: use prefixFor for BoolWithInverseFlag names and aliases Merged 8 October 2026](https://github.com/urfave/cli/pull/2461)

## What it taught us

We catch the gap in Go between bytes and Unicode characters that makes ü look like a long name, and remove it by moving the code onto the function the rest of the library already uses, instead of adding another special case.

[More about this technology: Golang](https://vulcode.com/en/technologies/go)

## Other projects we write code for

- [**chezmoi** Go · 22,342 stars A dotfiles manager that keeps the same settings on many different machines, securely.](https://vulcode.com/en/opensource/contributions/chezmoi)

- [**goquery** Go · 14,995 stars A Go library for traversing and changing HTML documents in the style of jQuery, built on the golang.org/x/net/html parser.](https://vulcode.com/en/opensource/contributions/goquery)

- [**Ebitengine** Go · 13,647 stars A 2D game engine in Go, used in games released for computers, phones, browsers and consoles.](https://vulcode.com/en/opensource/contributions/ebiten)

- [**Fission** Go · 8,950 stars A serverless functions framework for Kubernetes that runs code as functions and scales them down to zero when they are idle.](https://vulcode.com/en/opensource/contributions/fission)

- [**Concourse** Go · 7,944 stars A container-based automation system written in Go and used mostly for CI/CD. Pipelines and tasks are described in YAML files.](https://vulcode.com/en/opensource/contributions/concourse)

- [**dromara/carbon** Go · 5,225 stars A Go package for dates and times with a simple, readable API, with helpers such as the start and end of a minute, a day or a century.](https://vulcode.com/en/opensource/contributions/dromara-carbon)

## Describe your project.

A free quote comes back within an hour during working hours.

### Rather skip the form?

Ask in the chat or write to us directly.

Open the chat

- **Email**: [hello@vulcode.com](mailto:hello@vulcode.com)
- **Phone**: [+48 576 043 920](tel:+48576043920)
- **Discord**: [discord.gg/vulcode](https://discord.gg/vulcode)
