Merge pull request #3657 from 0x6r1an0y/20260922-makefile-fix
fix: preserve UTF-8 in generated command docs
This commit is contained in:
3 files changed
+14
-7
No files matched your search
@@ -354,13 +354,20 @@ style: commands
|
|||||||
--style=google --unpad-paren --pad-header \
|
--style=google --unpad-paren --pad-header \
|
||||||
--align-pointer=name {} \;
|
--align-pointer=name {} \;
|
||||||
|
|
||||||
|
COMMANDS_UTF8_FILTER := cat
|
||||||
|
COMMANDS_PYTHON := $(PYTHON3)
|
||||||
|
ifdef IS_MINGW
|
||||||
|
COMMANDS_UTF8_FILTER := iconv -f CP850 -t UTF-8
|
||||||
|
COMMANDS_PYTHON := PYTHONIOENCODING=utf-8 $(PYTHON3)
|
||||||
|
endif
|
||||||
|
|
||||||
commands: client
|
commands: client
|
||||||
# Update commands.md
|
# Update commands.md
|
||||||
[ -x client/proxmark3 ] && client/proxmark3 -m | tr -d '\r' > doc/commands.md
|
[ -x client/proxmark3 ] && client/proxmark3 -m | $(COMMANDS_UTF8_FILTER) | tr -d '\r' > doc/commands.md
|
||||||
# Make sure python3 is installed
|
# Make sure python3 is installed
|
||||||
@command -v python3 >/dev/null || ( echo "Please install 'python3' package first" ; exit 1 )
|
@command -v $(PYTHON3) >/dev/null || ( echo "Please install '$(PYTHON3)' package first" ; exit 1 )
|
||||||
# Update commands.json, patch port in case it was run under Windows
|
# Update commands.json, patch port in case it was run under Windows
|
||||||
[ -x client/proxmark3 ] && client/proxmark3 --fulltext | sed 's#com[0-9]#/dev/ttyACM0#'|python3 client/pyscripts/pm3_help2json.py - - | tr -d '\r' > doc/commands.json
|
[ -x client/proxmark3 ] && client/proxmark3 --fulltext | $(COMMANDS_UTF8_FILTER) | sed 's#com[0-9]#/dev/ttyACM0#'|$(COMMANDS_PYTHON) client/pyscripts/pm3_help2json.py - - | tr -d '\r' > doc/commands.json
|
||||||
|
|
||||||
|
|
||||||
# Detecting weird codepages and tabs.
|
# Detecting weird codepages and tabs.
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ USERMOD = usermod -aG
|
|||||||
ADDUSER = adduser
|
ADDUSER = adduser
|
||||||
GETENT_BL = getent group bluetooth
|
GETENT_BL = getent group bluetooth
|
||||||
|
|
||||||
|
PYTHON3 ?= python3
|
||||||
PYTHON3_PKGCONFIG ?= python3
|
PYTHON3_PKGCONFIG ?= python3
|
||||||
|
|
||||||
PATHSEP=/
|
PATHSEP=/
|
||||||
|
|||||||
@@ -1940,7 +1940,7 @@ static int CmdLFHitagEload(const char *Cmd) {
|
|||||||
arg_lit0("1", "ht1", "Card type Hitag 1"),
|
arg_lit0("1", "ht1", "Card type Hitag 1"),
|
||||||
arg_lit0("2", "ht2", "Card type Hitag 2"),
|
arg_lit0("2", "ht2", "Card type Hitag 2"),
|
||||||
arg_lit0("s", "hts", "Card type Hitag S"),
|
arg_lit0("s", "hts", "Card type Hitag S"),
|
||||||
arg_lit0("m", "htm", "Card type Hitag \xce\xbc"), // μ
|
arg_lit0("m", "htm", "Card type Hitag µ"),
|
||||||
arg_param_end
|
arg_param_end
|
||||||
};
|
};
|
||||||
CLIExecWithReturn(ctx, Cmd, argtable, false);
|
CLIExecWithReturn(ctx, Cmd, argtable, false);
|
||||||
@@ -1990,7 +1990,7 @@ static int CmdLFHitagEload(const char *Cmd) {
|
|||||||
} else if (use_htm) {
|
} else if (use_htm) {
|
||||||
// a u dump is sized by the tag's ICR, so accept anything that fits
|
// a u dump is sized by the tag's ICR, so accept anything that fits
|
||||||
expected = 0;
|
expected = 0;
|
||||||
tname = "Hitag \xce\xbc";
|
tname = "Hitag µ";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (use_htm) {
|
if (use_htm) {
|
||||||
@@ -2053,7 +2053,7 @@ static int CmdLFHitagEview(const char *Cmd) {
|
|||||||
arg_lit0("1", "ht1", "Card type Hitag 1"),
|
arg_lit0("1", "ht1", "Card type Hitag 1"),
|
||||||
arg_lit0("2", "ht2", "Card type Hitag 2 (default)"),
|
arg_lit0("2", "ht2", "Card type Hitag 2 (default)"),
|
||||||
arg_lit0("s", "hts", "Card type Hitag S"),
|
arg_lit0("s", "hts", "Card type Hitag S"),
|
||||||
arg_lit0("m", "htm", "Card type Hitag \xce\xbc"),
|
arg_lit0("m", "htm", "Card type Hitag µ"),
|
||||||
arg_param_end
|
arg_param_end
|
||||||
};
|
};
|
||||||
CLIExecWithReturn(ctx, Cmd, argtable, true);
|
CLIExecWithReturn(ctx, Cmd, argtable, true);
|
||||||
@@ -2933,4 +2933,3 @@ int CmdLFHitag(const char *Cmd) {
|
|||||||
return CmdsParse(CommandTable, Cmd);
|
return CmdsParse(CommandTable, Cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Reference in new issue
Block a user