* [ndctl PATCH] Documentation: write-infoblock namespace as mutually exclusive
@ 2020-07-08 7:23 Harish
2020-07-08 10:18 ` Santosh Sivaraj
0 siblings, 1 reply; 2+ messages in thread
From: Harish @ 2020-07-08 7:23 UTC (permalink / raw)
To: linux-nvdimm, dan.j.williams, vishal.l.verma; +Cc: Harish
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>]";
+
const char *namespace = parse_namespace_options(argc, argv,
ACTION_WRITE_INFOBLOCK, write_infoblock_options,
xable_usage);
--
2.26.2
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [ndctl PATCH] Documentation: write-infoblock namespace as mutually exclusive
2020-07-08 7:23 [ndctl PATCH] Documentation: write-infoblock namespace as mutually exclusive Harish
@ 2020-07-08 10:18 ` Santosh Sivaraj
0 siblings, 0 replies; 2+ messages in thread
From: Santosh Sivaraj @ 2020-07-08 10:18 UTC (permalink / raw)
To: Harish, linux-nvdimm, dan.j.williams, vishal.l.verma; +Cc: Harish
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
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-07-08 10:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-08 7:23 [ndctl PATCH] Documentation: write-infoblock namespace as mutually exclusive Harish
2020-07-08 10:18 ` Santosh Sivaraj
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox