diff mbox series

[ndctl] Documentation: write-infoblock namespace as mutually exclusive

Message ID 20200708072319.10896-1-harish@linux.ibm.com (mailing list archive)
State New, archived
Headers show
Series [ndctl] Documentation: write-infoblock namespace as mutually exclusive | expand

Commit Message

Harish July 8, 2020, 7:23 a.m. UTC
The write-infoblock command allows user to write to only one of
namespace, stdout or to a file. Document that explicitly and also
change the usage string to indicate mutual exclusion.

Signed-off-by: Harish <harish@linux.ibm.com>
---
 Documentation/ndctl/ndctl-write-infoblock.txt | 14 ++++++++------
 ndctl/namespace.c                             |  4 +++-
 2 files changed, 11 insertions(+), 7 deletions(-)

Comments

Santosh Sivaraj July 8, 2020, 10:18 a.m. UTC | #1
Hi,

Harish <harish@linux.ibm.com> writes:

> The write-infoblock command allows user to write to only one of
> namespace, stdout or to a file. Document that explicitly and also
> change the usage string to indicate mutual exclusion.
>
> Signed-off-by: Harish <harish@linux.ibm.com>
> ---
>  Documentation/ndctl/ndctl-write-infoblock.txt | 14 ++++++++------
>  ndctl/namespace.c                             |  4 +++-
>  2 files changed, 11 insertions(+), 7 deletions(-)
>
> diff --git a/Documentation/ndctl/ndctl-write-infoblock.txt b/Documentation/ndctl/ndctl-write-infoblock.txt
> index 8197559..c29327d 100644
> --- a/Documentation/ndctl/ndctl-write-infoblock.txt
> +++ b/Documentation/ndctl/ndctl-write-infoblock.txt
> @@ -61,19 +61,21 @@ read 1 infoblock
>  
>  OPTIONS
>  -------
> -<namespace(s)>::
> -	One or more 'namespaceX.Y' device names. The keyword 'all' can be specified to
> -	operate on every namespace in the system, optionally filtered by bus id (see
> -        --bus= option), or region id (see --region= option).
> +<namespace>::
> +	Write the infoblock to 'namespaceX.Y' device name. The keyword 'all' can be
> +	specified to operate on every namespace in the system, optionally filtered
> +	by bus id (see --bus= option), or region id (see --region= option).
> +	(mutually exclusive with --stdout and --output)
>  
>  -c::
>  --stdout::
> -	Write the infoblock to stdout
> +	Write the infoblock to stdout (mutually
> +	exclusive with <namespace> and --output)
>  
>  -o::
>  --output=::
>  	Write the infoblock to the given file (mutually
> -	exclusive with --stdout).
> +	exclusive with <namespace> and --stdout).
>  
>  -m::
>  --mode=::
> diff --git a/ndctl/namespace.c b/ndctl/namespace.c
> index 0550580..cf6c4ea 100644
> --- a/ndctl/namespace.c
> +++ b/ndctl/namespace.c
> @@ -2346,7 +2346,9 @@ int cmd_read_infoblock(int argc, const char **argv, struct ndctl_ctx *ctx)
>  
>  int cmd_write_infoblock(int argc, const char **argv, struct ndctl_ctx *ctx)
>  {
> -	char *xable_usage = "ndctl write-infoblock <namespace> [<options>]";
> +	char *xable_usage = "ndctl write-infoblock [<namespace> | -o <file> "
> +			"| --stdout] [<options>]";
> +

This is now consistent with the man-page.

Since size (-s) mandatory with --stdout, should that be included in the usage
too?

  Usage: ndctl write-infoblock [<namespace> | -o <file> | -s SIZE --stdout] [<options>]

Reviewed-by: Santosh S <santosh@fossix.org>

Thanks,
Santosh
>  	const char *namespace = parse_namespace_options(argc, argv,
>  			ACTION_WRITE_INFOBLOCK, write_infoblock_options,
>  			xable_usage);
> -- 
> 2.26.2
diff mbox series

Patch

diff --git a/Documentation/ndctl/ndctl-write-infoblock.txt b/Documentation/ndctl/ndctl-write-infoblock.txt
index 8197559..c29327d 100644
--- a/Documentation/ndctl/ndctl-write-infoblock.txt
+++ b/Documentation/ndctl/ndctl-write-infoblock.txt
@@ -61,19 +61,21 @@  read 1 infoblock
 
 OPTIONS
 -------
-<namespace(s)>::
-	One or more 'namespaceX.Y' device names. The keyword 'all' can be specified to
-	operate on every namespace in the system, optionally filtered by bus id (see
-        --bus= option), or region id (see --region= option).
+<namespace>::
+	Write the infoblock to 'namespaceX.Y' device name. The keyword 'all' can be
+	specified to operate on every namespace in the system, optionally filtered
+	by bus id (see --bus= option), or region id (see --region= option).
+	(mutually exclusive with --stdout and --output)
 
 -c::
 --stdout::
-	Write the infoblock to stdout
+	Write the infoblock to stdout (mutually
+	exclusive with <namespace> and --output)
 
 -o::
 --output=::
 	Write the infoblock to the given file (mutually
-	exclusive with --stdout).
+	exclusive with <namespace> and --stdout).
 
 -m::
 --mode=::
diff --git a/ndctl/namespace.c b/ndctl/namespace.c
index 0550580..cf6c4ea 100644
--- a/ndctl/namespace.c
+++ b/ndctl/namespace.c
@@ -2346,7 +2346,9 @@  int cmd_read_infoblock(int argc, const char **argv, struct ndctl_ctx *ctx)
 
 int cmd_write_infoblock(int argc, const char **argv, struct ndctl_ctx *ctx)
 {
-	char *xable_usage = "ndctl write-infoblock <namespace> [<options>]";
+	char *xable_usage = "ndctl write-infoblock [<namespace> | -o <file> "
+			"| --stdout] [<options>]";
+
 	const char *namespace = parse_namespace_options(argc, argv,
 			ACTION_WRITE_INFOBLOCK, write_infoblock_options,
 			xable_usage);