Skip to content
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

Inconsistent Behaviours in APISIX CLI #9742

Closed
kayx23 opened this issue Jun 28, 2023 · 7 comments
Closed

Inconsistent Behaviours in APISIX CLI #9742

kayx23 opened this issue Jun 28, 2023 · 7 comments
Assignees
Labels
discuss enhancement New feature or request

Comments

@kayx23
Copy link
Member

kayx23 commented Jun 28, 2023

Description

Relevant file: https://github.com/apache/apisix/blob/master/apisix/cli/ops.lua

1. Command -h option

A help menu for apisix start is printed if I run apisix start -h:
image

However, -h does not seem to work for the other CLI commands, which is unexpected from a user perspective.

For example, -h is ignored in the following examples with other commands:

image

2. --verbose option

parser:flag("--verbose", "show init_etcd debug information")

  • This should accept -v as well.
  • apisix init_etcd --verbose did not print additional debug info for me, compared with the output of apisix init_etcd. Is this how it's used? If so, can others share their results?

Environment

  • APISIX version: 3.3.0
  • Operating system: CentOS 8
@Revolyssup
Copy link
Contributor

@lingsamuel I can take this

@kayx23
Copy link
Member Author

kayx23 commented Aug 11, 2023

any update?

@Revolyssup
Copy link
Contributor

@kayx23 This got lost. Thanks for reminder. Putting this into backlog and will process it.

@Revolyssup Revolyssup added the enhancement New feature or request label Aug 11, 2023
@Revolyssup
Copy link
Contributor

Revolyssup commented Aug 28, 2023

Only start supports flags and arguments that is why flag parsing is not done on other commands as there are no flags(even help) on other commands like stop and quit. We can maybe still add -h on other commands where it will just output a message like stop: stops the running APISIX instance. Though the commands themselves are self explanatory.

@kayx23 What do you think? Should we add -h on other commands as well for consistency or keep things the way they are right now and add this to the doc for simplicity?

@Revolyssup
Copy link
Contributor

@kayx23 For the 2nd point, --verbose is to be used with apisix start and not apisix init_etcd. Example screenshot attached below.
Screenshot from 2023-08-29 10-19-49

For the 1st point, flag parsing is not consistent right now as it's not done in commands other than start. I think it's okay to have these flags local to start command as they are of little use in other commands. Either you can add this in the docs that the flags are not global or if this causes confusion with users then we can make -h flag global.

@kayx23
Copy link
Member Author

kayx23 commented Aug 29, 2023

Thanks for the help. One last thing, should there be a -v as well, shorthand for --verbose? Similar to-h to --help and -c to --config.

@Revolyssup
Copy link
Contributor

Revolyssup commented Aug 29, 2023

-v a

Yep, this suggestion makes sense to me. I will create a PR for this. Although, since -v sometimes is also used for --version, the author may have decided to be verbose about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss enhancement New feature or request
Projects
Archived in project
Development

No branches or pull requests

2 participants