pki: Indent usage lines properly automatically
This commit is contained in:
+4
-4
@@ -191,7 +191,7 @@ void command_register(command_t command)
|
|||||||
int command_usage(char *error)
|
int command_usage(char *error)
|
||||||
{
|
{
|
||||||
FILE *out = stdout;
|
FILE *out = stdout;
|
||||||
int i;
|
int i, indent = 0;
|
||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
@@ -221,12 +221,12 @@ int command_usage(char *error)
|
|||||||
{
|
{
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
{
|
{
|
||||||
fprintf(out, " pki --%s %s\n",
|
indent = fprintf(out, " pki --%s ", cmds[active].cmd);
|
||||||
cmds[active].cmd, cmds[active].line[i]);
|
fprintf(out, "%s\n", cmds[active].line[i]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fprintf(out, " %s\n", cmds[active].line[i]);
|
fprintf(out, "%*s%s\n", indent, "", cmds[active].line[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (i = 0; cmds[active].options[i].name; i++)
|
for (i = 0; cmds[active].options[i].name; i++)
|
||||||
|
|||||||
Reference in New Issue
Block a user