RFC: Allow using lone arguments #853
Replies: 7 comments 5 replies
-
Hi, @sirenkovladd 🙋🏻♂️ In Poku's current design, this would cause a conflict: Currently, Poku filters out all values passed via CLI that don't start with There is also a particular reason why I chose to use the About mixing short flags and values, are there any particular advantages to this? For example, we would have to split the first character from the rest to define who the parameter is and what the value is, currently we don't need to validate the parameter unless we use the Also, it would cause a redundant check because when combining short flags, we would have to understand that for this specific case, we shouldn't split the first character from the rest, but all the characters. Now, as for the combination of short flags and the possibility of multiple use of the same flags with different values, those would be great features ✨
Please, let me know what you think 💡 |
Beta Was this translation helpful? Give feedback.
-
I'm a little confused, what is the complexity As for short and value, I think it's a standard, for example date you can use argument |
Beta Was this translation helpful? Give feedback.
-
I'm not a Windows user, so it's natural for me think first in Unix solutions and approaches. For example, until #80 I didn't know Poku didn't work with Windows 😂 There is no specific limitation, but a question of balancing compatibility, functionality and long-term ease of maintenance (I'll explain more about this below).
One of Poku's intentions is to be similar to Node.js at key points, for example, Node.js follows the node --test-reporter=spec --test-reporter=dot --test-reporter-destination=stdout --test-reporter-destination=file.txt At the same time, it's really easier to maintain support, as we can simply split the If the idea is to implement a robust and complete CLI tool, we could use yargs or a similar tool, but Poku has no intention of replacing robust tools like this, for example. And the idea is to keep Poku free of external dependencies. So, how it works?As mentioned above, there is a balance between creating a feature from scratch that ensures a good balance between actually working for what is needed, being easy to support in the long term, but at the same time being minimalist so that Poku doesn't lose its focus of being a test runner. Why do I emphasize on long-term support?The project has had various external contributions, but the majority of the time, I tend to maintain the project alone. But I'm hopeful that this will still change ✨ Creating too many complex strands that don't derive from the main topic of a test runner can cause an overload that will make it increasingly difficult to maintain and even create new features. PrioritiesPriorities and focus are always on the functionalities that a test runner really needs, but that doesn't mean that I don't intend to improve functionalities that add value for the end user. With this in mind, I believe it's of great value for Poku to be able to combine short-flags, for example. Don't take what I say as a rule, I love to discuss and talk 💡 |
Beta Was this translation helpful? Give feedback.
-
Okay, I agree that the node philosophy does not include short and value but lone argument seems to be supported node --eval "console.log(123)"
node --require tsx/cjs ./file.ts
node --env-file .env index.js |
Beta Was this translation helpful? Give feedback.
-
Considering the current way Poku works and that the focus is not on creating a robust CLI tool equivalent to yargs, for example, how would you suggest maintaining support for both formats without compromising performance (especially when extending Glob patterns)? A honest question: do you believe that the future work of maintaining dual compatibility for a side CLI helper is worth the benefit it would bring instead of focusing on the aggregate functionalities of a test runner? |
Beta Was this translation helpful? Give feedback.
-
I think that if you go the way it is implemented in Node.js, should have a list of arguments and their this is not a problem for most arguments, except when the argument supports both I don't think it is dual compatibility I agree that the current version is more readable, but honestly all my cli commands are as lone argument ( |
Beta Was this translation helpful? Give feedback.
-
Important For everyone. Although I've added the "help wanted" label, I'll point out a few important aspects and suggest taking care before getting hands-on with the code:
About the testsUsing the
This would triple (or more) the possibility of testing each feature via CLI (existing or new). Currently, these are the CLI options available (26):
As for the point that Node.js also accepts both formats, it's still difficult for me to understand the real advantage of migrating to the second standard. What would be the benefits of this approach for the end user? About the documentation
My personal opinionI'm in favor of maintaining support for only one of the formats:
But most importantly, Poku is not a CLI tool and is not intended to be. With this in mind, what would be the advantages of doubling or tripling the complexity of project maintenance in the long term (more test variations and more complex documentation)? All opinions and discussions are welcome in order to clarify how worthwhile it is to invest in this functionality that is not directly related to the scope of a test runner 🤝 |
Beta Was this translation helpful? Give feedback.
-
example
// short and valuepoku -cmy-file.json // -> poku --config=my-file.jsonmaybe, a breaking change for env
can be moved as part of #801
More details:
https://github.com/nodejs/node/blob/main/lib/internal/util/parse_args/parse_args.js#L217-L300
Beta Was this translation helpful? Give feedback.
All reactions