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 9a482bac1d5886dfecc1e52979534355e0d5e02e..477a0996754d3f5ef6b72b41b304542cba9d5b8b 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 46702d618ff8f1868e70a8c63654790b6f4cbbe9..087a151360edc68d97aae3f83e1f6ec050bdb54d 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 cd2d901741e7fc3c8d34de49baf4b0d6a04854e8..3b8e147ecfb400a6b20789f246fa078c082cebcc 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 b047a8805e1c477c1773073320bd9804d6b91d0a..8a9c8de17375d1eb095304db142824dd244ea03a 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 26e8350e9404b41cbe61b4c673884d5a19188841..8bd8f5e8f525588cd7a9356a94e6abd022e8c1b3 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 6985d14baef68d420fd719bdfbc236ca250e4ccc..47523518402a2c6e60112e8299ecdf9ffd4d5627 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")