mirror of
https://github.com/troglobit/finit.git
synced 2026-11-29 21:08:21 +00:00
initctl: shoow, adjust width of runlevels column, needs 12 chars
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
11026d9da3
commit
94aec26e8c
1 file changed
+6
-5
+6
-5
@@ -1,6 +1,6 @@
|
|||||||
/* New client tool, complements old /dev/initctl API and telinit tool
|
/* New client tool, complements old /dev/initctl API and telinit tool
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2016 Joachim Nilsson <troglobit@gmail.com>
|
* Copyright (c) 2015-2017 Joachim Nilsson <troglobit@gmail.com>
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@@ -422,7 +422,8 @@ static int show_version(char *arg)
|
|||||||
* @levels: Bit encoded runlevels
|
* @levels: Bit encoded runlevels
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* Pointer to string on the form [2345]
|
* Pointer to string on the form [2345], may be up to 12 chars long,
|
||||||
|
* plus escape sequences for highlighting current runlevel.
|
||||||
*/
|
*/
|
||||||
char *runlevel_string(int runlevel, int levels)
|
char *runlevel_string(int runlevel, int levels)
|
||||||
{
|
{
|
||||||
@@ -507,12 +508,12 @@ static int show_status(char *arg)
|
|||||||
|
|
||||||
lvls = runlevel_string(runlevel, svc->runlevels);
|
lvls = runlevel_string(runlevel, svc->runlevels);
|
||||||
if (strchr(lvls, '\e'))
|
if (strchr(lvls, '\e'))
|
||||||
printf("%-18.18s ", lvls);
|
printf("%-20.20s ", lvls);
|
||||||
else
|
else
|
||||||
printf("%-10.10s ", lvls);
|
printf("%-12.12s ", lvls);
|
||||||
|
|
||||||
if (!verbose) {
|
if (!verbose) {
|
||||||
int adj = screen_cols - 58;
|
int adj = screen_cols - 60;
|
||||||
char *name = strrchr(svc->cmd, '/');
|
char *name = strrchr(svc->cmd, '/');
|
||||||
|
|
||||||
if (!name)
|
if (!name)
|
||||||
|
|||||||
Reference in new issue
Block a user