[alsa-devel] [PATCH V3 3/4] BAT: Adjust parameters and strings

Takashi Iwai tiwai at suse.de
Fri Oct 16 10:44:23 CEST 2015


On Fri, 16 Oct 2015 10:12:05 +0200,
han.lu at intel.com wrote:
> 
> From: "Lu, Han" <han.lu at intel.com>
> 
> Use rational parameters and clearer comments.

This doesn't match with what you actually changed exactly.

In general, please give more care and love to the changelog comments.
This is the only verbose information the later reader can receive.

Also, using argv[0] as the command name isn't appropriate.  You can
pass a different name to argv[0] freely.  Use a constant pre-defined
program name instead.


thanks,

Takashi


> Signed-off-by: Lu, Han <han.lu at intel.com>
> 
> diff --git a/bat/bat.c b/bat/bat.c
> index 2320984..02b1abd 100644
> --- a/bat/bat.c
> +++ b/bat/bat.c
> @@ -268,16 +268,16 @@ static void test_capture(struct bat *bat)
>  	}
>  }
>  
> -static void usage(struct bat *bat, char *argv[])
> +static void usage(struct bat *bat, const char *command)
>  {
>  	fprintf(bat->log,
>  _("Usage:%s [Option]...\n"
>  "\n"
>  "-h, --help             help\n"
> -"-D                     sound card\n"
> +"-D                     pcm for both playback and capture\n"
>  "-P                     playback pcm\n"
>  "-C                     capture pcm\n"
> -"-f                     sample size\n"
> +"-f                     sample format\n"
>  "-c                     number of channels\n"
>  "-r                     sampling rate\n"
>  "-n                     frames to capture\n"
> @@ -289,7 +289,7 @@ _("Usage:%s [Option]...\n"
>  "    --file=#           input file\n"
>  "    --saveplay=#       save playback content to target file, for debug\n"
>  "    --local            internal loop, bypass hardware\n"
> -), argv[0]);
> +), command);
>  	fprintf(bat->log, _("Recognized sample formats are: %s %s %s %s\n"),
>  			snd_pcm_format_name(SND_PCM_FORMAT_U8),
>  			snd_pcm_format_name(SND_PCM_FORMAT_S16_LE),
> @@ -402,7 +402,7 @@ static void parse_arguments(struct bat *bat, int argc, char *argv[])
>  			break;
>  		case 'h':
>  		default:
> -			usage(bat, argv);
> +			usage(bat, argv[0]);
>  			exit(EXIT_SUCCESS);
>  		}
>  	}
> -- 
> 1.9.1
> 


More information about the Alsa-devel mailing list