systemctl: hide the 'glyph' column when --no-legend is requested#15081
Merged
anitazha merged 2 commits intosystemd:masterfrom Mar 11, 2020
Merged
systemctl: hide the 'glyph' column when --no-legend is requested#15081anitazha merged 2 commits intosystemd:masterfrom
anitazha merged 2 commits intosystemd:masterfrom
Conversation
keszybz
reviewed
Mar 11, 2020
Member
keszybz
left a comment
There was a problem hiding this comment.
I think this is OK. It doesn't have to be the most efficient code. Clarity is more important.
But I think it'd help to do the move suggested below. Less chance of forgetting to do the initialization later on.
keszybz
reviewed
Mar 11, 2020
e17264d to
c751794
Compare
keszybz
requested changes
Mar 11, 2020
c751794 to
8d84ba5
Compare
without having to specify the whole display map
8d84ba5 to
d171e67
Compare
dgdavid
added a commit
to yast/yast-storage-ng
that referenced
this pull request
Oct 14, 2021
Needed to avoid getting the `glyph` column which is causing the issue reported at https://bugzilla.suse.com/show_bug.cgi?id=1191347 about not unmasking systemd mount and swap units when leaving the partitioner. At some point --no-legend systemd flag was enough but it is not the case anymore. See systemd/systemd#15081.
dgdavid
added a commit
to yast/yast-storage-ng
that referenced
this pull request
Oct 14, 2021
Needed to avoid getting the `glyph` column which is causing the issue reported at https://bugzilla.suse.com/show_bug.cgi?id=1191347 about not unmasking systemd mount and swap units when leaving the partitioner. At some point --no-legend systemd flag was enough but it is not the case anymore. See systemd/systemd#15081.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The former implementation of
systemctl list-unitsandmachinectl listhid the glyph column when called with--no-legend. This somehow got lost during the conversion to theformat-table.[ch]stuff.Fixes: #15077
As the formatting stuff doesn't allow hiding a specific column without giving the
table_set_display()function the whole display map except the columns we want to hide, I wrote a simple function just for that, otherwise the code would get really ugly (insystemctl list-unitswe want to hide column 0 when--no-legendis specified and column 5 when the job list is empty). However, as the table formatting mechanism allows specifying columns to show/hide only when the display map is set, the function depends just on that, which feels... wrong, thus any comments are definitely welcome.@poettering, @keszybz PTAL.