Skip to content

Instantly share code, notes, and snippets.

@kana
Created August 21, 2010 05:27
Show Gist options
  • Save kana/541817 to your computer and use it in GitHub Desktop.
Save kana/541817 to your computer and use it in GitHub Desktop.
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 016a2b5..f1405ac 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -466,6 +466,12 @@ static void ex_folddo __ARGS((exarg_T *eap));
#define DO_DECLARE_EXCMD
#include "ex_cmds.h"
+int
+number_of_ex_commands()
+{
+ return sizeof(cmdnames) / sizeof(cmdnames[0]);
+}
+
/*
* Table used to quickly search for a command, based on its first character.
*/
diff --git a/src/main.c b/src/main.c
index 954384a..2e436a8 100644
--- a/src/main.c
+++ b/src/main.c
@@ -173,6 +173,9 @@ main
int i;
#endif
+ printf("I know %d Ex commands!\n", number_of_ex_commands());
+ return 0;
+
/*
* Do any system-specific initialisations. These can NOT use IObuff or
* NameBuff. Thus emsg2() cannot be called!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment