summaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/regex1.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/examples/regex1.c b/examples/regex1.c
index 7385d69e..e24e5400 100644
--- a/examples/regex1.c
+++ b/examples/regex1.c
@@ -1,8 +1,12 @@
#include <stc/cstr.h>
#include <stc/cregex.h>
-int main()
+int main(int argc, char* argv[])
{
+ if (argc <= 1) {
+ printf("Usage: regex1 -i\n");
+ return 0;
+ }
c_auto (cstr, input)
c_auto (cregex, float_expr)
{
@@ -10,7 +14,7 @@ int main()
// Until "q" is given, ask for another number
while (true)
{
- printf("Enter float number (q for quit): ");
+ printf("Enter a double precision number (q for quit): ");
cstr_getline(&input, stdin);
// Exit when the user inputs q