This stacks on top of Zbyszek's patch to fix column title alignment.

On Thu, Jul 26, 2012 at 1:42 PM,  <[email protected]> wrote:
> From: David Strauss <[email protected]>
>
> ---
>  src/cgtop/cgtop.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c
> index fde31b9..33e78b0 100644
> --- a/src/cgtop/cgtop.c
> +++ b/src/cgtop/cgtop.c
> @@ -450,13 +450,13 @@ static int display(Hashmap *a) {
>          if (path_columns < 10)
>                  path_columns = 10;
>
> -        printf("%s%-37s%s %s%7s%s %s%6s%s %s%8s%s %s%8s%s %s%8s%s\n\n",
> -               arg_order == ORDER_PATH   ? ANSI_HIGHLIGHT_ON : "", "Path",   
>   arg_order == ORDER_PATH   ? ANSI_HIGHLIGHT_OFF : "",
> -               arg_order == ORDER_TASKS  ? ANSI_HIGHLIGHT_ON : "", "Tasks",  
>   arg_order == ORDER_TASKS  ? ANSI_HIGHLIGHT_OFF : "",
> -               arg_order == ORDER_CPU    ? ANSI_HIGHLIGHT_ON : "", "%CPU",   
>   arg_order == ORDER_CPU    ? ANSI_HIGHLIGHT_OFF : "",
> -               arg_order == ORDER_MEMORY ? ANSI_HIGHLIGHT_ON : "", "Memory", 
>   arg_order == ORDER_MEMORY ? ANSI_HIGHLIGHT_OFF : "",
> -               arg_order == ORDER_IO     ? ANSI_HIGHLIGHT_ON : "", 
> "Input/s",  arg_order == ORDER_IO     ? ANSI_HIGHLIGHT_OFF : "",
> -               arg_order == ORDER_IO     ? ANSI_HIGHLIGHT_ON : "", 
> "Output/s", arg_order == ORDER_IO     ? ANSI_HIGHLIGHT_OFF : "");
> +        printf("%s%-*s%s %s%7s%s %s%6s%s %s%8s%s %s%8s%s %s%8s%s\n\n",
> +               arg_order == ORDER_PATH   ? ANSI_HIGHLIGHT_ON : "", 
> path_columns, "Path",     arg_order == ORDER_PATH   ? ANSI_HIGHLIGHT_OFF : "",
> +               arg_order == ORDER_TASKS  ? ANSI_HIGHLIGHT_ON : "",           
>     "Tasks",    arg_order == ORDER_TASKS  ? ANSI_HIGHLIGHT_OFF : "",
> +               arg_order == ORDER_CPU    ? ANSI_HIGHLIGHT_ON : "",           
>     "%CPU",     arg_order == ORDER_CPU    ? ANSI_HIGHLIGHT_OFF : "",
> +               arg_order == ORDER_MEMORY ? ANSI_HIGHLIGHT_ON : "",           
>     "Memory",   arg_order == ORDER_MEMORY ? ANSI_HIGHLIGHT_OFF : "",
> +               arg_order == ORDER_IO     ? ANSI_HIGHLIGHT_ON : "",           
>     "Input/s",  arg_order == ORDER_IO     ? ANSI_HIGHLIGHT_OFF : "",
> +               arg_order == ORDER_IO     ? ANSI_HIGHLIGHT_ON : "",           
>     "Output/s", arg_order == ORDER_IO     ? ANSI_HIGHLIGHT_OFF : "");
>
>          for (j = 0; j < n; j++) {
>                  char *p;
> --
> 1.7.11.2
>



-- 
David Strauss
   | [email protected]
   | +1 512 577 5827 [mobile]
_______________________________________________
systemd-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to