Open tanneberger opened 1 year ago
Note that zephyr
is a platform, not a target, so I think the syntax more likely should be something like lingo init c zephyr
.
Will have a look at this during the weekend!
An option is to fork this example repo and add some commands to west
and a HelloWorld.lf. Then lingo init c --platform=zephyr
(or however we want it), will clone the forked repo. A disadvantage is that we are dependent on an external repo
For the syntax I like --pltatform=
a lot better. Its always easier to understand named arguments. I would even use a required --target=
argument instead of the positional argument used above.
I agree that the more rigid way of dealing with parameter might be more readable, but it's annoying to type and harder to remember than a quick shorthand. I think we should take a careful look at how recent package managers work and how they deal with arguments.
There is something to be said for having a more imperative and readable style of giving commands. I personally like lingo init zephyr
a lot more than lingo init --platform=zephyr
.
The thing with positional arguments is that they are hard to remember. If we mix in the target, e.g. lingo init C zephyr
, it becomes hard to read and understand. In this example it is clear what is the language and what the platform, but there surely are possible pairs where it is not so obvious. And also when typing, you always have to remember both the order and the meaning of the positional arguments, while with --target
and --platform
you only need to know that you want to give a target and a platform, but do not need to worry about the order.
I get your point./ Still, I think we should resist the temptation to achieve too much generality with what one can specify on the command line. After all, we have a configuration file, which is much easier to edit than configure using an elaborate command that inevitably will start to look like the o figuration file itself.
Desired behavior
Creates
Lingo.toml
and./src/main.lf
with the correct target set and potentially other needed files.Help
=> The explanation refers to #6
./src/packages/mod.rs
is aConfigFile
this struct has aConfigFile::new()
function which generates the struct which is then written intoLingo.toml
./src/main.rs
are the command line arguments handled and files are currently created there but this can be moved../src/args.rs
is the expected command line argument schema.