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

[Subtask] Introduce apache.commons.cli basic framework #770

Closed
2 of 3 tasks
Tracked by #758
smallzhongfeng opened this issue Mar 27, 2023 · 3 comments
Closed
2 of 3 tasks
Tracked by #758

[Subtask] Introduce apache.commons.cli basic framework #770

smallzhongfeng opened this issue Mar 27, 2023 · 3 comments
Assignees

Comments

@smallzhongfeng
Copy link
Contributor

Code of Conduct

Search before asking

  • I have searched in the issues and found no similar issues.

Describe the subtask

We can imitate YarnCli to build a UnifleCli.

Parent issue

#758

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
@slfan1989
Copy link
Collaborator

@smallzhongfeng Can I assign this issue? Thank you very much!

@slfan1989
Copy link
Collaborator

I will submit the code of version 1 in the next 1-2 days.

slfan1989 pushed a commit to slfan1989/incubator-uniffle that referenced this issue Apr 26, 2023
slfan1989 pushed a commit to slfan1989/incubator-uniffle that referenced this issue Apr 26, 2023
slfan1989 pushed a commit to slfan1989/incubator-uniffle that referenced this issue Apr 27, 2023
slfan1989 pushed a commit to slfan1989/incubator-uniffle that referenced this issue Apr 27, 2023
slfan1989 pushed a commit to slfan1989/incubator-uniffle that referenced this issue Apr 27, 2023
slfan1989 pushed a commit to slfan1989/incubator-uniffle that referenced this issue Apr 27, 2023
slfan1989 pushed a commit to slfan1989/incubator-uniffle that referenced this issue Apr 27, 2023
slfan1989 pushed a commit to slfan1989/incubator-uniffle that referenced this issue Apr 27, 2023
slfan1989 pushed a commit to slfan1989/incubator-uniffle that referenced this issue Apr 27, 2023
slfan1989 pushed a commit to slfan1989/incubator-uniffle that referenced this issue Apr 27, 2023
slfan1989 pushed a commit to slfan1989/incubator-uniffle that referenced this issue Apr 27, 2023
jerqi pushed a commit that referenced this issue Apr 27, 2023
### What changes were proposed in this pull request?

We use `apache.commons.cli` to add commands to `Uniffle`.  I created a command called `uniffle`, the following is the case of using the command.

> Case1: Use the uniffle command directly.
- uniffle / uniffle --help
```
Usage: uniffle [OPTIONS] SUBCOMMAND [SUBCOMMAND OPTIONS]
 or    uniffle [OPTIONS] CLASSNAME [CLASSNAME OPTIONS]
  where CLASSNAME is a user-provided Java class

  OPTIONS is none or any of:

--daemon (start|status|stop)   operate on a daemon

  SUBCOMMAND is one of:


    Admin Commands:

admin-cli    prints uniffle-admin args information

    Client Commands:

client-cli   prints uniffle-cli args information

SUBCOMMAND may print help when invoked w/o parameters or with -h.
```

> Case2: use a command that does not create.
- uniffle testadmin

```
ERROR: testadmin is not COMMAND nor fully qualified CLASSNAME.
DEBUG: UNIFFLE_SUBCMD_USAGE_TYPES accepted client
DEBUG: UNIFFLE_SUBCMD_USAGE_TYPES accepted admin
Usage: uniffle [OPTIONS] SUBCOMMAND [SUBCOMMAND OPTIONS]
 or    uniffle [OPTIONS] CLASSNAME [CLASSNAME OPTIONS]
  where CLASSNAME is a user-provided Java class

  OPTIONS is none or any of:

--daemon (start|status|stop)   operate on a daemon

  SUBCOMMAND is one of:


    Admin Commands:

admin-cli    prints uniffle-admin args information

    Client Commands:

client-cli   prints uniffle-cli args information

SUBCOMMAND may print help when invoked w/o parameters or with -h.
```

> Case3: Use the help command
- uniffle client-cli --help

```
Usage:
   Optional
     -a,--admin <arg>   This is an admin command that will print args.
     -c,--cli <arg>     This is an client cli command that will print args.
     -h,--help          Help for the Uniffle CLI.
```

> Case4:  Run the example-cli command
- uniffle  client-cli --cli test-cli

```
uniffle-client-cli : test-cli
```

### Why are the changes needed?

We use apache.commons.cli to add commands to Uniffle. 

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

- Unit test verification.
- Execute commands directly.

Co-authored-by: slfan1989 <louj1988@@>
@smallzhongfeng
Copy link
Contributor Author

Fixed by #833

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

No branches or pull requests

2 participants