Skip to content

format strings for library and xbps-query - #542

Open
Duncaen wants to merge 32 commits into
void-linux:masterfrom
Duncaen:format
Open

format strings for library and xbps-query#542
Duncaen wants to merge 32 commits into
void-linux:masterfrom
Duncaen:format

Conversation

@Duncaen

@Duncaen Duncaen commented Feb 20, 2023

Copy link
Copy Markdown
Member

I'm not final on the api, don't really like the function names but couldn't come up with anything better.

Format strings are inspired by pythons f"" strings:

$ xbps-query -F '{pkgname:20}\n' -m | head
               Carla
         ImageMagick
        LuaJIT-devel
             MEGAcmd
              PolyMC
          SDL2-32bit
          SDL2-devel
            SDL2_gfx
      SDL2_gfx-32bit
          SDL2_image
$ xbps-query -F '{pkgver:-30} {installed_size:10h}\n' -m | head
Carla-2.5.1_2                        79MB
ImageMagick-7.1.0.62_1              398KB
LuaJIT-devel-2.1.0beta3_2           898KB
MEGAcmd-1.4.0_1                    1300KB
PolyMC-6.3_1                           0B
SDL2-32bit-2.26.3_1                1841KB
SDL2-devel-2.26.3_1                6150KB
SDL2_gfx-1.0.4_2                     72KB
SDL2_gfx-32bit-1.0.4_2               83KB
SDL2_image-2.6.2_1                  127KB
$ xbps-query -F '0x{installed_size:8zX}\n' -m | head
0x04F62C86
0x000636AA
0x000E08BA
0x0014512A
0x00000000
0x001CC564
0x006019F2
0x00012075
0x00014D9C
0x0001FA1D

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants