Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

Display help when running antler-proj without arguments #20

Closed
jolly-fellow opened this issue Mar 17, 2023 · 10 comments · Fixed by #52
Closed

Display help when running antler-proj without arguments #20

jolly-fellow opened this issue Mar 17, 2023 · 10 comments · Fixed by #52
Assignees
Labels
bug Something isn't working 👍 lgtm
Milestone

Comments

@jolly-fellow
Copy link
Contributor

jolly-fellow commented Mar 17, 2023

It doesn't describe option which allows to declare a name of the app, lib or dep for manipulations.
And addition options needed to specific commands like options for declaration of a programming language, build options an so on.

Actually the CLI syntax has two layers of commands and --help option (as other options) is context specific, i.e. prints a help text dependent on the command and subcommand but it is not described anywhere.
IMHO this principle should be described in the help text which prints antler-proj after run without options.

root@c1742fb0fdb3:/app# antler-proj add --help
Add an app, dependency, library or test to your project.
Usage: antler-proj add [OPTIONS] [path] [SUBCOMMAND]

Positionals:
path TEXT This is the root path to create the project in.

Options:
-h,--help Print this help message and exit
-p TEXT This is the root path to create the project in.

Subcommands:
app Add a new app to your project.
lib Add a new library to your project.
dep Add a new dependency to the project.
root@c1742fb0fdb3:/app# antler-proj update --help
Update an app, dependency, library or test to your project.
Usage: antler-proj update [OPTIONS] [path] [SUBCOMMAND]

Positionals:
path TEXT This must be the path to the project.yml or the path containing it.

Options:
-h,--help Print this help message and exit
-p TEXT This must be the path to the project.yml or the path containing it.

Subcommands:
app Remove app from the project.
lib Remove lib from the project.
dep Remove a dependency from the project.
root@c1742fb0fdb3:/app# antler-proj remove --help
Add an app, dependency, library or test to your project.
Usage: antler-proj remove [OPTIONS] path [SUBCOMMAND]

Positionals:
path TEXT REQUIRED This must be the path to the project.yml or the path containing it.

Options:
-h,--help Print this help message and exit
-p TEXT REQUIRED This must be the path to the project.yml or the path containing it.

Subcommands:
app Remove app from the project.
lib Remove lib from the project.
dep Remove a dependency from the project.

@jolly-fellow jolly-fellow added the bug Something isn't working label Mar 17, 2023
@stephenpdeos stephenpdeos added triage bug Something isn't working 👍 lgtm and removed bug Something isn't working triage labels Apr 7, 2023
@stephenpdeos stephenpdeos added this to the CDT 4.0.0-rc1 milestone Apr 10, 2023
@mikelik
Copy link
Contributor

mikelik commented Apr 27, 2023

@jolly-fellow what is this issue about?
Is it about changing description of -p for each of the command: antler-proj remove, antler-proj add, antler-proj update from:
This is the root path to create the project in.
to
This must be the path to the project.yml or the directory containing it.?

@jolly-fellow
Copy link
Contributor Author

@jolly-fellow what is this issue about? Is it about changing description of -p for each of the command: antler-proj remove, antler-proj add, antler-proj update from: This is the root path to create the project in. to This must be the path to the project.yml or the directory containing it.?

When we start ./antler-proj without parameters we see this text:

$ ./antler-proj 
Please run one of the subcommands available. Use --help to see what is available.

IMHO it is not enough for a user to understand what to do next because he don't know what is a subcommand, which subcommands are available and how to use --help.
IMHO this text should print the syntax of the CLI and basic rules how to use it i.e. the text which printed with global --help option. Actually may be it make sense to remove this global option at all. I don't see any reason to hide the following text from the user and force him to run the program twice to get this text.

And I'd prefer to use command word instead of subcommand because subcommand implies the presence of some command.

$ ./antler-proj --help
Antelope Smart Contract Project Management Tool
Usage: antler-proj [OPTIONS] [SUBCOMMAND]

Options:
  -h,--help                   Print this help message and exit
  -V,--version                get the version of antler-proj

Subcommands:
  validate                    Validate a project.
  update                      Update an app, dependency, library or test to your project.
  remove                      Add an app, dependency, library or test to your project.
  populate                    Populate a project's dependencies and CMake.
  init                        Initialize a new project creating the directory tree and a `project.yaml` file.
  build                       Build a project.
  add                         Add an app, dependency, library or test to your project.

Please run one of the subcommands with --help option to get detailed help for the subcommand.

@mikelik mikelik self-assigned this Apr 27, 2023
@mikelik mikelik moved this from Todo to In Progress in Team Backlog Apr 27, 2023
@mikelik mikelik changed the title Incorrect help text for commands "add", "update", "remove" Display help when running antler-proj without arguments Apr 27, 2023
@mikelik
Copy link
Contributor

mikelik commented Apr 27, 2023

I have added PR for displaying help when someone executes antler-proj without arguments.
As for subcommand vs command - this needs to be discussed.
I treat antler-proj as command and i.e. init or add as subcommands, so existing version LGTM.

@mikelik mikelik moved this from In Progress to Awaiting Review in Team Backlog Apr 27, 2023
@jolly-fellow
Copy link
Contributor Author

I have added PR for displaying help when someone executes antler-proj without arguments. As for subcommand vs command - this needs to be discussed. I treat antler-proj as command and i.e. init or add as subcommands, so existing version LGTM.

antler-proj is a program, an executable file, it is an entity from completely different field as command line arguments of CLI of the antler-proj program.

@mikelik
Copy link
Contributor

mikelik commented Apr 27, 2023

I have added PR for displaying help when someone executes antler-proj without arguments. As for subcommand vs command - this needs to be discussed. I treat antler-proj as command and i.e. init or add as subcommands, so existing version LGTM.

antler-proj is a program, an executable file, it is an entity from completely different field as command line arguments of CLI of the antler-proj program.

I think both naming conventions (your proposed and the existing one) make sense. In that case I wouldn't change it.
GPT "thinks" the same:
image

@ScottBailey
Copy link
Contributor

Quick feedback on command vs subcommand: since the command is antler-proj, it makes sense that add, init, etc is a subcommand.

We (ENF) use CLI11 in other tools and I don't think we should deviate here if we haven't in leap or CDT.

@ScottBailey
Copy link
Contributor

ScottBailey commented Apr 27, 2023

Maybe this should be closed as a duplicate of #13?

@ScottBailey
Copy link
Contributor

I think it's acceptable as is. But I would be on board for changing this a call missing a subcommand prints the simple help.

@mikelik
Copy link
Contributor

mikelik commented Apr 27, 2023

Maybe this should be closed as a duplicate of #13?

Not yet, in the PR related: #52 I'm printing --help when no arguments are provided

@ScottBailey
Copy link
Contributor

Maybe this should be closed as a duplicate of #13?

Not yet, in the PR related: #52 I'm printing --help when no arguments are provided

Have you seen: app.require_subcommand(); ? It may do what we want.

@github-project-automation github-project-automation bot moved this from Awaiting Review to Done in Team Backlog Apr 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working 👍 lgtm
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants