[PATCH] makedumpfile: -v shows if lzo or snappy support enabled or not

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello chao

On 01/08/2014 01:40 PM, WANG Chao wrote:
> It would be great to have makedumpfile -v to show if lzo or snappy
> support is enabled or not, since --help prints too much and we have to
> scroll back three screens to check it out.
> 
> Using "+lzo" to indicate lzo is enabled and vice versa "-lzo" for lzo is
> disabled. Same for snappy.
> 
> For exmaple, If lzo and snappy support are enabled,
> 
>     $ ./makedumpfile -v
>     makedumpfile: version 1.5.5 (released on 18 Dec 2013)
>     +lzo +snappy
> 
> If both of them are disabled,
> 
>     $ ./makedumpfile -v
>     makedumpfile: version 1.5.5 (released on 18 Dec 2013)
>     -lzo -snappy

This is weird... we may even think we have lzo/snappy enabled
since an option is always specified with '-'.

My idea is to have "with lzo/snappy enabled" directly appended
when lzo/snappy enabled.

And is it ok to add such info to the version ? I don't know.
kumagai may give the answer.

Thanks.

> 
> Signed-off-by: WANG Chao <chaowang at redhat.com>
> ---
>  print_info.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/print_info.c b/print_info.c
> index 90b6cee..242b42c 100644
> --- a/print_info.c
> +++ b/print_info.c
> @@ -26,7 +26,17 @@ void
>  show_version(void)
>  {
>  	MSG("makedumpfile: version " VERSION " (released on " RELEASE_DATE ")\n");
> -	MSG("\n");
> +#ifdef USELZO
> +	MSG("+lzo ");
> +#else
> +	MSG("-lzo ");
> +#endif
> +#ifdef USESNAPPY
> +	MSG("+snappy ");
> +#else
> +	MSG("-snappy ");
> +#endif
> +	MSG("\n\n");
>  }
>  
>  void
> 


-- 
Thanks.
Zhang Yanfei



[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux