Cloudef / bemenu

Dynamic menu library and client program inspired by dmenu
GNU General Public License v3.0
1.16k stars 90 forks source link

Move command-line option parsing code to the library #388

Open nmeum opened 4 months ago

nmeum commented 4 months ago

Currently, the code for parsing command-line options and the BEMENU_OPTS environment variable lives in client/common/common.c. As such, it is not part of the bemenu library and programs building on the bemenu library which want to support BEMENU_OPTS (e.g. to ensure a consistent look of spawned bemenu interfaces) need to duplicate this option parsing logic. As an example, consider the options.c file from pinentry-bemenu. In order to avoid this code duplication, I want to propose moving parts of the command-line option parsing logic to the bemenu library to allow its re-use.

Thoughts?

Cloudef commented 4 months ago

There is wip code here that should be upated https://github.com/Cloudef/bemenu/tree/wip-argument-parsing-in-library