Bug#510374: xmms2-client-cli: please respect unix conventions wrt output verbosity

2009-08-25 Thread Benjamin Drung
tags 510374 = pending
thanks

Hi Jan,

thanks for the patch. It's included now.

Cheers,
Benjamin


signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


Bug#510374: xmms2-client-cli: please respect unix conventions wrt output verbosity

2009-08-21 Thread Jan Braun
Benjamin Drung schrob:
 thanks for this patch. One thing is missing: running xmms2 with
 --verbose / -v should trigger the previous behavior.

Here you go...

Jan
-- 
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments
diff -ru cli.orig/cmd_pls.c cli/cmd_pls.c
--- cli.orig/cmd_pls.c	2009-08-21 11:05:46.0 +0200
+++ cli/cmd_pls.c	2009-08-21 11:38:05.0 +0200
@@ -38,7 +38,7 @@
 
 	url = format_url (item, G_FILE_TEST_IS_REGULAR);
 	if (!url) {
-		print_error (Invalid url);
+		print_error (Invalid url: %s, item);
 	}
 
 	res = xmmsc_playlist_add_url (conn, playlist, url);
@@ -51,7 +51,9 @@
 	}
 	xmmsc_result_unref (res);
 
-	print_info (Added %s, item);
+	if (verbose) {
+print_info (Added %s, item);
+}
 }
 
 
@@ -211,7 +213,7 @@
 	if (!url) {
 		url = format_url (argv[3], G_FILE_TEST_IS_REGULAR);
 		if (!url) {
-			print_error (Invalid url);
+			print_error (Invalid url: %s, argv[3]);
 		} else {
 			/* FIXME: Fulhack to check for optional playlist argument */
 			playlist = argv[2];
@@ -258,7 +260,7 @@
 	}
 
 	if (!url) {
-		print_error (Invalid url);
+		print_error (Invalid url: %s, (*endptr == '\0') ? argv[3] : argv[4] );
 	}
 
 	res = xmmsc_playlist_insert_url (conn, playlist, pos, url);
diff -ru cli.orig/common.h cli/common.h
--- cli.orig/common.h	2009-08-21 11:05:46.0 +0200
+++ cli/common.h	2009-08-21 11:19:58.0 +0200
@@ -31,6 +31,8 @@
 	void (*func) (xmmsc_connection_t *conn, int argc, char **argv);
 } cmds;
 
+gboolean verbose;
+
 gboolean x_realpath (const gchar *item, gchar *rpath);
 gchar *x_path2url (gchar *path);
 gchar *format_url (gchar *item, GFileTest test);
diff -ru cli.orig/main.c cli/main.c
--- cli.orig/main.c	2009-08-21 11:05:46.0 +0200
+++ cli/main.c	2009-08-21 11:39:24.0 +0200
@@ -237,6 +237,16 @@
 
 	setlocale (LC_ALL, );
 
+verbose = FALSE;
+while ( argc 1  ( !g_ascii_strcasecmp (argv[1], -v) ||
+!g_ascii_strcasecmp (argv[1], --verbose) )
+) {
+verbose = TRUE;
+argv[1] = argv[0];
+--argc;
+++argv;
+}
+
 	config = read_config ();
 	atexit (free_config);
 


Bug#510374: xmms2-client-cli: please respect unix conventions wrt output verbosity

2009-08-20 Thread Jan Braun
tags 510374 + patch
thanks

HTH,
Jan

-- 
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments
--- ./clients/cli/cmd_pls.c.orig	2009-08-20 16:28:17.0 +0200
+++ ./clients/cli/cmd_pls.c	2009-08-20 16:28:20.0 +0200
@@ -38,7 +38,7 @@
 
 	url = format_url (item, G_FILE_TEST_IS_REGULAR);
 	if (!url) {
-		print_error (Invalid url);
+		print_error (Invalid url: %s, item);
 	}
 
 	res = xmmsc_playlist_add_url (conn, playlist, url);
@@ -51,7 +51,7 @@
 	}
 	xmmsc_result_unref (res);
 
-	print_info (Added %s, item);
+	//print_info (Added %s, item);
 }
 
 
@@ -211,7 +211,7 @@
 	if (!url) {
 		url = format_url (argv[3], G_FILE_TEST_IS_REGULAR);
 		if (!url) {
-			print_error (Invalid url);
+			print_error (Invalid url: %s, argv[3]);
 		} else {
 			/* FIXME: Fulhack to check for optional playlist argument */
 			playlist = argv[2];
@@ -258,7 +258,7 @@
 	}
 
 	if (!url) {
-		print_error (Invalid url);
+		print_error (Invalid url: %s, (*endptr == '\0') ? argv[3] : argv[4] );
 	}
 
 	res = xmmsc_playlist_insert_url (conn, playlist, pos, url);


Bug#510374: xmms2-client-cli: please respect unix conventions wrt output verbosity

2009-08-20 Thread Benjamin Drung
Hi Jan,

thanks for this patch. One thing is missing: running xmms2 with
--verbose / -v should trigger the previous behavior.

Cheers,
Benjamin


signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


Bug#510374: xmms2-client-cli: please respect unix conventions wrt output verbosity

2009-01-01 Thread Jan Braun
Package: xmms2-client-cli
Version: 0.5DrLecter-2
Severity: minor

Hi,
common unix convention for CLI programs is being silent for successful
operations, and being verbose on errors. xmms2 gets both wrong:

$ ls some.ogg doesnotexist.ogg
ls: cannot access doesnotexist.ogg: No such file or directory
some.ogg
$ xmms2 add some.ogg doesnotexist.ogg
Added some.ogg
ERROR: Invalid url
$ 

It should not mention the successful add of some.ogg at all (IMHO), and
provide the filename/URL of doesnotexist.ogg in the error message.
Both is particularly annoying when adding multiple files via find(1).
Thanks for considering,
Jan

-- System Information:
Debian Release: 5.0
  APT prefers testing
  APT policy: (990, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-1-686 (SMP w/1 CPU core)
Locale: LANG=C, LC_CTYPE=de_DE (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/dash

Versions of packages xmms2-client-cli depends on:
ii  libc6  2.7-16GNU C Library: Shared libraries
ii  libglib2.0-0   2.16.6-1  The GLib library of C routines
ii  libxmmsclient-glib10.5DrLecter-2 XMMS2 - glib client library
ii  libxmmsclient4 0.5DrLecter-2 XMMS2 - client library

xmms2-client-cli recommends no packages.

Versions of packages xmms2-client-cli suggests:
ii  xmms2-core 0.5DrLecter-2 XMMS2 - core package

-- no debconf information

-- 
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org