pactree: unify output between utf8 and ascii
Ensure that both output formats have equal spacing, and therefore an equivalent layout. This change also removes the styling from the toplevel package being searched for. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
8054a254cb
commit
d9e8197e60
1 changed files with 20 additions and 16 deletions
|
@ -56,15 +56,15 @@ static struct graph_style graph_utf8 = {
|
||||||
UTF_VR UTF_H,
|
UTF_VR UTF_H,
|
||||||
UTF_UR UTF_H,
|
UTF_UR UTF_H,
|
||||||
UTF_V " ",
|
UTF_V " ",
|
||||||
3
|
2
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct graph_style graph_default = {
|
static struct graph_style graph_default = {
|
||||||
" provides",
|
" provides",
|
||||||
"|--",
|
"|-",
|
||||||
"`--",
|
"`-",
|
||||||
"|",
|
"|",
|
||||||
3
|
2
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct graph_style graph_linear = {
|
static struct graph_style graph_linear = {
|
||||||
|
@ -335,25 +335,29 @@ static void cleanup(void)
|
||||||
static void print_text(const char *pkg, const char *provision,
|
static void print_text(const char *pkg, const char *provision,
|
||||||
tdepth *depth, int last)
|
tdepth *depth, int last)
|
||||||
{
|
{
|
||||||
const char* tip = last ? style->last : style->tip;
|
const char* tip = "";
|
||||||
int level = 0;
|
int level = 0;
|
||||||
if(!pkg && !provision) {
|
if(!pkg && !provision) {
|
||||||
/* not much we can do */
|
/* not much we can do */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* print limbs */
|
if(depth->level > 0) {
|
||||||
while(depth->prev) {
|
tip = last ? style->last : style->tip;
|
||||||
depth = depth->prev;
|
|
||||||
|
/* print limbs */
|
||||||
|
while(depth->prev) {
|
||||||
|
depth = depth->prev;
|
||||||
|
}
|
||||||
|
printf("%s", color->branch1);
|
||||||
|
while(depth->next){
|
||||||
|
printf("%*s%-*s", style->indent * (depth->level - level), "",
|
||||||
|
style->indent, style->limb);
|
||||||
|
level = depth->level + 1;
|
||||||
|
depth = depth->next;
|
||||||
|
}
|
||||||
|
printf("%*s", style->indent * (depth->level - level), "");
|
||||||
}
|
}
|
||||||
printf("%s", color->branch1);
|
|
||||||
while(depth->next){
|
|
||||||
printf("%*s%-*s", style->indent * (depth->level - level), "",
|
|
||||||
style->indent, style->limb);
|
|
||||||
level = depth->level + 1;
|
|
||||||
depth = depth->next;
|
|
||||||
}
|
|
||||||
printf("%*s", style->indent * (depth->level - level), "");
|
|
||||||
|
|
||||||
/* print tip */
|
/* print tip */
|
||||||
if(!pkg && provision) {
|
if(!pkg && provision) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue