Skip to content

CA-413424: Enhance xe help output #6584

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BengangY
Copy link
Contributor

The previous xe help is as below:

Usage: xe <cmd> [-s server] [-p port] ([-u username] [-pw password] or [-pwf <password file>]) [--traceparent traceparent] <other arguments>

A full list of commands can be obtained by running
	xe help -s <server> -p <port>

The previous xe help output lacked debug-related options and did not provide detailed parameter description.
The new xe help output is as follows:

Usage:
  xe <command>
    [ -s <server> ]            XenServer host
    [ -p <port> ]              XenServer port number
    [ -u <username> -pw <password> | -pwf <password file> ]
                               User authentication (password or file)
    [ --nossl ]                Disable SSL/TLS
    [ --debug ]                Enable debug output
    [ --debug-on-fail ]        Enable debug output only on failure
    [ --traceparent <value> ]  Distributed tracing context
    [ <other arguments> ... ]  Command-specific options

A full list of commands can be obtained by running
  xe help -s <server> -p <port>

The previous `xe` help is as below:
```
Usage: xe <cmd> [-s server] [-p port] ([-u username] [-pw password] or [-pwf <password file>]) [--traceparent traceparent] <other arguments>

A full list of commands can be obtained by running
	xe help -s <server> -p <port>
```

The previous `xe` help output lacked debug-related options and did not
provide detailed parameter description.
The new `xe` help output is as follows:
```
Usage:
  xe <command>
    [ -s <server> ]            XenServer host
    [ -p <port> ]              XenServer port number
    [ -u <username> -pw <password> | -pwf <password file> ]
                               User authentication (password or file)
    [ --nossl ]                Disable SSL/TLS
    [ --debug ]                Enable debug output
    [ --debug-on-fail ]        Enable debug output only on failure
    [ --traceparent <value> ]  Distributed tracing context
    [ <other arguments> ... ]  Command-specific options

A full list of commands can be obtained by running
  xe help -s <server> -p <port>
```

Signed-off-by: Bengang Yuan <[email protected]>
@BengangY BengangY marked this pull request as ready for review July 10, 2025 06:57
@lindig
Copy link
Contributor

lindig commented Jul 10, 2025

When I run xe help I am getting this, which seems more comprehensive - see below. However, I like the proposed presentation of options in a table.

Usage: xe <command> [-s server] [-pw passwd] [-p port] [-u user] [-pwf password-file]
  [command specific arguments]

To get help on a specific command: xe help <command>
To get a full listing of commands: xe help --all

Common command list
-------------------
    cd-list, diagnostic-vm-status, network-list, snapshot-clone
    snapshot-copy, snapshot-disk-list, snapshot-export-to-template
    snapshot-reset-powerstate, snapshot-revert, snapshot-uninstall, sr-list
    template-export, template-uninstall, vm-cd-add, vm-cd-eject
    vm-cd-insert, vm-cd-list, vm-cd-remove, vm-checkpoint, vm-clone
    vm-compute-maximum-memory, vm-copy, vm-disk-add, vm-disk-list
    vm-disk-remove, vm-export, vm-import, vm-install, vm-list, vm-migrate
    vm-pause, vm-reboot, vm-reset-powerstate, vm-restart-device-models
    vm-resume, vm-shutdown, vm-snapshot, vm-snapshot-with-quiesce, vm-start
    vm-suspend, vm-uninstall, vm-unpause, vm-vif-list

Copy link
Contributor

@lindig lindig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another way to format this in source code would be using {| ... |}

Copy link
Member

@psafont psafont left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is definitely better, but we really need to stop hard-coding this and autogenerate it, the OCaml libraries for generating CLIs take care of this

\ [ --debug ] Enable debug output \n\
\ [ --debug-on-fail ] Enable debug output only on failure \n\
\ [ --traceparent <value> ] Distributed tracing context \n\
\ [ <other arguments> ... ] Command-specific options \n"
Copy link
Contributor

@changlei-li changlei-li Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will you also change xe help? Different with xe or xe -h, it seems be on server side.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I will.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for xe help you can manipulate the usage at client side and manipulate the remaining (Common command list .etc) at server side. Then the usage will keep consistent no matter if autogenerate it.

@BengangY
Copy link
Contributor Author

When I run xe help I am getting this, which seems more comprehensive - see below. However, I like the proposed presentation of options in a table.
Yes, I just found xe and xe help are coming from different code. Will change all of them.

@BengangY
Copy link
Contributor Author

BengangY commented Jul 10, 2025

This is definitely better, but we really need to stop hard-coding this and autogenerate it, the OCaml libraries for generating CLIs take care of this

Let me investigate how to auto-generate it.

@psafont
Copy link
Member

psafont commented Jul 10, 2025

Let me investigate how to auto-generate it.

We usually use cmdliner for these. But don't feel pressured into adding it for this PR. xe's CLI has many shortcomings and needs a good rework.

@lindig
Copy link
Contributor

lindig commented Jul 11, 2025

I think we should merge this. Moving towards Cmdliner will be a bigger change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants