Skip to content

Document behavior of backticks in usage string #200

@AlexNPavel

Description

@AlexNPavel

Pflag changes the type of a flag to match a string in back quotes in the usage string. For example, if flag "test" had usage message "this sets up the testtype variable", the output would be:

      --test testtype  this sets up the testtype variable

This is unexpected behavior and is also not documented anywhere except in this godoc for the UnquoteUsage function: https://godoc.org/github.com/spf13/pflag#UnquoteUsage

This should be documented somewhere more visibly as back quotes are commonly used in descriptions and usage text.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions