On 09/17/2013 08:51 AM, Ivana Hutarova Varekova wrote:
> This change is suggested by Dhaval Giani <dhaval.gi...@gmail.com>.
> Polish "usage" function of cgget tool. Remove a level of indentation.
> Use printf instead of fprintf(stdout,...)
> 
> Signed-off-by: Ivana Hutarova Varekova <varek...@redhat.com>

Acked-By: Jan Safranek <jsafr...@redhat.com>

> ---
> 
>  src/tools/cgget.c |   39 ++++++++++++++++++---------------------
>  1 files changed, 18 insertions(+), 21 deletions(-)
> 
> diff --git a/src/tools/cgget.c b/src/tools/cgget.c
> index e1e1d60..4764f14 100644
> --- a/src/tools/cgget.c
> +++ b/src/tools/cgget.c
> @@ -33,31 +33,28 @@ enum group{
>  
>  static void usage(int status, const char *program_name)
>  {
> -     if (status != 0)
> +     if (status != 0) {
>               fprintf(stderr, "Wrong input parameters,"
>                       " try %s -h' for more information.\n",
>                       program_name);
> -     else {
> -             fprintf(stdout, "Usage: %s [-nv] [-r <name>] "\
> -                     "[-g <controllers>] [-a] <path> ...\n", program_name);
> -             fprintf(stdout, "   or: %s [-nv] [-r <name>] "\
> -                     "-g <controllers>:<path> ...\n", program_name);
> -             fprintf(stdout, "Print parameter(s) of given group(s).\n");
> -             fprintf(stdout, "  -a, --all                    "\
> -                     "Print info about all relevant controllers\n");
> -             fprintf(stdout, "  -g <controllers>             "\
> -                     "Controller which info should be displayed\n");
> -             fprintf(stdout, "  -g <controllers>:<path>      "\
> -                     "Control group which info should be displayed\n");
> -             fprintf(stdout, "  -h, --help                   "\
> -                     "Display this help\n");
> -             fprintf(stdout, "  -n                           "\
> -                     "Do not print headers\n");
> -             fprintf(stdout, "  -r, --variable <name>        "\
> -                     "Define parameter to display\n");
> -             fprintf(stdout, "  -v, --values-only            "\
> -                     "Print only values, not parameter names\n");
> +             return;
>       }
> +     printf("Usage: %s [-nv] [-r <name>] [-g <controllers>] "\
> +             "[-a] <path> ...\n"\
> +             "   or: %s [-nv] [-r <name>] -g <controllers>:<path> ...\n",
> +             program_name, program_name);
> +     printf("Print parameter(s) of given group(s).\n");
> +     printf("  -a, --all                     Print info about all relevant "\
> +             "controllers\n");
> +     printf("  -g <controllers>              Controller which info should "\
> +             "be displayed\n");
> +     printf("  -g <controllers>:<path>       Control group which info "\
> +             "should be displayed\n");
> +     printf("  -h, --help                    Display this help\n");
> +     printf("  -n                            Do not print headers\n");
> +     printf("  -r, --variable  <name>        Define parameter to display\n");
> +     printf("  -v, --values-only             Print only values, not "\
> +             "parameter names\n");
>  }
>  
>  static int display_record(char *name,
> 
> 
> ------------------------------------------------------------------------------
> LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
> 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
> 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
> Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
> http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
> _______________________________________________
> Libcg-devel mailing list
> Libcg-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/libcg-devel
> 


------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
Libcg-devel mailing list
Libcg-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to