[pve-devel] applied: [RFC PATCH v2 common] Use double hyphens when prefixing command options in the documentation

Wolfgang Bumiller w.bumiller at proxmox.com
Tue Sep 12 12:25:24 CEST 2017


applied

On Wed, Sep 06, 2017 at 02:37:33PM +0200, Emmanuel Kasper wrote:
> This makes our man pages follow the GNU long option recommandations
> where non-single character options are prefixed with a double hyphen
> (https://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html)
> 
> The benefit for PVE is that our documentation looks more similar to what
> a user with previous Linux knowledge is used to.
> 
> Our bash autocompletion helper only completes options using double hyphens too.
> ---
>  src/PVE/RESTHandler.pm | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/PVE/RESTHandler.pm b/src/PVE/RESTHandler.pm
> index d700976..5c1d419 100644
> --- a/src/PVE/RESTHandler.pm
> +++ b/src/PVE/RESTHandler.pm
> @@ -431,7 +431,7 @@ my $get_property_description = sub {
>  	} elsif ($style eq 'config-sub') {
>  	    $res .= "`$name`=";
>  	} elsif ($style eq 'arg') {
> -	    $res .= "`-$name` ";
> +	    $res .= "`--$name` ";
>  	} elsif ($style eq 'fixed') {
>  	    $res .= "`<$name>`: ";
>  	} else {
> @@ -578,7 +578,7 @@ sub usage_str {
>  
>  	if (!$prop->{$k}->{optional}) {
>  	    $args .= " " if $args;
> -	    $args .= "-$base <$type_text>"
> +	    $args .= "--$base <$type_text>"
>  	}
>      } 
>  
> -- 
> 2.11.0




More information about the pve-devel mailing list