Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] alsa-info.sh: add command-line flag to print alsa info to stdout
@ 2009-04-23 10:00 Luke Yelavich
  2009-04-23 10:00 ` [PATCH] alsa-info.sh: use distros package manager to retrieve alsa library version Luke Yelavich
  2009-04-23 10:19 ` [PATCH] alsa-info.sh: add command-line flag to print alsa info to stdout Takashi Iwai
  0 siblings, 2 replies; 4+ messages in thread
From: Luke Yelavich @ 2009-04-23 10:00 UTC (permalink / raw)
  To: alsa-devel; +Cc: Luke Yelavich

Add the --stdout command-line flag to allow displaying the collected alsa
information directly to standard output. This is useful for bug information
collecting systems, such as Ubuntu's apport.

Signed-off-by: Luke Yelavich <themuso@ubuntu.com>
---
 utils/alsa-info.sh |   34 +++++++++++++++++++++++++++++-----
 1 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/utils/alsa-info.sh b/utils/alsa-info.sh
index 0fff671..ee0de16 100755
--- a/utils/alsa-info.sh
+++ b/utils/alsa-info.sh
@@ -277,6 +277,12 @@ case "$1" in
 		REPEAT=""
 		shift
 		;;
+	--stdout)
+		DIALOG=""
+		NOUPLOAD="yes"
+		QUESTION="no"
+		TOSTDOUT="yes"
+		;;
 esac
 done
 		
@@ -627,6 +633,17 @@ then
 				fi
 			fi
 			;;
+		--stdout)
+			NOUPLOAD="yes"
+			withdevices
+			withconfigs
+			withaplay
+			withamixer
+			withalsactl
+			withlsmod
+			cat $FILE
+			rm $FILE
+			;;
 		--about)
 			echo "Written/Tested by the following users of #alsa on irc.freenode.net:"
 			echo ""
@@ -635,6 +652,7 @@ then
 			echo "	gnubien - Various script ideas / Testing"
 			echo "	GrueMaster - HDA Intel specific items / Testing"
 			echo "	olegfink - Script update function"
+			echo "  TheMuso - display to stdout functionality"
 			exit 0
 			;;
 		*)
@@ -652,6 +670,8 @@ then
 			echo "	--no-upload (do not upload contents to remote server)"
 			echo "	--pastebin (use http://pastebin.ca) as remote server"
 			echo "	    instead www.alsa-project.org"
+			echo "  --stdout (print alsa information to standard output"
+			echo "      instead of a file)"
 			echo "	--about (show some information about the script)"
 			echo "	--debug (will run the script as normal, but will not"
 			echo "	     delete $FILE)"
@@ -668,7 +688,9 @@ fi
 
 if [ -n "$NOUPLOAD" ]; then
 
-	mv $FILE $NFILE || exit 1
+	if [ -z "$TOSTDOUT" ]; then
+		mv $FILE $NFILE || exit 1
+	fi
 
 	if [[ -n $DIALOG ]]
 	then
@@ -686,10 +708,12 @@ if [ -n "$NOUPLOAD" ]; then
 			echo "Your ALSA information can be seen by looking in $NFILE"
 			echo ""
 		else
-			echo "You requested that your information was NOT automatically uploaded to the $WWWSERVICE"
-			echo ""
-			echo "Your ALSA information can be seen by looking in $NFILE"
-			echo ""
+			if [ -z "$TOSTDOUT" ]; then
+				echo "You requested that your information was NOT automatically uploaded to the $WWWSERVICE"
+				echo ""
+				echo "Your ALSA information can be seen by looking in $NFILE"
+				echo ""
+			fi
 		fi
 	fi
 
-- 
1.6.0.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread
* [PATCH] alsa-info.sh: add command-line flag to print alsa info to stdout
@ 2009-03-30  0:03 Luke Yelavich
  0 siblings, 0 replies; 4+ messages in thread
From: Luke Yelavich @ 2009-03-30  0:03 UTC (permalink / raw)
  To: alsa-devel; +Cc: Luke Yelavich

Add the --stdout command-line flag to allow displaying the collected alsa
information directly to standard output. This is useful for bug information
collecting systems, such as Ubuntu's apport.

Signed-off-by: Luke Yelavich <themuso@ubuntu.com>
---
 utils/alsa-info.sh |   34 +++++++++++++++++++++++++++++-----
 1 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/utils/alsa-info.sh b/utils/alsa-info.sh
index b62c4d5..8340019 100755
--- a/utils/alsa-info.sh
+++ b/utils/alsa-info.sh
@@ -250,6 +250,12 @@ case "$1" in
 		REPEAT=""
 		shift
 		;;
+	--stdout)
+		DIALOG=""
+		NOUPLOAD="yes"
+		QUESTION="no"
+		TOSTDOUT="yes"
+		;;
 esac
 done
 		
@@ -596,6 +602,17 @@ then
 				fi
 			fi
 			;;
+		--stdout)
+			NOUPLOAD="yes"
+			withdevices
+			withconfigs
+			withaplay
+			withamixer
+			withalsactl
+			withlsmod
+			cat $FILE
+			rm $FILE
+			;;
 		--about)
 			echo "Written/Tested by the following users of #alsa on irc.freenode.net:"
 			echo ""
@@ -604,6 +621,7 @@ then
 			echo "	gnubien - Various script ideas / Testing"
 			echo "	GrueMaster - HDA Intel specific items / Testing"
 			echo "	olegfink - Script update function"
+			echo "  TheMuso - display to stdout functionality"
 			exit 0
 			;;
 		*)
@@ -621,6 +639,8 @@ then
 			echo "	--no-upload (do not upload contents to remote server)"
 			echo "	--pastebin (use http://pastebin.ca) as remote server"
 			echo "	    instead www.alsa-project.org"
+			echo "  --stdout (print alsa information to standard output"
+			echo "      instead of a file)"
 			echo "	--about (show some information about the script)"
 			echo "	--debug (will run the script as normal, but will not"
 			echo "	     delete $FILE)"
@@ -637,7 +657,9 @@ fi
 
 if [ -n "$NOUPLOAD" ]; then
 
-	mv $FILE $NFILE || exit 1
+	if [ -z "$TOSTDOUT" ]; then
+		mv $FILE $NFILE || exit 1
+	fi
 
 	if [[ -n $DIALOG ]]
 	then
@@ -655,10 +677,12 @@ if [ -n "$NOUPLOAD" ]; then
 			echo "Your ALSA information can be seen by looking in $NFILE"
 			echo ""
 		else
-			echo "You requested that your information was NOT automatically uploaded to the $WWWSERVICE"
-			echo ""
-			echo "Your ALSA information can be seen by looking in $NFILE"
-			echo ""
+			if [ -z "$TOSTDOUT" ]; then
+				echo "You requested that your information was NOT automatically uploaded to the $WWWSERVICE"
+				echo ""
+				echo "Your ALSA information can be seen by looking in $NFILE"
+				echo ""
+			fi
 		fi
 	fi
 
-- 
1.6.0.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-04-23 10:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-23 10:00 [PATCH] alsa-info.sh: add command-line flag to print alsa info to stdout Luke Yelavich
2009-04-23 10:00 ` [PATCH] alsa-info.sh: use distros package manager to retrieve alsa library version Luke Yelavich
2009-04-23 10:19 ` [PATCH] alsa-info.sh: add command-line flag to print alsa info to stdout Takashi Iwai
  -- strict thread matches above, loose matches on Subject: below --
2009-03-30  0:03 Luke Yelavich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox