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

Unify the option/positional/free attributes into arg #45

Merged
merged 1 commit into from
Dec 4, 2023

Conversation

tertsdiepraam
Copy link
Member

@tertsdiepraam tertsdiepraam commented Nov 30, 2023

Based on #38 (reply in thread)

There is now only attribute for variants on the Arguments enum: arg. The type of argument is determined based on the first value:

  • If it is a string literal starting with - or containing =, it is treated as an optional argument.
  • If it is another string literal, it is treated as positional.
  • If it is an identifier it is a "free" argument (which should be renamed to something else).

The rest of the arguments of the attribute are then parsed based on the type of argument. We should then also make the error messages better. For example, if an argument is used that can only be used on a certain type of argument, we should tell the user which argument type does accept it.

@tertsdiepraam tertsdiepraam changed the title Unify the option/positional/free attributes into arg Unify the option/positional/free attributes into arg Nov 30, 2023
Copy link
Collaborator

@cakebaker cakebaker left a comment

Choose a reason for hiding this comment

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

Good work!

@cakebaker cakebaker merged commit 92948f5 into uutils:main Dec 4, 2023
4 checks passed
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.

2 participants