Issue: rustlang cli arguments #54

Open
opened 2020-02-17 22:55:40 +01:00 by Kreyren · 2 comments
Kreyren commented 2020-02-17 22:55:40 +01:00 (Migrated from github.com)

Currently this solution is being used https://github.com/RXT0112/Zernit/blob/init-new/src/bin/main.rs#L83 (Crate clap) which proved to not be sufficient for our usecase since it requires the arguments to be hard-coded

Expecting

Expecting to define arguments based on data from path src/subcoms/rustlang/{command1,command2,..}


Is there a crate that does this or do we need to make a custom solution?

Currently this solution is being used https://github.com/RXT0112/Zernit/blob/init-new/src/bin/main.rs#L83 (Crate clap) which proved to not be sufficient for our usecase since it requires the arguments to be hard-coded ### Expecting Expecting to define arguments based on data from path `src/subcoms/rustlang/{command1,command2,..}` --- Is there a crate that does this or do we need to make a custom solution?
Kreyren commented 2020-02-17 23:02:22 +01:00 (Migrated from github.com)

Relevant: https://doc.rust-lang.org/cargo/reference/build-scripts.html

Relevant: https://doc.rust-lang.org/stable/cargo/reference/build-script-examples.html#code-generation

You could write a build script that parses your files and generates the clap (or structopt, or whatever) code.

your build script runs arbitrary Rust code. You read and parse the files however, then you generate Rust code. That Rust code is imported into your main

Relevant: https://doc.rust-lang.org/cargo/reference/build-scripts.html Relevant: https://doc.rust-lang.org/stable/cargo/reference/build-script-examples.html#code-generation > You could write a build script that parses your files and generates the clap (or structopt, or whatever) code. > your build script runs arbitrary Rust code. You read and parse the files however, then you generate Rust code. That Rust code is imported into your main
github-actions[bot] commented 2020-05-11 02:02:10 +02:00 (Migrated from github.com)

Stale issue message

Stale issue message
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kreyren/Zernit#54