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

Correct command line parser #13

Closed
jolly-fellow opened this issue Mar 14, 2023 · 4 comments · Fixed by #59
Closed

Correct command line parser #13

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

Comments

@jolly-fellow
Copy link
Contributor

jolly-fellow commented Mar 14, 2023

UPD: Actually the first part is implemented. antler-proj work as it described here.

  1. Arguments and commands should be unified similar to the description in the usecases.md. I.e. need to correct the command line parser to follow a simple syntax:

antler-proj <command> <path> [<args>]

for all commands.

Where a <command> is the first word after the program name, it has no dashes, path is a path to the project and args are arguments of the command, each argument name has leading dashes.
It makes the interface logical, predictable and unified. Details see in the usecases.md and users_guide.md

UPD: I have described this problem more detailed and my view how to solve it here: #50 (review)

  1. Duplicates of arguments which do the same thing should be removed because for example every command has two ways to receive path to the project:

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

Options:
-p TEXT This is the root path to create the project in.

command init had 3 duplicated parameters:

Positionals:
path TEXT REQUIRED This is the root path to create the project in.
project_name TEXT REQUIRED The name of the project.
version TEXT The version to store in the project file.

Options:
-p TEXT REQUIRED This is the root path to create the project in.
-n TEXT REQUIRED The name of the project.
-v TEXT The version to store in the project file.

@ScottBailey
Copy link
Contributor

  1. Required arguments should be positional. Having a flag is superfluous; however, when scripting I find it useful to have the long flag because it conveys more information to a future maintainer so there IS value to allowing these options have flags.
  2. I think we can remove positional information from the optional CLI inputs.

@ScottBailey
Copy link
Contributor

ScottBailey commented Apr 27, 2023

Additional comments based on current state of main:

  • We should have --help-all.
  • We should be consistent with help: either terminate with a period everywhere or nowhere.

See PR #54 for this.

@ScottBailey
Copy link
Contributor

ScottBailey commented Apr 27, 2023

See also issue #51

@ScottBailey
Copy link
Contributor

Consensus: all parameters become flag only. We are no longer using positional parameters.

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