Mikescher / better-docker-ps

Because `docker ps` is annoying and does not fit my monitor/terminal width
MIT License
119 stars 3 forks source link

Change default formatting order #8

Closed jackra1n closed 3 months ago

jackra1n commented 5 months ago

I was wondering if there is some config file or something where I can write what format in what order is used when using better docker ps. I know that I can format it like shown in this comment https://github.com/Mikescher/better-docker-ps/issues/2#issuecomment-1365184997 but I would like to change the default order permanently. Thanks

jackra1n commented 5 months ago

I realized one (not so pretty) solution is that i can redefine all the table formats as a alias

alias dops='dops --format "table {{.ID}}\\t{{.Names}}\\t{{.ImageName}}\\t{{.Tag}}\\t{{.ShortCommand}}\\t{{.CreatedAt
}}\\t{{.State}}\\t{{.Status}}\\t{{.LongPublishedPorts}}\\t{{.Networks}}\\t{{.IP}}" --format "table {{.ID}}\\t{{.Name
s}}\\t{{.ImageName}}\\t{{.Tag}}\\t{{.ShortCommand}}\\t{{.CreatedAt}}\\t{{.State}}\\t{{.Status}}\\t{{.LongPublishedPo
rts}}\\t{{.IP}}" --format "table {{.ID}}\\t{{.Names}}\\t{{.ImageName}}\\t{{.Tag}}\\t{{.CreatedAt}}\\t{{.State}}\\t{{
.Status}}\\t{{.LongPublishedPorts}}\\t{{.IP}}" --format "table {{.ID}}\\t{{.Names}}\\t{{.ImageName}}\\t{{.Tag}}\\t{{
.CreatedAt}}\\t{{.State}}\\t{{.Status}}\\t{{.PublishedPorts}}\\t{{.IP}}" --format "table {{.ID}}\\t{{.Names}}\\t{{.I
mageName}}\\t{{.Tag}}\\t{{.CreatedAt}}\\t{{.State}}\\t{{.Status}}\\t{{.PublishedPorts}}" --format "table {{.ID}}\\t{
{.Names}}\\t{{.ImageName}}\\t{{.Tag}}\\t{{.State}}\\t{{.Status}}\\t{{.PublishedPorts}}" --format "table {{.ID}}\\t{{
.Names}}\\t{{.Tag}}\\t{{.State}}\\t{{.Status}}\\t{{.PublishedPorts}}" --format "table {{.ID}}\\t{{.Names}}\\t{{.Tag}
}\\t{{.State}}\\t{{.Status}}\\t{{.ShortPublishedPorts}}" --format "table {{.ID}}\\t{{.Names}}\\t{{.State}}\\t{{.Stat
us}}"\\t{{.PublishedPorts}} --format "table {{.ID}}\\t{{.Names}}\\t{{.State}}\\t{{.Status}}" --format "table {{.ID}}
\\t{{.Names}}\\t{{.State}}" --format "table {{.Names}}\\t{{.State}}" --format "table {{.Names}}" --format "table {{.
ID}}"'
Mikescher commented 3 months ago

I added support for a config file in ~/.config/dops.conf.
Should be included in the next release

jackra1n commented 3 months ago

thank you!