Skip to content

Commit

Permalink
Improve -n and autoremove output formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Perkin committed Jun 29, 2018
1 parent 22168e1 commit 1c1386e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions actions.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ action_list(char *flatlist, char *str)
* we try to fit them indented into the current line length.
*/
if (flatlist == NULL) {
flatlist = xasprintf("%s%s", noflag ? "\n" : " ", str);
flatlist = xasprintf("%s%s", noflag ? "" : " ", str);
return flatlist;
}

Expand Down Expand Up @@ -761,7 +761,8 @@ pkgin_remove(char **pkgargs)

if (todelete != NULL) {
printf(MSG_PKGS_TO_DELETE, deletenum, todelete);
printf("\n");
if (!noflag)
printf("\n");
if (check_yesno(DEFAULT_YES)) {
do_pkg_remove(removehead);

Expand Down
3 changes: 2 additions & 1 deletion autoremove.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ pkgin_autoremove(void)
toremove = action_list(toremove, premove->depend);

printf(MSG_AUTOREMOVE_PKGS, removenb, toremove);

if (!noflag)
printf("\n");
if (check_yesno(DEFAULT_YES)) {
do_pkg_remove(orderedhead);

Expand Down
2 changes: 1 addition & 1 deletion messages.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@

/* autoremove.c */
#define MSG_ALL_KEEP_PKGS "all packages are marked as \"keepable\"\n."
#define MSG_AUTOREMOVE_PKGS "%d packages to be autoremoved: %s\n"
#define MSG_AUTOREMOVE_PKGS "%d packages to be autoremoved:\n%s\n"
#define MSG_MARK_PKG_KEEP "%s is marked as non-autoremovable\n"
#define MSG_MARK_PKG_NOKEEP "%s is marked as autoremovable\n"
#define MSG_MARKING_PKG_KEEP "marking %s as non auto-removable\n"
Expand Down

0 comments on commit 1c1386e

Please sign in to comment.