WIP: add python/rust style format strings
--print-format currently uses printf-style format strings, which have limited namespace (a-zA-Z), low flexibility (depends-with-version and depends-without-version have to be different sequences), and are difficult to remember (is %d depends or description?). Python/Rust format strings allow full word substitutions. In addition, the mfmt.c library being used makes it possible to extend the standard formatting for much greater control. For example, we can allow nested templates so that instead of having "{depends}" and "{depends-without-version}" variants, we can allow something like "{depends<{name}={version}: {description}>}". For example: pacman -Sp --pformat="{name}: {description} ({packager})" pacman
Showing
- lib/libalpm/alpm.h 3 additions, 0 deletionslib/libalpm/alpm.h
- lib/libalpm/info.c 226 additions, 0 deletionslib/libalpm/info.c
- lib/libalpm/meson.build 2 additions, 0 deletionslib/libalpm/meson.build
- lib/libalpm/mfmt.c 193 additions, 0 deletionslib/libalpm/mfmt.c
- lib/libalpm/mfmt.h 66 additions, 0 deletionslib/libalpm/mfmt.h
- src/pacman/conf.h 2 additions, 0 deletionssrc/pacman/conf.h
- src/pacman/pacman.c 4 additions, 0 deletionssrc/pacman/pacman.c
- src/pacman/util.c 4 additions, 0 deletionssrc/pacman/util.c
Loading
Please register or sign in to comment