All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fouad Hilly <fouad.hilly@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Fouad Hilly <fouad.hilly@cloud.com>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v2 3/5] x86: Add usage() to print out usage message
Date: Tue, 16 Apr 2024 10:15:44 +0100	[thread overview]
Message-ID: <20240416091546.11622-4-fouad.hilly@cloud.com> (raw)
In-Reply-To: <20240416091546.11622-1-fouad.hilly@cloud.com>

Refactor xen-ucode tool by adding usage() to handle usage\help messages
As we add more command options this will keep help\usage messages in common block

[v2]
1- Improved message description.
2- Fixed formatting and indentation.
3- Error message to print to stderr.

Signed-off-by: Fouad Hilly <fouad.hilly@cloud.com>
---
 tools/misc/xen-ucode.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tools/misc/xen-ucode.c b/tools/misc/xen-ucode.c
index c6ae6498d659..0c0b2337b4ea 100644
--- a/tools/misc/xen-ucode.c
+++ b/tools/misc/xen-ucode.c
@@ -17,6 +17,15 @@ static xc_interface *xch;
 static const char intel_id[] = "GenuineIntel";
 static const char   amd_id[] = "AuthenticAMD";
 
+static void usage(const char *name)
+{
+    printf("%s: Xen microcode updating tool\n"
+           "Usage: %s [microcode file] [options]\n"
+           "Options:\n"
+           "show-cou-info   show CPU information and exit\n",
+           name, name);
+}
+
 static void show_curr_cpu(FILE *f)
 {
     int ret;
-- 
2.42.0



  parent reply	other threads:[~2024-04-16  9:16 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-16  9:15 [PATCH v2 0/5] x86/xen-ucode: Introduce --force option Fouad Hilly
2024-04-16  9:15 ` [PATCH v2 1/5] x86: Update x86 low level version check of microcode Fouad Hilly
2024-04-18 10:05   ` Andrew Cooper
2024-04-23 15:01     ` Fouad Hilly
2024-04-22 14:09   ` Jan Beulich
2024-04-23 15:00     ` Fouad Hilly
2024-04-16  9:15 ` [PATCH v2 2/5] x86: Refactor microcode_update() hypercall with flags Fouad Hilly
2024-04-22 14:18   ` Jan Beulich
2024-04-23 14:43     ` Fouad Hilly
2024-04-16  9:15 ` Fouad Hilly [this message]
2024-04-18  6:18   ` [PATCH v2 3/5] x86: Add usage() to print out usage message Jan Beulich
2024-04-22 17:30   ` Anthony PERARD
2024-04-16  9:15 ` [PATCH v2 4/5] x86: Use getopt to handle command line args Fouad Hilly
2024-04-22 17:48   ` Anthony PERARD
2024-04-23 15:16     ` Fouad Hilly
2024-04-23 16:50       ` Anthony PERARD
2024-04-16  9:15 ` [PATCH v2 5/5] x86: Add --force option to xen-ucode to override microcode version check Fouad Hilly
2024-04-22 17:57   ` Anthony PERARD
2024-04-23 15:26     ` Fouad Hilly
2024-04-23 16:58       ` Anthony PERARD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240416091546.11622-4-fouad.hilly@cloud.com \
    --to=fouad.hilly@cloud.com \
    --cc=anthony.perard@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.