]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - k3conf/k3conf.git/blob - help.c
a8e78a2eef99597b32f165aa67ad4adf8e8aa229
[k3conf/k3conf.git] / help.c
1 /*
2  * Help Library for K3CONF
3  *
4  * Copyright (C) 2019 Texas Instruments Incorporated - http://www.ti.com/
5  *      Lokesh Vutla <lokeshvutla@ti.com>
6  *
7  *  Redistribution and use in source and binary forms, with or without
8  *  modification, are permitted provided that the following conditions
9  *  are met:
10  *
11  *    Redistributions of source code must retain the above copyright
12  *    notice, this list of conditions and the following disclaimer.
13  *
14  *    Redistributions in binary form must reproduce the above copyright
15  *    notice, this list of conditions and the following disclaimer in the
16  *    documentation and/or other materials provided with the
17  *    distribution.
18  *
19  *    Neither the name of Texas Instruments Incorporated nor the names of
20  *    its contributors may be used to endorse or promote products derived
21  *    from this software without specific prior written permission.
22  *
23  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26  *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27  *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28  *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29  *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30  *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31  *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32  *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33  *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34  */
36 #include <help.h>
37 #include <stdio.h>
39 void help(help_category cat)
40 {
41         if (cat >= HELP_CATEGORY_MAX) {
42                 fprintf(stderr, "help called with incorrect category!!! (%d)\n",
43                         cat);
44                 return;
45         }
47         if ((cat == HELP_ALL) || (cat == HELP_USAGE)) {
48                 printf("\nNAME\n");
49                 printf("\tk3conf - TI K3 Configuration Diagnostic Tool\n");
51                 printf("\nSYNOPSIS\n");
52                 printf("\tk3conf [--version] [--help] <command> [<args>]\n");
53                 if (cat == HELP_USAGE)
54                         printf("\n\tSee 'k3conf --help' for more information.\n\n");
55         }
57         if (cat == HELP_ALL) {
58                 printf("\nDESCRIPTION\n");
59                 printf("\tk3conf is standalone application designed to provide"
60                         " a quick'n easy way to \n\tdiagnose/debug/audit"
61                         " TI K3 architecture based processors configuration"
62                         " at\n\truntime, with no particular kernel dependency.\n");
63                 printf("\tk3conf is designed to be as much platform-agnostic"
64                         " as possible, being able to \n\trun on any Linux platform"
65                         " and easily ported to other OS.\n");
66                 printf("\tEven if k3conf today focuses mainly on TISCI"
67                         " related functionality, it is \n\tintended to be extended"
68                         " to any other area.\n");
70                 printf("\nOPTIONS\n");
71                 printf("\t--help\n");
72                 printf("\t    Print k3conf help.\n");
74                 printf("\n\t--version\n");
75                 printf("\t    Print k3conf version.\n");
76         }
77 }