add brief help strings to query/config/action declarations
authorChristian Thaeter <ct@pipapo.org>
Sun, 16 Dec 2007 17:35:35 +0000 (18:35 +0100)
committerChristian Thaeter <ct@pipapo.org>
Sun, 16 Dec 2007 17:35:35 +0000 (18:35 +0100)
src/actions.c
src/actions.h
src/options.c
src/options.h
src/query.c
src/query.h

index 9a482ba..477a099 100644 (file)
@@ -82,7 +82,7 @@ ctgit_commit_action (struct ctgit_query* query)
 Html
 ctgit_action_dispatch (struct ctgit_query* query)
 {
-#define CTGIT_ACTION(name) {#name, ctgit_##name##_action},
+#define CTGIT_ACTION(name, _) {#name, ctgit_##name##_action},
   struct action_table{
     char* name;
     Html (*cb)(struct ctgit_query* query);
index 46702d6..087a151 100644 (file)
 /*
   Pages presented to the user and other main actions
 */
-#define CTGIT_ACTIONS                           \
- CTGIT_ACTION(main)                             \
- CTGIT_ACTION(summary)                          \
- CTGIT_ACTION(log)                              \
- CTGIT_ACTION(diff)                             \
- CTGIT_ACTION(object)                           \
- CTGIT_ACTION(raw)                              \
- CTGIT_ACTION(tag)                              \
- CTGIT_ACTION(edit)                             \
- CTGIT_ACTION(commit)
+#define CTGIT_ACTIONS                                           \
+ CTGIT_ACTION(main, "Display a list of available repositories") \
+ CTGIT_ACTION(summary, "Show an overview page of a repository") \
+ CTGIT_ACTION(log, "Browse the logs")                           \
+ CTGIT_ACTION(diff, "Show the diff between two objects")        \
+ CTGIT_ACTION(object, "Show an object, pretty format")          \
+ CTGIT_ACTION(raw, "Show an object, raw format")                \
+ CTGIT_ACTION(tag, "Show and manage tags")                      \
+ CTGIT_ACTION(edit, "Edit and object")                          \
+ CTGIT_ACTION(commit, "Commit pending edits")
 
 Html
 ctgit_action_dispatch (struct ctgit_query* query);
index cd2d901..3b8e147 100644 (file)
@@ -61,7 +61,7 @@ cgit_options_defaults (struct ctgit_query* query)
 int
 ctgit_commandline_dispatch (int argc, char**argv, struct ctgit_query* query)
 {
-#define CONF_OPT(name) {"--"#name, conf_##name##_opt},
+#define CONF_OPT(name, _) {"--"#name, conf_##name##_opt},
   struct cmd_table{
     char* name;
     int (*cb)(struct ctgit_query* query, char* arg);
index b047a88..8a9c8de 100644 (file)
@@ -27,9 +27,9 @@
   config options
 */
 #define CONF_OPTS                               \
- CONF_OPT(query)                                \
- CONF_OPT(method)                               \
- CONF_OPT(repo)
+ CONF_OPT(query, "Set the QUERY_STRING [diag]") \
+ CONF_OPT(method, "Set REQUEST_METHOD [diag]")  \
+ CONF_OPT(repo, "Add a repository")
 
 // CONF_OPT(conffile) CONF_OPT(include)
 
index 26e8350..8bd8f5e 100644 (file)
@@ -112,7 +112,7 @@ ctgit_param_dispatch (const Cgi self,
                       size_t value_len,
                       void* user_data)
 {
-#define CTGIT_PARAM(name) {#name, ctgit_##name##_param},
+#define CTGIT_PARAM(name, _) {#name, ctgit_##name##_param},
   struct param_table{
     char* name;
     void (*cb)(const Cgi, const char* v, size_t v_sz, void* u_dat);
index 6985d14..4752351 100644 (file)
 /*
   parameters for cgit requests
 */
-#define CTGIT_PARAMS                            \
- CTGIT_PARAM(repo)                              \
- CTGIT_PARAM(action)                            \
- CTGIT_PARAM(head)                              \
- CTGIT_PARAM(object)
+#define CTGIT_PARAMS                                            \
+ CTGIT_PARAM(repo, "Repository to be queried")                  \
+ CTGIT_PARAM(action, "Action to be performed")                  \
+ CTGIT_PARAM(ref, "Selected ref (branch, tag, ..) for query")   \
+ CTGIT_PARAM(object, "Object to perform on")