Skip to content

Does cobra support "@file.txt" flag syntax? #1649

@Warchant

Description

@Warchant

On Windows there's limit of 32k bytes per single CLI command, which makes running of longer commands impossible.
To overcome, some tools like gcc/clang/msvc use what I call "@file.txt syntax".
It's when all flags are saved in a text file, one per line, and then consumed by the compiler like this:

gcc -Iinclude -Wall example.c      #1

# becomes
echo "-Iinclude\n-Wall\nexample.c" > flags.txt
gcc @flags.txt # functionally same as #1

With this syntax we can run CLI commands of arbitrary lengths on Windows.

Does cobra support this syntax?

P.S. example with python's argparse: https://docs.python.org/3/library/argparse.html#fromfile-prefix-chars

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