Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync with Q2PRO: Client console input (cmds & cvars) #374

Merged
merged 23 commits into from
Feb 17, 2024
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
7a27997
Auto resize long options column.
skullernet Oct 29, 2022
039326e
Reset aliasCount once per command buffer frame.
skullernet Nov 10, 2022
6fb9aec
Increment aliasCount only if Cmd_ExecuteFile() succeedes.
skullernet Nov 10, 2022
92c6747
Forbid changing ‘game’ from menu.
skullernet Nov 10, 2022
8a43f98
Clear archive flag if not compatible with other flags.
skullernet Nov 10, 2022
70ccdcb
List weak cvars like custom cvars.
skullernet Nov 10, 2022
369f735
Pass wildcard as regular argument to ‘cvarlist’.
skullernet Nov 10, 2022
4b3af5b
Make ‘text’ command insert text rather than append.
skullernet Nov 11, 2022
ffaf429
Make ‘remotemode’ more usable and document it.
skullernet Nov 11, 2022
9adf120
Remove ‘togglechat’ command.
skullernet Nov 11, 2022
aa7dbb9
Add ‘con_auto_chat’ variable.
skullernet Nov 11, 2022
d513454
Use Cmd_Print*() helpers in Cmd_UnAlias_f().
skullernet Nov 20, 2022
47b306a
Make Cbuf_Add/InsertText() less susceptible to integer overflow.
skullernet Nov 21, 2022
1677787
Remove unused typedef.
skullernet Dec 10, 2022
69b6391
Allow specifying message level for ‘_echo’ command.
skullernet Dec 27, 2022
356fbcd
Skip leading whitespace in Cmd_TokenizeString().
skullernet Jan 6, 2023
f647d0d
Remove unused command entries.
skullernet Jan 7, 2023
714ff74
Make ‘if’ command insert raw command args.
skullernet Feb 14, 2023
2208e50
Strip quotes from ‘if’ command arguments.
skullernet Apr 24, 2023
0a63e1c
Rename function.
skullernet Aug 3, 2023
56129ea
Discard oversize lines in Cbuf_Execute().
skullernet Aug 6, 2023
3944dbe
Add newline in EXEC_TRIGGER().
skullernet Aug 8, 2023
53c3034
Parse octal escape sequences for ‘_echo -e’.
skullernet Aug 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Auto resize long options column.
  • Loading branch information
skullernet authored and res2k committed Feb 4, 2024
commit 7a2799742ad9a82a248d1ebdde1df74081a08dbc
11 changes: 10 additions & 1 deletion src/common/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,16 @@ void Cmd_PrintUsage(const cmd_option_t *opt, const char *suffix)

void Cmd_PrintHelp(const cmd_option_t *opt)
{
const cmd_option_t *o;
char buffer[32];
int width = 0;

for (o = opt; o->sh; o++) {
int len = strlen(o->lo);
if (o->sh[1] == ':')
len += 3 + strlen(o->sh + 2);
width = max(width, min(len, 31));
}

Com_Printf("\nAvailable options:\n");
while (opt->sh) {
Expand All @@ -1089,7 +1098,7 @@ void Cmd_PrintHelp(const cmd_option_t *opt)
} else {
Q_strlcpy(buffer, opt->lo, sizeof(buffer));
}
Com_Printf("-%c | --%-16.16s | %s\n", opt->sh[0], buffer, opt->help);
Com_Printf("-%c | --%*s | %s\n", opt->sh[0], -width, buffer, opt->help);
opt++;
}
Com_Printf("\n");
Expand Down