aboutsummaryrefslogtreecommitdiffstats
path: root/convert-to-enclosed.c
diff options
context:
space:
mode:
Diffstat (limited to 'convert-to-enclosed.c')
-rw-r--r--convert-to-enclosed.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/convert-to-enclosed.c b/convert-to-enclosed.c
new file mode 100644
index 0000000..8127b2f
--- /dev/null
+++ b/convert-to-enclosed.c
@@ -0,0 +1,22 @@
+/* See LICENSE file for copyright and license details. */
+#include "common.h"
+
+USAGE("[-n | -p]");
+
+
+int
+main(int argc, char *argv[])
+{
+ int negative = 0;
+
+ ARGBEGIN {
+ case 'n': negative = 1; break;
+ case 'p': negative = 0; break;
+ default:
+ usage();
+ } ARGEND;
+ if (argc)
+ usage();
+
+ return convert(negative ? &libcharconv_enclosed_negative : &libcharconv_enclosed_positive);
+}