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

feat: add 'proper' argument parsing #71

Closed
wants to merge 5 commits into from

Conversation

cs50victor
Copy link
Collaborator

@cs50victor cs50victor commented Jan 3, 2024

use clap crate and enum for arg parsing.

  • parsing to usize and then usize to back to String seems unnecessary / redundant.

Closes #26

#[cfg(not(target_arch = "wasm32"))]
#[derive(Debug, Parser)]
#[command(about = "bevy gaussian splatting render pipeline plugin", version, long_about = None)]
struct CliArgs {
Copy link
Owner

Choose a reason for hiding this comment

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

I think merging CliArgs and GaussianSplattingViewer structs would be great (can happen in a future PR though, let me know your bandwidth):

pub struct GaussianSplattingViewer {

e.g. this allows args like --height, --width, --hide_fps, --hide_editor, etc.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

makes sense

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

as for bandwidth, I plan on working / contributing on this project long term. I'll play around with merging the structs and see how it goes.

#[cfg(not(target_arch = "wasm32"))]
pub fn get_arg(n: usize) -> Option<String> {
std::env::args().nth(n)
pub fn get_arg(arg: MainArgs) -> Option<String> {
Copy link
Owner

Choose a reason for hiding this comment

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

converting this function to:
pub fn get_args() -> CliArgs (or pub fn get_args() -> GaussianSplattingViewer with the above suggestion) would simplify argument retrieval and avoid duplicate parse calls.

@cs50victor cs50victor marked this pull request as draft January 9, 2024 06:51
@mosure
Copy link
Owner

mosure commented Jan 15, 2024

here is a good reference: https://github.com/mosure/bevy_args

@mosure mosure changed the base branch from main to feat/clap January 25, 2024 21:15
@mosure mosure marked this pull request as ready for review January 25, 2024 21:16
@mosure mosure mentioned this pull request Jan 26, 2024
@mosure mosure closed this Jan 27, 2024
@cs50victor cs50victor deleted the feat/clap branch January 27, 2024 03:49
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.

add proper GaussianSplattingViewer argument parsing
2 participants