Skip to content

Response file

Konstantin Nosov edited this page Apr 16, 2019 · 3 revisions

Purpose

Response files are widely used in command line toolchains. This allows to specify application's command line in a file rather than listing options as command line parameters. An example from Visual C++ toolchain: link

Motivation and use case

I use command line a lot for debugging, it saves my time. Previously I used simple text editor, and debugged with logs. There's test.sh launcher script which knows locations of game data on my drive, so I can simply use "test.sh --paragon", and it will open the game with appropriate arguments. However recently I switched to Visual Studio Code, which has richer editing capabilities and a good debugger. I can't use that script there, because in this case VS will debug bash.exe, not UModel. To debug UModel executable with a command line I should put it into launch.json file, separating every argument and enclosing into quotes. To make multiple command lines, I have to duplicate large piece of json block and change some parameters. At my work I use response files, so I'm putting just "@cmdline.txt" as command line, and changing everything what I need in a text file. Here I decided to do the same thing.

In my case, actually response file is a collection of command lines - it has one active argument set and a few disabled (commented) ones. Whenever I need to change command line, I'm just putting '#' before active parameters and removing '#' before those I need to use. It is much easier than editing launch.json or than performing lots of "mouse work" in classic Visual Studio.

Usage

To use response file, simply use this the following command line format:

umodel @<filename>

File format

You may list options separated with spaces or newlines. Empty lines are ignored. Parameters could be enclosed in double quotes. It is possible to use comments (for example to disable part of command line), use shell-style comments starting with '#' or ';'.

Example

# Here are 3 command lines in this sample: 1 of them is active, other are commented (disabled).

# ShooterGame
"C:/Unreal/ShooterGame/WindowsNoEditor/ShooterGame/Content/Paks" -game=ue4.22

# Disabled block
# Fortnite
# -path=C:/UnrealEngine/Fortnite/FortniteGame/Content/Paks -game=ue4.22 -aes=...

# Disabled block
# Paragon
# -path=C:/UnrealEngine/Paragon/OrionGame/Content/Paks -game=paragon
Clone this wiki locally