-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Book: Add SQF page for
hemtt utils sqf
command(s) (#767)
- Loading branch information
1 parent
9987d26
commit 19375b3
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# hemtt utils sqf case | ||
|
||
```admonish danger | ||
This command requires **manual review**. It can have lots of false positives so you are **strongly encouraged** to check each modified file to ensure it is correct. | ||
``` | ||
|
||
<pre><code>Fix capitalization in SQF commands | ||
|
||
Usage: hemtt utils sqf [OPTIONS] <path> | ||
|
||
Arguments: | ||
<path> | ||
Path to the SQF file or a folder to recursively fix | ||
|
||
Options: | ||
-t, --threads | ||
Number of threads, defaults to # of CPUs | ||
|
||
-h, --help | ||
Print help information (use `-h` for a summary) | ||
</code> | ||
</pre> | ||
|
||
This will recursively correct all capitalization mistakes in SQF commands. | ||
|
||
## Example | ||
|
||
```sqf | ||
private _positionASL = GetPosasl Player; | ||
// becomes | ||
private _positionASL = getPosASL player; | ||
``` | ||
|
||
## False Positives | ||
|
||
This command does not full parse your SQF files. | ||
|
||
It will not change words in strings in comments, but it may change words that will break your program | ||
|
||
```sqf | ||
// script_macros.hpp | ||
#define FALSE 0 | ||
#define TRUE 1 | ||
// fnc_someFunction.sqf | ||
if (getNumber (configFile >> "someClass" >= TRUE)) then {...}; | ||
// becomes | ||
if (getNumber (configFile >> "someClass" >= true)) then {...}; | ||
``` | ||
|
||
```sqf | ||
private _value = player getVariable [QGVAR(showHud), false]; | ||
// becomes | ||
private _value = player getVariable [QGVAR(showHUD), false]; | ||
``` |