-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move most of the logic from main into functions? #19
Comments
Hello, Thank you for your interest in smenu. smenu is indeed not very modular and I am working to improve this point. Regarding your need, smenu was designed as an interactive filter that can be used in a pipeline and not as a library of functions. Why not use it like that by applying the unix philosophy? |
I am working on a project that generates a list of options, and then user is interactively asked to pick one or more of those options and then my project further processes those options. I can do something like The idea is that I strictly control how The best way would be to get an Plan B would be to do a shell call from within Proposed API for
|
I'll think about the interest of an evolution for such a use case. For now, simply choose Plan B. |
Ok, thanks for considering this proposal. |
Hello,
I am using the Nim language (https://nim-lang.org) which interfaces with C language seamlessly.
I'd like to use your project as a library where the input is a pointer to array of strings (and all the smenu options) and output is an another pointer to an array of strings.
Would it be possible for you to pack the core of smenu into such function whose API you provide via
smenu.h
?In main, you then probably just parse the command line switches and pass the appropriate args to the
smenu
function.Thoughts?
PS: I started with wrapping the
smenu.h
here, but then realized that I cannot do much with it as most of the smenu code is inline in themain
.To use smenu via Nim, I'd then need to literally translate all the C code to Nim manually.
The text was updated successfully, but these errors were encountered: