Support for obsolete arguments
See original GitHub issueTo phase out the non-GNU parameter style of Paket we need to mark certain argument styles as obsolete.
Let’s take paket add
for example.
- The current style is this:
paket add nuget foo group Main version 1.0 --force
- We would like to support this:
paket add foo --group Main --version 1.0 --force
While we want to support the new style in the next major Paket version the old syntax should still be supported (for tooling like Ionide). Additionally, the old style should not be printed in the --help
text. If someone uses the old style a warning should be issued to stderr (during parsing).
It seems we would require a new attribute (or attribute flag of CustomCommandLineAttribute
?) to mark certain argument styles obsolete.
Currently, even before the GNU-style conversion, there are some arguments that are marked as obsolete in the help text, so I think it would be beneficial to have something like this.
I tried compiling Argu with VS 2017 but it failed with Argu.fsproj : error MSB4057: The target "Build" does not exist in the project.
.
// @forki
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (10 by maintainers)
Top GitHub Comments
As it stands, the implementation admits no distinction between the different names of an argument, other than their ordering. We would have to rework the internals so that additional metadata is associated with each individual name. As mentioned earlier, the requirement that obsolete arguments be hidden from the usage string or emit a warning in stderr seems arbitrary: other users may have different expectations of obsolescence. I think this is really an issue of introducing a third layer of configurability, at the argument name level, where things like usage string visibility or error messaging can be tweaked.
My impression is that all that engineering can be avoided by resorting to duplication of arguments like so:
I also think that an obsolete attribute on the union case level would be easier to achieve, assuming we agree what obsolete means in this context.
Excellent, I think I have a working solution. Please let me know what you think about the code and the output!